Documentation ¶
Index ¶
- Constants
- Variables
- func LoadMetrics(metricsFile string) (err error)
- type Service
- func (s *Service) CreateDefaultTargetCloudService() (service *orchestrator.CloudService, err error)
- func (s *Service) GetCloudService(_ context.Context, req *orchestrator.GetCloudServiceRequest) (response *orchestrator.CloudService, err error)
- func (*Service) GetMetric(_ context.Context, request *orchestrator.GetMetricsRequest) (response *assessment.Metric, err error)
- func (s *Service) GetMetricConfiguration(_ context.Context, req *orchestrator.GetMetricConfigurationRequest) (response *assessment.MetricConfiguration, err error)
- func (s *Service) ListAssessmentResults(_ context.Context, _ *assessment.ListAssessmentResultsRequest) (res *assessment.ListAssessmentResultsResponse, err error)
- func (s *Service) ListCloudServices(_ context.Context, _ *orchestrator.ListCloudServicesRequest) (response *orchestrator.ListCloudServicesResponse, err error)
- func (s *Service) ListMetricConfigurations(ctx context.Context, req *orchestrator.ListMetricConfigurationRequest) (response *orchestrator.ListMetricConfigurationResponse, err error)
- func (*Service) ListMetrics(_ context.Context, _ *orchestrator.ListMetricsRequest) (response *orchestrator.ListMetricsResponse, err error)
- func (s *Service) RegisterAssessmentResultHook(hook func(result *assessment.AssessmentResult, err error))
- func (s *Service) RegisterCloudService(_ context.Context, req *orchestrator.RegisterCloudServiceRequest) (service *orchestrator.CloudService, err error)
- func (s *Service) RemoveCloudService(_ context.Context, req *orchestrator.RemoveCloudServiceRequest) (response *emptypb.Empty, err error)
- func (s *Service) StoreAssessmentResult(_ context.Context, req *orchestrator.StoreAssessmentResultRequest) (resp *orchestrator.StoreAssessmentResultResponse, err error)
- func (s *Service) StoreAssessmentResults(stream orchestrator.Orchestrator_StoreAssessmentResultsServer) (err error)
- func (s *Service) UpdateCloudService(_ context.Context, req *orchestrator.UpdateCloudServiceRequest) (response *orchestrator.CloudService, err error)
Constants ¶
const DefaultTargetCloudServiceDescription = "The default target cloud service"
const DefaultTargetCloudServiceId = "00000000-0000-0000-000000000000"
const DefaultTargetCloudServiceName = "default"
Variables ¶
var DefaultMetricsFile = "metrics.json"
Functions ¶
func LoadMetrics ¶ added in v1.3.5
LoadMetrics loads metrics definitions from a JSON file.
Types ¶
type Service ¶
type Service struct { orchestrator.UnimplementedOrchestratorServer // Hook AssessmentResultHooks []func(result *assessment.AssessmentResult, err error) // contains filtered or unexported fields }
Service is an implementation of the Clouditor Orchestrator service
func NewService ¶ added in v1.3.11
func NewService() *Service
func (*Service) CreateDefaultTargetCloudService ¶ added in v1.3.11
func (s *Service) CreateDefaultTargetCloudService() (service *orchestrator.CloudService, err error)
CreateDefaultTargetCloudService creates a new "default" target cloud services, if no target service exists in the database.
If a new target cloud service was created, it will be returned.
func (*Service) GetCloudService ¶ added in v1.3.11
func (s *Service) GetCloudService(_ context.Context, req *orchestrator.GetCloudServiceRequest) (response *orchestrator.CloudService, err error)
func (*Service) GetMetric ¶
func (*Service) GetMetric(_ context.Context, request *orchestrator.GetMetricsRequest) (response *assessment.Metric, err error)
func (*Service) GetMetricConfiguration ¶ added in v1.3.11
func (s *Service) GetMetricConfiguration(_ context.Context, req *orchestrator.GetMetricConfigurationRequest) (response *assessment.MetricConfiguration, err error)
func (*Service) ListAssessmentResults ¶ added in v1.3.12
func (s *Service) ListAssessmentResults(_ context.Context, _ *assessment.ListAssessmentResultsRequest) (res *assessment.ListAssessmentResultsResponse, err error)
ListAssessmentResults is a method implementation of the orchestrator interface
func (*Service) ListCloudServices ¶ added in v1.3.11
func (s *Service) ListCloudServices(_ context.Context, _ *orchestrator.ListCloudServicesRequest) (response *orchestrator.ListCloudServicesResponse, err error)
func (*Service) ListMetricConfigurations ¶ added in v1.3.11
func (s *Service) ListMetricConfigurations(ctx context.Context, req *orchestrator.ListMetricConfigurationRequest) (response *orchestrator.ListMetricConfigurationResponse, err error)
ListMetricConfigurations retrieves a list of MetricConfiguration objects for a particular target cloud service specified in req.
The list MUST include a configuration for each known metric. If the user did not specify a custom configuration for a particular metric within the service, the default metric configuration is inserted into the list.
func (*Service) ListMetrics ¶
func (*Service) ListMetrics(_ context.Context, _ *orchestrator.ListMetricsRequest) (response *orchestrator.ListMetricsResponse, err error)
func (*Service) RegisterAssessmentResultHook ¶ added in v1.3.11
func (s *Service) RegisterAssessmentResultHook(hook func(result *assessment.AssessmentResult, err error))
func (*Service) RegisterCloudService ¶ added in v1.3.11
func (s *Service) RegisterCloudService(_ context.Context, req *orchestrator.RegisterCloudServiceRequest) (service *orchestrator.CloudService, err error)
func (*Service) RemoveCloudService ¶ added in v1.3.11
func (s *Service) RemoveCloudService(_ context.Context, req *orchestrator.RemoveCloudServiceRequest) (response *emptypb.Empty, err error)
func (*Service) StoreAssessmentResult ¶ added in v1.3.11
func (s *Service) StoreAssessmentResult(_ context.Context, req *orchestrator.StoreAssessmentResultRequest) (resp *orchestrator.StoreAssessmentResultResponse, err error)
StoreAssessmentResult is a method implementation of the orchestrator interface: It receives an assessment result and stores it
func (*Service) StoreAssessmentResults ¶ added in v1.3.11
func (s *Service) StoreAssessmentResults(stream orchestrator.Orchestrator_StoreAssessmentResultsServer) (err error)
func (*Service) UpdateCloudService ¶ added in v1.3.11
func (s *Service) UpdateCloudService(_ context.Context, req *orchestrator.UpdateCloudServiceRequest) (response *orchestrator.CloudService, err error)