Documentation ¶
Index ¶
- Constants
- func WithEvalManagerAddress(url string) service.ServiceOption[Server]
- func WithInterval(interval int) service.ServiceOption[Server]
- func WithOAuth2Authorizer(config *clientcredentials.Config) service.ServiceOption[Server]
- func WithStorage(storage persistence.Storage) service.ServiceOption[Server]
- type MonitorScheduler
- type Server
- func (srv *Server) AddCollectionModule(_ context.Context, req *configuration.AddCollectionModuleRequest) (res *collection.CollectionModule, err error)
- func (srv *Server) Authorizer() api.Authorizer
- func (s *Server) ConfigureCloudService(_ context.Context, req *configuration.ConfigureCloudServiceRequest) (res *configuration.ConfigureCloudServiceResponse, err error)
- func (srv *Server) FindCollectionModule(_ context.Context, req *configuration.FindCollectionModuleRequest) (res *collection.CollectionModule, err error)
- func (s *Server) GetCloudService(ctx context.Context, req *orchestrator.GetCloudServiceRequest) (*orchestrator.CloudService, error)
- func (s *Server) GetMetric(ctx context.Context, req *orchestrator.GetMetricRequest) (res *assessment.Metric, err error)
- func (srv *Server) GetMonitoringStatus(_ context.Context, req *configuration.GetMonitoringStatusRequest) (res *configuration.MonitoringStatus, err error)
- func (srv *Server) GetServiceConfiguration(serviceID string, cm *collection.CollectionModule) (serviceConfig *collection.ServiceConfiguration)
- func (srv *Server) ListCloudServiceConfigurations(_ context.Context, req *configuration.ListCloudServiceConfigurationsRequest) (res *configuration.ListCloudServiceConfigurationsResponse, err error)
- func (s *Server) ListCloudServices(ctx context.Context, req *orchestrator.ListCloudServicesRequest) (*orchestrator.ListCloudServicesResponse, error)
- func (srv *Server) ListCollectionModules(_ context.Context, _ *configuration.ListCollectionModulesRequest) (res *configuration.ListCollectionModulesResponse, err error)
- func (s *Server) ListControls(ctx context.Context, req *orchestrator.ListRequirementsRequest) (*orchestrator.ListRequirementsResponse, error)
- func (s *Server) ListMetrics(ctx context.Context, req *orchestrator.ListMetricsRequest) (res *orchestrator.ListMetricsResponse, err error)
- func (s *Server) RegisterCloudService(ctx context.Context, req *orchestrator.RegisterCloudServiceRequest) (*orchestrator.CloudService, error)
- func (s *Server) RemoveCloudService(ctx context.Context, req *orchestrator.RemoveCloudServiceRequest) (*emptypb.Empty, error)
- func (srv *Server) RemoveCollectionModule(_ context.Context, req *configuration.RemoveCollectionModuleRequest) (res *emptypb.Empty, err error)
- func (srv *Server) SetAuthorizer(auth api.Authorizer)
- func (srv *Server) StartMonitoring(ctx context.Context, req *configuration.StartMonitoringRequest) (res *configuration.StartMonitoringResponse, err error)
- func (srv *Server) StopMonitoring(_ context.Context, req *configuration.StopMonitoringRequest) (res *configuration.StopMonitoringResponse, err error)
- func (s *Server) UpdateCloudService(ctx context.Context, req *orchestrator.UpdateCloudServiceRequest) (*orchestrator.CloudService, error)
Constants ¶
const ( // DefaultInterval sets the default interval in seconds for collecting evidences DefaultInterval = 5 * 60 DefaultMetricsFile = "metrics.json" )
Variables ¶
This section is empty.
Functions ¶
func WithEvalManagerAddress ¶
func WithEvalManagerAddress(url string) service.ServiceOption[Server]
WithEvalManagerAddress is a Server option setting the address for the evaluation manager
func WithInterval ¶
func WithInterval(interval int) service.ServiceOption[Server]
WithInterval is a Server option setting the interval in minutes for collecting evidences
func WithOAuth2Authorizer ¶ added in v0.2.0
func WithOAuth2Authorizer(config *clientcredentials.Config) service.ServiceOption[Server]
WithOAuth2Authorizer is an option to use an OAuth 2.0 authorizer
func WithStorage ¶
func WithStorage(storage persistence.Storage) service.ServiceOption[Server]
WithStorage is an option to set the storage. If not set, NewServer will use inmemory storage.
Types ¶
type MonitorScheduler ¶
type MonitorScheduler struct {
// contains filtered or unexported fields
}
type Server ¶ added in v0.2.0
type Server struct { configuration.UnimplementedConfigurationServer // piggyback a Clouditor Orchestrator to take care of metrics and cloud services orchestrator.OrchestratorServer // contains filtered or unexported fields }
Server is an implementation of the ConfigurationServer interface. Furthermore, it also implements a Clouditor Orchestrator, which is used to deal with non-Gaia-X specific functionalities, such as managing the target cloud services, metrics and controls (requirements).
func NewServer ¶
func NewServer(opts ...service.ServiceOption[Server]) (srv *Server)
NewServer creates a new Server that implements the configuration interface.
func (*Server) AddCollectionModule ¶ added in v0.2.0
func (srv *Server) AddCollectionModule(_ context.Context, req *configuration.AddCollectionModuleRequest) ( res *collection.CollectionModule, err error)
AddCollectionModule adds a collection module to the server
func (*Server) Authorizer ¶ added in v0.2.0
func (srv *Server) Authorizer() api.Authorizer
Authorizer implements UsesAuthorizer
func (*Server) ConfigureCloudService ¶ added in v0.2.0
func (s *Server) ConfigureCloudService(_ context.Context, req *configuration.ConfigureCloudServiceRequest) (res *configuration.ConfigureCloudServiceResponse, err error)
ConfigureCloudService configures the cloud service with the corresponding service configuration
func (*Server) FindCollectionModule ¶ added in v0.2.0
func (srv *Server) FindCollectionModule(_ context.Context, req *configuration.FindCollectionModuleRequest) ( res *collection.CollectionModule, err error)
FindCollectionModule returns the collection module with the metric ID specified in the request
func (*Server) GetCloudService ¶ added in v0.2.0
func (s *Server) GetCloudService(ctx context.Context, req *orchestrator.GetCloudServiceRequest) (*orchestrator.CloudService, error)
GetCloudService is a wrapper around Clouditor orchestrator
func (*Server) GetMetric ¶ added in v0.2.0
func (s *Server) GetMetric(ctx context.Context, req *orchestrator.GetMetricRequest) (res *assessment.Metric, err error)
GetMetric is a wrapper around Clouditor orchestrator
func (*Server) GetMonitoringStatus ¶ added in v0.2.0
func (srv *Server) GetMonitoringStatus(_ context.Context, req *configuration.GetMonitoringStatusRequest) ( res *configuration.MonitoringStatus, err error)
GetMonitoringStatus returns the set of controls which are currently monitored for service with specified ID. If service is not set up already, returns `Not Found` error. If it is set up but monitoring is currently stopped, return empty list of controls
func (*Server) GetServiceConfiguration ¶ added in v0.2.0
func (srv *Server) GetServiceConfiguration(serviceID string, cm *collection.CollectionModule) ( serviceConfig *collection.ServiceConfiguration)
GetServiceConfiguration return the service configuration for the corresponding serviceID. If there is no config, return empty config (no error)
func (*Server) ListCloudServiceConfigurations ¶ added in v0.2.0
func (srv *Server) ListCloudServiceConfigurations(_ context.Context, req *configuration.ListCloudServiceConfigurationsRequest) ( res *configuration.ListCloudServiceConfigurationsResponse, err error)
ListCloudServiceConfigurations list all configurations for a service
func (*Server) ListCloudServices ¶ added in v0.2.0
func (s *Server) ListCloudServices(ctx context.Context, req *orchestrator.ListCloudServicesRequest) (*orchestrator.ListCloudServicesResponse, error)
ListCloudServices is a wrapper around Clouditor orchestrator
func (*Server) ListCollectionModules ¶ added in v0.2.0
func (srv *Server) ListCollectionModules(_ context.Context, _ *configuration.ListCollectionModulesRequest) ( res *configuration.ListCollectionModulesResponse, err error)
ListCollectionModules returns all collection modules
func (*Server) ListControls ¶ added in v0.2.0
func (s *Server) ListControls(ctx context.Context, req *orchestrator.ListRequirementsRequest) (*orchestrator.ListRequirementsResponse, error)
ListControls is a wrapper around Clouditor orchestrator
func (*Server) ListMetrics ¶ added in v0.2.0
func (s *Server) ListMetrics(ctx context.Context, req *orchestrator.ListMetricsRequest) (res *orchestrator.ListMetricsResponse, err error)
ListMetrics is a wrapper around Clouditor orchestrator
func (*Server) RegisterCloudService ¶ added in v0.2.0
func (s *Server) RegisterCloudService(ctx context.Context, req *orchestrator.RegisterCloudServiceRequest) (*orchestrator.CloudService, error)
RegisterCloudService is a wrapper around Clouditor orchestrator
func (*Server) RemoveCloudService ¶ added in v0.2.0
func (s *Server) RemoveCloudService(ctx context.Context, req *orchestrator.RemoveCloudServiceRequest) (*emptypb.Empty, error)
RemoveCloudService is a wrapper around Clouditor orchestrator
func (*Server) RemoveCollectionModule ¶ added in v0.2.0
func (srv *Server) RemoveCollectionModule(_ context.Context, req *configuration.RemoveCollectionModuleRequest) ( res *emptypb.Empty, err error)
RemoveCollectionModule removes the collection module with the ID specified in the request
func (*Server) SetAuthorizer ¶ added in v0.2.0
func (srv *Server) SetAuthorizer(auth api.Authorizer)
SetAuthorizer implements UsesAuthorizer
func (*Server) StartMonitoring ¶ added in v0.2.0
func (srv *Server) StartMonitoring(ctx context.Context, req *configuration.StartMonitoringRequest) ( res *configuration.StartMonitoringResponse, err error)
StartMonitoring enables the monitoring of the specified control IDs for the given service.
func (*Server) StopMonitoring ¶ added in v0.2.0
func (srv *Server) StopMonitoring(_ context.Context, req *configuration.StopMonitoringRequest) ( res *configuration.StopMonitoringResponse, err error)
StopMonitoring stops monitoring of the service with specified service ID. Returns error (not found), when there is no monitoring currently.
func (*Server) UpdateCloudService ¶ added in v0.2.0
func (s *Server) UpdateCloudService(ctx context.Context, req *orchestrator.UpdateCloudServiceRequest) (*orchestrator.CloudService, error)
UpdateCloudService is a wrapper around Clouditor orchestrator