orchestrator

package
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2021 License: Apache-2.0 Imports: 18 Imported by: 4

Documentation

Overview

Package orchestrator is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	AssessmentResult_ComplianceStatus_name = map[int32]string{
		0: "COMPLIANT",
		1: "NON_COMPLIANT",
	}
	AssessmentResult_ComplianceStatus_value = map[string]int32{
		"COMPLIANT":     0,
		"NON_COMPLIANT": 1,
	}
)

Enum value maps for AssessmentResult_ComplianceStatus.

View Source
var File_orchestrator_proto protoreflect.FileDescriptor
View Source
var Orchestrator_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "clouditor.Orchestrator",
	HandlerType: (*OrchestratorServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RegisterAssessmentTool",
			Handler:    _Orchestrator_RegisterAssessmentTool_Handler,
		},
		{
			MethodName: "ListAssessmentTools",
			Handler:    _Orchestrator_ListAssessmentTools_Handler,
		},
		{
			MethodName: "GetAssessmentTool",
			Handler:    _Orchestrator_GetAssessmentTool_Handler,
		},
		{
			MethodName: "UpdateAssessmentTool",
			Handler:    _Orchestrator_UpdateAssessmentTool_Handler,
		},
		{
			MethodName: "DeregisterAssessmentTool",
			Handler:    _Orchestrator_DeregisterAssessmentTool_Handler,
		},
		{
			MethodName: "StoreAssessmentResult",
			Handler:    _Orchestrator_StoreAssessmentResult_Handler,
		},
		{
			MethodName: "ListMetrics",
			Handler:    _Orchestrator_ListMetrics_Handler,
		},
		{
			MethodName: "GetMetric",
			Handler:    _Orchestrator_GetMetric_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "StreamAssessmentResults",
			Handler:       _Orchestrator_StreamAssessmentResults_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "orchestrator.proto",
}

Orchestrator_ServiceDesc is the grpc.ServiceDesc for Orchestrator service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterOrchestratorHandler

func RegisterOrchestratorHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterOrchestratorHandler registers the http handlers for service Orchestrator to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterOrchestratorHandlerClient

func RegisterOrchestratorHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OrchestratorClient) error

RegisterOrchestratorHandlerClient registers the http handlers for service Orchestrator to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "OrchestratorClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "OrchestratorClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "OrchestratorClient" to call the correct interceptors.

func RegisterOrchestratorHandlerFromEndpoint

func RegisterOrchestratorHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterOrchestratorHandlerFromEndpoint is same as RegisterOrchestratorHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterOrchestratorHandlerServer

func RegisterOrchestratorHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrchestratorServer) error

RegisterOrchestratorHandlerServer registers the http handlers for service Orchestrator to "mux". UnaryRPC :call OrchestratorServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterOrchestratorHandlerFromEndpoint instead.

func RegisterOrchestratorServer

func RegisterOrchestratorServer(s grpc.ServiceRegistrar, srv OrchestratorServer)

Types

type AssessmentResult

type AssessmentResult struct {

	// the ID in a uuid format
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// the ID of the metric it refers to
	MetricId    string                            `protobuf:"bytes,2,opt,name=metric_id,json=metricId,proto3" json:"metric_id,omitempty"`
	Result      AssessmentResult_ComplianceStatus `protobuf:"varint,3,opt,name=result,proto3,enum=clouditor.AssessmentResult_ComplianceStatus" json:"result,omitempty"`
	TargetValue string                            `protobuf:"bytes,4,opt,name=target_value,json=targetValue,proto3" json:"target_value,omitempty"`
	Evidence    *assessment.Evidence              `protobuf:"bytes,5,opt,name=evidence,proto3" json:"evidence,omitempty"`
	// contains filtered or unexported fields
}

func (*AssessmentResult) Descriptor deprecated

func (*AssessmentResult) Descriptor() ([]byte, []int)

Deprecated: Use AssessmentResult.ProtoReflect.Descriptor instead.

func (*AssessmentResult) GetEvidence

func (x *AssessmentResult) GetEvidence() *assessment.Evidence

func (*AssessmentResult) GetId

func (x *AssessmentResult) GetId() string

func (*AssessmentResult) GetMetricId

func (x *AssessmentResult) GetMetricId() string

func (*AssessmentResult) GetResult

func (*AssessmentResult) GetTargetValue

func (x *AssessmentResult) GetTargetValue() string

func (*AssessmentResult) ProtoMessage

func (*AssessmentResult) ProtoMessage()

func (*AssessmentResult) ProtoReflect

func (x *AssessmentResult) ProtoReflect() protoreflect.Message

func (*AssessmentResult) Reset

func (x *AssessmentResult) Reset()

func (*AssessmentResult) String

func (x *AssessmentResult) String() string

type AssessmentResult_ComplianceStatus

type AssessmentResult_ComplianceStatus int32
const (
	AssessmentResult_COMPLIANT     AssessmentResult_ComplianceStatus = 0
	AssessmentResult_NON_COMPLIANT AssessmentResult_ComplianceStatus = 1
)

func (AssessmentResult_ComplianceStatus) Descriptor

func (AssessmentResult_ComplianceStatus) Enum

func (AssessmentResult_ComplianceStatus) EnumDescriptor deprecated

func (AssessmentResult_ComplianceStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use AssessmentResult_ComplianceStatus.Descriptor instead.

func (AssessmentResult_ComplianceStatus) Number

func (AssessmentResult_ComplianceStatus) String

func (AssessmentResult_ComplianceStatus) Type

type AssessmentTool

type AssessmentTool struct {
	Id          string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name        string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// a list of metrics that this tool can assess, referred by their ids
	AvailableMetrics []string `protobuf:"bytes,4,rep,name=available_metrics,json=availableMetrics,proto3" json:"available_metrics,omitempty"`
	// contains filtered or unexported fields
}

Represents an external tool or service that offers assessments according to certain metrics

func (*AssessmentTool) Descriptor deprecated

func (*AssessmentTool) Descriptor() ([]byte, []int)

Deprecated: Use AssessmentTool.ProtoReflect.Descriptor instead.

func (*AssessmentTool) GetAvailableMetrics

func (x *AssessmentTool) GetAvailableMetrics() []string

func (*AssessmentTool) GetDescription

func (x *AssessmentTool) GetDescription() string

func (*AssessmentTool) GetId

func (x *AssessmentTool) GetId() string

func (*AssessmentTool) GetName

func (x *AssessmentTool) GetName() string

func (*AssessmentTool) ProtoMessage

func (*AssessmentTool) ProtoMessage()

func (*AssessmentTool) ProtoReflect

func (x *AssessmentTool) ProtoReflect() protoreflect.Message

func (*AssessmentTool) Reset

func (x *AssessmentTool) Reset()

func (*AssessmentTool) String

func (x *AssessmentTool) String() string

type DeregisterAssessmentToolRequest

type DeregisterAssessmentToolRequest struct {
	ToolId string `protobuf:"bytes,1,opt,name=tool_id,json=toolId,proto3" json:"tool_id,omitempty"`
	// contains filtered or unexported fields
}

func (*DeregisterAssessmentToolRequest) Descriptor deprecated

func (*DeregisterAssessmentToolRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeregisterAssessmentToolRequest.ProtoReflect.Descriptor instead.

func (*DeregisterAssessmentToolRequest) GetToolId

func (x *DeregisterAssessmentToolRequest) GetToolId() string

func (*DeregisterAssessmentToolRequest) ProtoMessage

func (*DeregisterAssessmentToolRequest) ProtoMessage()

func (*DeregisterAssessmentToolRequest) ProtoReflect

func (*DeregisterAssessmentToolRequest) Reset

func (*DeregisterAssessmentToolRequest) String

type GetAssessmentToolRequest

type GetAssessmentToolRequest struct {
	ToolId string `protobuf:"bytes,1,opt,name=tool_id,json=toolId,proto3" json:"tool_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetAssessmentToolRequest) Descriptor deprecated

func (*GetAssessmentToolRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetAssessmentToolRequest.ProtoReflect.Descriptor instead.

func (*GetAssessmentToolRequest) GetToolId

func (x *GetAssessmentToolRequest) GetToolId() string

func (*GetAssessmentToolRequest) ProtoMessage

func (*GetAssessmentToolRequest) ProtoMessage()

func (*GetAssessmentToolRequest) ProtoReflect

func (x *GetAssessmentToolRequest) ProtoReflect() protoreflect.Message

func (*GetAssessmentToolRequest) Reset

func (x *GetAssessmentToolRequest) Reset()

func (*GetAssessmentToolRequest) String

func (x *GetAssessmentToolRequest) String() string

type GetMetricsRequest

type GetMetricsRequest struct {
	MetricId int32 `protobuf:"varint,1,opt,name=metric_id,json=metricId,proto3" json:"metric_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetMetricsRequest) Descriptor deprecated

func (*GetMetricsRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetMetricsRequest.ProtoReflect.Descriptor instead.

func (*GetMetricsRequest) GetMetricId

func (x *GetMetricsRequest) GetMetricId() int32

func (*GetMetricsRequest) ProtoMessage

func (*GetMetricsRequest) ProtoMessage()

func (*GetMetricsRequest) ProtoReflect

func (x *GetMetricsRequest) ProtoReflect() protoreflect.Message

func (*GetMetricsRequest) Reset

func (x *GetMetricsRequest) Reset()

func (*GetMetricsRequest) String

func (x *GetMetricsRequest) String() string

type ListAssessmentToolsRequest

type ListAssessmentToolsRequest struct {

	// filter tools by metric id
	MetricId string `protobuf:"bytes,1,opt,name=metric_id,json=metricId,proto3" json:"metric_id,omitempty"`
	// contains filtered or unexported fields
}

func (*ListAssessmentToolsRequest) Descriptor deprecated

func (*ListAssessmentToolsRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListAssessmentToolsRequest.ProtoReflect.Descriptor instead.

func (*ListAssessmentToolsRequest) GetMetricId

func (x *ListAssessmentToolsRequest) GetMetricId() string

func (*ListAssessmentToolsRequest) ProtoMessage

func (*ListAssessmentToolsRequest) ProtoMessage()

func (*ListAssessmentToolsRequest) ProtoReflect

func (*ListAssessmentToolsRequest) Reset

func (x *ListAssessmentToolsRequest) Reset()

func (*ListAssessmentToolsRequest) String

func (x *ListAssessmentToolsRequest) String() string

type ListAssessmentToolsResponse

type ListAssessmentToolsResponse struct {
	Tools []*AssessmentTool `protobuf:"bytes,1,rep,name=tools,proto3" json:"tools,omitempty"`
	// contains filtered or unexported fields
}

func (*ListAssessmentToolsResponse) Descriptor deprecated

func (*ListAssessmentToolsResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListAssessmentToolsResponse.ProtoReflect.Descriptor instead.

func (*ListAssessmentToolsResponse) GetTools

func (*ListAssessmentToolsResponse) ProtoMessage

func (*ListAssessmentToolsResponse) ProtoMessage()

func (*ListAssessmentToolsResponse) ProtoReflect

func (*ListAssessmentToolsResponse) Reset

func (x *ListAssessmentToolsResponse) Reset()

func (*ListAssessmentToolsResponse) String

func (x *ListAssessmentToolsResponse) String() string

type ListMetricsRequest

type ListMetricsRequest struct {
	// contains filtered or unexported fields
}

func (*ListMetricsRequest) Descriptor deprecated

func (*ListMetricsRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListMetricsRequest.ProtoReflect.Descriptor instead.

func (*ListMetricsRequest) ProtoMessage

func (*ListMetricsRequest) ProtoMessage()

func (*ListMetricsRequest) ProtoReflect

func (x *ListMetricsRequest) ProtoReflect() protoreflect.Message

func (*ListMetricsRequest) Reset

func (x *ListMetricsRequest) Reset()

func (*ListMetricsRequest) String

func (x *ListMetricsRequest) String() string

type ListMetricsResponse

type ListMetricsResponse struct {
	Metrics []*assessment.Metric `protobuf:"bytes,1,rep,name=metrics,proto3" json:"metrics,omitempty"`
	// contains filtered or unexported fields
}

func (*ListMetricsResponse) Descriptor deprecated

func (*ListMetricsResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListMetricsResponse.ProtoReflect.Descriptor instead.

func (*ListMetricsResponse) GetMetrics

func (x *ListMetricsResponse) GetMetrics() []*assessment.Metric

func (*ListMetricsResponse) ProtoMessage

func (*ListMetricsResponse) ProtoMessage()

func (*ListMetricsResponse) ProtoReflect

func (x *ListMetricsResponse) ProtoReflect() protoreflect.Message

func (*ListMetricsResponse) Reset

func (x *ListMetricsResponse) Reset()

func (*ListMetricsResponse) String

func (x *ListMetricsResponse) String() string

type OrchestratorClient

type OrchestratorClient interface {
	RegisterAssessmentTool(ctx context.Context, in *RegisterAssessmentToolRequest, opts ...grpc.CallOption) (*AssessmentTool, error)
	ListAssessmentTools(ctx context.Context, in *ListAssessmentToolsRequest, opts ...grpc.CallOption) (*ListAssessmentToolsResponse, error)
	GetAssessmentTool(ctx context.Context, in *GetAssessmentToolRequest, opts ...grpc.CallOption) (*AssessmentTool, error)
	UpdateAssessmentTool(ctx context.Context, in *UpdateAssessmentToolRequest, opts ...grpc.CallOption) (*AssessmentTool, error)
	DeregisterAssessmentTool(ctx context.Context, in *DeregisterAssessmentToolRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	StoreAssessmentResult(ctx context.Context, in *StoreAssessmentResultRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	StreamAssessmentResults(ctx context.Context, opts ...grpc.CallOption) (Orchestrator_StreamAssessmentResultsClient, error)
	ListMetrics(ctx context.Context, in *ListMetricsRequest, opts ...grpc.CallOption) (*ListMetricsResponse, error)
	GetMetric(ctx context.Context, in *GetMetricsRequest, opts ...grpc.CallOption) (*assessment.Metric, error)
}

OrchestratorClient is the client API for Orchestrator service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type OrchestratorServer

type OrchestratorServer interface {
	RegisterAssessmentTool(context.Context, *RegisterAssessmentToolRequest) (*AssessmentTool, error)
	ListAssessmentTools(context.Context, *ListAssessmentToolsRequest) (*ListAssessmentToolsResponse, error)
	GetAssessmentTool(context.Context, *GetAssessmentToolRequest) (*AssessmentTool, error)
	UpdateAssessmentTool(context.Context, *UpdateAssessmentToolRequest) (*AssessmentTool, error)
	DeregisterAssessmentTool(context.Context, *DeregisterAssessmentToolRequest) (*emptypb.Empty, error)
	StoreAssessmentResult(context.Context, *StoreAssessmentResultRequest) (*emptypb.Empty, error)
	StreamAssessmentResults(Orchestrator_StreamAssessmentResultsServer) error
	ListMetrics(context.Context, *ListMetricsRequest) (*ListMetricsResponse, error)
	GetMetric(context.Context, *GetMetricsRequest) (*assessment.Metric, error)
	// contains filtered or unexported methods
}

OrchestratorServer is the server API for Orchestrator service. All implementations must embed UnimplementedOrchestratorServer for forward compatibility

type Orchestrator_StreamAssessmentResultsClient

type Orchestrator_StreamAssessmentResultsClient interface {
	Send(*AssessmentResult) error
	CloseAndRecv() (*emptypb.Empty, error)
	grpc.ClientStream
}

type Orchestrator_StreamAssessmentResultsServer

type Orchestrator_StreamAssessmentResultsServer interface {
	SendAndClose(*emptypb.Empty) error
	Recv() (*AssessmentResult, error)
	grpc.ServerStream
}

type RegisterAssessmentToolRequest

type RegisterAssessmentToolRequest struct {
	Tool *AssessmentTool `protobuf:"bytes,1,opt,name=tool,proto3" json:"tool,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterAssessmentToolRequest) Descriptor deprecated

func (*RegisterAssessmentToolRequest) Descriptor() ([]byte, []int)

Deprecated: Use RegisterAssessmentToolRequest.ProtoReflect.Descriptor instead.

func (*RegisterAssessmentToolRequest) GetTool

func (*RegisterAssessmentToolRequest) ProtoMessage

func (*RegisterAssessmentToolRequest) ProtoMessage()

func (*RegisterAssessmentToolRequest) ProtoReflect

func (*RegisterAssessmentToolRequest) Reset

func (x *RegisterAssessmentToolRequest) Reset()

func (*RegisterAssessmentToolRequest) String

type StoreAssessmentResultRequest

type StoreAssessmentResultRequest struct {
	Result *AssessmentResult `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*StoreAssessmentResultRequest) Descriptor deprecated

func (*StoreAssessmentResultRequest) Descriptor() ([]byte, []int)

Deprecated: Use StoreAssessmentResultRequest.ProtoReflect.Descriptor instead.

func (*StoreAssessmentResultRequest) GetResult

func (*StoreAssessmentResultRequest) ProtoMessage

func (*StoreAssessmentResultRequest) ProtoMessage()

func (*StoreAssessmentResultRequest) ProtoReflect

func (*StoreAssessmentResultRequest) Reset

func (x *StoreAssessmentResultRequest) Reset()

func (*StoreAssessmentResultRequest) String

type UnimplementedOrchestratorServer

type UnimplementedOrchestratorServer struct {
}

UnimplementedOrchestratorServer must be embedded to have forward compatible implementations.

func (UnimplementedOrchestratorServer) DeregisterAssessmentTool

func (UnimplementedOrchestratorServer) GetAssessmentTool

func (UnimplementedOrchestratorServer) GetMetric

func (UnimplementedOrchestratorServer) ListMetrics

func (UnimplementedOrchestratorServer) RegisterAssessmentTool

func (UnimplementedOrchestratorServer) StoreAssessmentResult

func (UnimplementedOrchestratorServer) StreamAssessmentResults

func (UnimplementedOrchestratorServer) UpdateAssessmentTool

type UnsafeOrchestratorServer

type UnsafeOrchestratorServer interface {
	// contains filtered or unexported methods
}

UnsafeOrchestratorServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to OrchestratorServer will result in compilation errors.

type UpdateAssessmentToolRequest

type UpdateAssessmentToolRequest struct {
	ToolId string          `protobuf:"bytes,1,opt,name=tool_id,json=toolId,proto3" json:"tool_id,omitempty"`
	Tool   *AssessmentTool `protobuf:"bytes,2,opt,name=tool,proto3" json:"tool,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateAssessmentToolRequest) Descriptor deprecated

func (*UpdateAssessmentToolRequest) Descriptor() ([]byte, []int)

Deprecated: Use UpdateAssessmentToolRequest.ProtoReflect.Descriptor instead.

func (*UpdateAssessmentToolRequest) GetTool

func (*UpdateAssessmentToolRequest) GetToolId

func (x *UpdateAssessmentToolRequest) GetToolId() string

func (*UpdateAssessmentToolRequest) ProtoMessage

func (*UpdateAssessmentToolRequest) ProtoMessage()

func (*UpdateAssessmentToolRequest) ProtoReflect

func (*UpdateAssessmentToolRequest) Reset

func (x *UpdateAssessmentToolRequest) Reset()

func (*UpdateAssessmentToolRequest) String

func (x *UpdateAssessmentToolRequest) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL