assessment

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Metric_Scale_name = map[int32]string{
		0: "NOMIMAL",
		1: "ORDINAL",
		2: "METRIC",
	}
	Metric_Scale_value = map[string]int32{
		"NOMIMAL": 0,
		"ORDINAL": 1,
		"METRIC":  2,
	}
)

Enum value maps for Metric_Scale.

View Source
var Assessment_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "clouditor.Assessment",
	HandlerType: (*AssessmentServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "TriggerAssessment",
			Handler:    _Assessment_TriggerAssessment_Handler,
		},
		{
			MethodName: "StoreEvidence",
			Handler:    _Assessment_StoreEvidence_Handler,
		},
		{
			MethodName: "ListAssessmentResults",
			Handler:    _Assessment_ListAssessmentResults_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "StreamEvidences",
			Handler:       _Assessment_StreamEvidences_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "assessment.proto",
}

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

View Source
var File_assessment_proto protoreflect.FileDescriptor
View Source
var File_evidence_proto protoreflect.FileDescriptor

Functions

func RegisterAssessmentServer

func RegisterAssessmentServer(s grpc.ServiceRegistrar, srv AssessmentServer)

Types

type AllowedValues

type AllowedValues struct {
	Values []*structpb.Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

Defines a range

func (*AllowedValues) Descriptor deprecated

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

Deprecated: Use AllowedValues.ProtoReflect.Descriptor instead.

func (*AllowedValues) GetValues

func (x *AllowedValues) GetValues() []*structpb.Value

func (*AllowedValues) ProtoMessage

func (*AllowedValues) ProtoMessage()

func (*AllowedValues) ProtoReflect

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

func (*AllowedValues) Reset

func (x *AllowedValues) Reset()

func (*AllowedValues) String

func (x *AllowedValues) String() string

type AssessmentClient

type AssessmentClient interface {
	// Triggers the assement. Part of the private API, not exposed as REST.
	TriggerAssessment(ctx context.Context, in *TriggerAssessmentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Stores the evidences coming from the discovery. Part of the public API,
	// also exposed as REST
	StoreEvidence(ctx context.Context, in *StoreEvidenceRequest, opts ...grpc.CallOption) (*Evidence, error)
	ListAssessmentResults(ctx context.Context, in *ListAssessmentResultsRequest, opts ...grpc.CallOption) (*ListAssessmentResultsResponse, error)
	StreamEvidences(ctx context.Context, opts ...grpc.CallOption) (Assessment_StreamEvidencesClient, error)
}

AssessmentClient is the client API for Assessment 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.

func NewAssessmentClient

func NewAssessmentClient(cc grpc.ClientConnInterface) AssessmentClient

type AssessmentServer

type AssessmentServer interface {
	// Triggers the assement. Part of the private API, not exposed as REST.
	TriggerAssessment(context.Context, *TriggerAssessmentRequest) (*emptypb.Empty, error)
	// Stores the evidences coming from the discovery. Part of the public API,
	// also exposed as REST
	StoreEvidence(context.Context, *StoreEvidenceRequest) (*Evidence, error)
	ListAssessmentResults(context.Context, *ListAssessmentResultsRequest) (*ListAssessmentResultsResponse, error)
	StreamEvidences(Assessment_StreamEvidencesServer) error
	// contains filtered or unexported methods
}

AssessmentServer is the server API for Assessment service. All implementations must embed UnimplementedAssessmentServer for forward compatibility

type Assessment_StreamEvidencesClient

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

type Assessment_StreamEvidencesServer

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

type Evidence

type Evidence struct {

	// the ID in a uuid format
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// reference to a service this evidence was gathered from
	ServiceId string `protobuf:"bytes,2,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	// reference to the resource this evidence was gathered from
	ResourceId string `protobuf:"bytes,3,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"`
	// TODO: replace with google/type/date.proto
	Timestamp         string  `protobuf:"bytes,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	ApplicableMetrics []int32 `protobuf:"varint,5,rep,packed,name=applicable_metrics,json=applicableMetrics,proto3" json:"applicable_metrics,omitempty"`
	// "raw" evidence (for the auditor), for example the raw JSON response from
	// the API. This does not follow a defined schema
	Raw string `protobuf:"bytes,6,opt,name=raw,proto3" json:"raw,omitempty"`
	// optional; a semantic representation of the Cloud resource according to our
	// defined ontology. a JSON seralized node of our semantic graph. This may be
	// Clouditor-specific.
	Resource *structpb.Value `protobuf:"bytes,7,opt,name=resource,proto3" json:"resource,omitempty"`
	// contains filtered or unexported fields
}

func (*Evidence) Descriptor deprecated

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

Deprecated: Use Evidence.ProtoReflect.Descriptor instead.

func (*Evidence) GetApplicableMetrics

func (x *Evidence) GetApplicableMetrics() []int32

func (*Evidence) GetId

func (x *Evidence) GetId() string

func (*Evidence) GetRaw

func (x *Evidence) GetRaw() string

func (*Evidence) GetResource

func (x *Evidence) GetResource() *structpb.Value

func (*Evidence) GetResourceId

func (x *Evidence) GetResourceId() string

func (*Evidence) GetServiceId

func (x *Evidence) GetServiceId() string

func (*Evidence) GetTimestamp

func (x *Evidence) GetTimestamp() string

func (*Evidence) ProtoMessage

func (*Evidence) ProtoMessage()

func (*Evidence) ProtoReflect

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

func (*Evidence) Reset

func (x *Evidence) Reset()

func (*Evidence) String

func (x *Evidence) String() string

type ListAssessmentResultsRequest added in v1.3.5

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

func (*ListAssessmentResultsRequest) Descriptor deprecated added in v1.3.5

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

Deprecated: Use ListAssessmentResultsRequest.ProtoReflect.Descriptor instead.

func (*ListAssessmentResultsRequest) ProtoMessage added in v1.3.5

func (*ListAssessmentResultsRequest) ProtoMessage()

func (*ListAssessmentResultsRequest) ProtoReflect added in v1.3.5

func (*ListAssessmentResultsRequest) Reset added in v1.3.5

func (x *ListAssessmentResultsRequest) Reset()

func (*ListAssessmentResultsRequest) String added in v1.3.5

type ListAssessmentResultsResponse added in v1.3.5

type ListAssessmentResultsResponse struct {
	Results []*Result `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
	// contains filtered or unexported fields
}

func (*ListAssessmentResultsResponse) Descriptor deprecated added in v1.3.5

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

Deprecated: Use ListAssessmentResultsResponse.ProtoReflect.Descriptor instead.

func (*ListAssessmentResultsResponse) GetResults added in v1.3.5

func (x *ListAssessmentResultsResponse) GetResults() []*Result

func (*ListAssessmentResultsResponse) ProtoMessage added in v1.3.5

func (*ListAssessmentResultsResponse) ProtoMessage()

func (*ListAssessmentResultsResponse) ProtoReflect added in v1.3.5

func (*ListAssessmentResultsResponse) Reset added in v1.3.5

func (x *ListAssessmentResultsResponse) Reset()

func (*ListAssessmentResultsResponse) String added in v1.3.5

type Metric

type Metric struct {
	Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// a human readable name of the metric
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// a description of the metric
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// reference to control catalog category or domain
	Category string `protobuf:"bytes,4,opt,name=category,proto3" json:"category,omitempty"`
	// the scale of this metric, e.g. categories, ranked data or metric values
	Scale Metric_Scale `protobuf:"varint,5,opt,name=scale,proto3,enum=clouditor.Metric_Scale" json:"scale,omitempty"`
	// the range of this metric, depends on the scale
	Range *Range `protobuf:"bytes,6,opt,name=range,proto3" json:"range,omitempty"`
	// contains filtered or unexported fields
}

func (*Metric) Descriptor deprecated

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

Deprecated: Use Metric.ProtoReflect.Descriptor instead.

func (*Metric) GetCategory

func (x *Metric) GetCategory() string

func (*Metric) GetDescription

func (x *Metric) GetDescription() string

func (*Metric) GetId

func (x *Metric) GetId() int32

func (*Metric) GetName

func (x *Metric) GetName() string

func (*Metric) GetRange

func (x *Metric) GetRange() *Range

func (*Metric) GetScale

func (x *Metric) GetScale() Metric_Scale

func (*Metric) ProtoMessage

func (*Metric) ProtoMessage()

func (*Metric) ProtoReflect

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

func (*Metric) Reset

func (x *Metric) Reset()

func (*Metric) String

func (x *Metric) String() string

type Metric_Scale

type Metric_Scale int32
const (
	Metric_NOMIMAL Metric_Scale = 0
	Metric_ORDINAL Metric_Scale = 1
	Metric_METRIC  Metric_Scale = 2
)

func (Metric_Scale) Descriptor

func (Metric_Scale) Enum

func (x Metric_Scale) Enum() *Metric_Scale

func (Metric_Scale) EnumDescriptor deprecated

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

Deprecated: Use Metric_Scale.Descriptor instead.

func (Metric_Scale) Number

func (Metric_Scale) String

func (x Metric_Scale) String() string

func (Metric_Scale) Type

type MinMax

type MinMax struct {
	Min int64 `protobuf:"varint,1,opt,name=min,proto3" json:"min,omitempty"`
	Max int64 `protobuf:"varint,2,opt,name=max,proto3" json:"max,omitempty"`
	// contains filtered or unexported fields
}

Defines a range of values through a (inclusive) minimum and a maximum

func (*MinMax) Descriptor deprecated

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

Deprecated: Use MinMax.ProtoReflect.Descriptor instead.

func (*MinMax) GetMax

func (x *MinMax) GetMax() int64

func (*MinMax) GetMin

func (x *MinMax) GetMin() int64

func (*MinMax) ProtoMessage

func (*MinMax) ProtoMessage()

func (*MinMax) ProtoReflect

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

func (*MinMax) Reset

func (x *MinMax) Reset()

func (*MinMax) String

func (x *MinMax) String() string

type Order

type Order struct {
	Values []*structpb.Value `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

Defines a range of values in a pre-defined order from the lowest to the highest.

func (*Order) Descriptor deprecated

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

Deprecated: Use Order.ProtoReflect.Descriptor instead.

func (*Order) GetValues

func (x *Order) GetValues() []*structpb.Value

func (*Order) ProtoMessage

func (*Order) ProtoMessage()

func (*Order) ProtoReflect

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

func (*Order) Reset

func (x *Order) Reset()

func (*Order) String

func (x *Order) String() string

type Range

type Range struct {

	// Types that are assignable to Range:
	//	*Range_AllowedValues
	//	*Range_Order
	//	*Range_MinMax
	Range isRange_Range `protobuf_oneof:"range"`
	// contains filtered or unexported fields
}

Defines a range of values

func (*Range) Descriptor deprecated

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

Deprecated: Use Range.ProtoReflect.Descriptor instead.

func (*Range) GetAllowedValues

func (x *Range) GetAllowedValues() *AllowedValues

func (*Range) GetMinMax

func (x *Range) GetMinMax() *MinMax

func (*Range) GetOrder

func (x *Range) GetOrder() *Order

func (*Range) GetRange

func (m *Range) GetRange() isRange_Range

func (*Range) ProtoMessage

func (*Range) ProtoMessage()

func (*Range) ProtoReflect

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

func (*Range) Reset

func (x *Range) Reset()

func (*Range) String

func (x *Range) String() string

func (*Range) UnmarshalJSON added in v1.3.5

func (r *Range) UnmarshalJSON(b []byte) (err error)

type Range_AllowedValues

type Range_AllowedValues struct {
	// used for nomical scale
	AllowedValues *AllowedValues `protobuf:"bytes,1,opt,name=allowed_values,json=allowedValues,proto3,oneof"`
}

type Range_MinMax

type Range_MinMax struct {
	// used for metric scale
	MinMax *MinMax `protobuf:"bytes,3,opt,name=min_max,json=minMax,proto3,oneof"`
}

type Range_Order

type Range_Order struct {
	// used for ordinal scale
	Order *Order `protobuf:"bytes,2,opt,name=order,proto3,oneof"`
}

type Result added in v1.3.4

type Result struct {
	ResourceId string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"`
	Compliant  bool   `protobuf:"varint,2,opt,name=compliant,proto3" json:"compliant,omitempty"`
	MetricId   int32  `protobuf:"varint,3,opt,name=metric_id,json=metricId,proto3" json:"metric_id,omitempty"`
	// contains filtered or unexported fields
}

func (*Result) Descriptor deprecated added in v1.3.4

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

Deprecated: Use Result.ProtoReflect.Descriptor instead.

func (*Result) GetCompliant added in v1.3.4

func (x *Result) GetCompliant() bool

func (*Result) GetMetricId added in v1.3.5

func (x *Result) GetMetricId() int32

func (*Result) GetResourceId added in v1.3.4

func (x *Result) GetResourceId() string

func (*Result) ProtoMessage added in v1.3.4

func (*Result) ProtoMessage()

func (*Result) ProtoReflect added in v1.3.4

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

func (*Result) Reset added in v1.3.4

func (x *Result) Reset()

func (*Result) String added in v1.3.4

func (x *Result) String() string

type StoreEvidenceRequest

type StoreEvidenceRequest struct {
	Evidence *Evidence `protobuf:"bytes,1,opt,name=evidence,proto3" json:"evidence,omitempty"`
	// contains filtered or unexported fields
}

func (*StoreEvidenceRequest) Descriptor deprecated

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

Deprecated: Use StoreEvidenceRequest.ProtoReflect.Descriptor instead.

func (*StoreEvidenceRequest) GetEvidence

func (x *StoreEvidenceRequest) GetEvidence() *Evidence

func (*StoreEvidenceRequest) ProtoMessage

func (*StoreEvidenceRequest) ProtoMessage()

func (*StoreEvidenceRequest) ProtoReflect

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

func (*StoreEvidenceRequest) Reset

func (x *StoreEvidenceRequest) Reset()

func (*StoreEvidenceRequest) String

func (x *StoreEvidenceRequest) String() string

type TriggerAssessmentRequest

type TriggerAssessmentRequest struct {
	SomeOption string `protobuf:"bytes,1,opt,name=someOption,proto3" json:"someOption,omitempty"`
	// contains filtered or unexported fields
}

func (*TriggerAssessmentRequest) Descriptor deprecated

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

Deprecated: Use TriggerAssessmentRequest.ProtoReflect.Descriptor instead.

func (*TriggerAssessmentRequest) GetSomeOption

func (x *TriggerAssessmentRequest) GetSomeOption() string

func (*TriggerAssessmentRequest) ProtoMessage

func (*TriggerAssessmentRequest) ProtoMessage()

func (*TriggerAssessmentRequest) ProtoReflect

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

func (*TriggerAssessmentRequest) Reset

func (x *TriggerAssessmentRequest) Reset()

func (*TriggerAssessmentRequest) String

func (x *TriggerAssessmentRequest) String() string

type UnimplementedAssessmentServer

type UnimplementedAssessmentServer struct {
}

UnimplementedAssessmentServer must be embedded to have forward compatible implementations.

func (UnimplementedAssessmentServer) ListAssessmentResults added in v1.3.5

func (UnimplementedAssessmentServer) StoreEvidence

func (UnimplementedAssessmentServer) StreamEvidences

func (UnimplementedAssessmentServer) TriggerAssessment

type UnsafeAssessmentServer

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

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

Jump to

Keyboard shortcuts

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