configuration

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
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

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

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

ListCloudServiceConfigurations list all configurations for a service

func (*Server) ListCloudServices added in v0.2.0

ListCloudServices is a wrapper around Clouditor orchestrator

func (*Server) ListCollectionModules added in v0.2.0

ListCollectionModules returns all collection modules

func (*Server) ListControls added in v0.2.0

ListControls is a wrapper around Clouditor orchestrator

func (*Server) ListMetrics added in v0.2.0

ListMetrics is a wrapper around Clouditor orchestrator

func (*Server) RegisterCloudService added in v0.2.0

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

StartMonitoring enables the monitoring of the specified control IDs for the given service.

func (*Server) StopMonitoring added in v0.2.0

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

UpdateCloudService is a wrapper around Clouditor orchestrator

Jump to

Keyboard shortcuts

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