v1beta1

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 10 Imported by: 35

Documentation

Index

Constants

View Source
const (
	FunctionRunnerService_RunFunction_FullMethodName = "/apiextensions.fn.proto.v1beta1.FunctionRunnerService/RunFunction"
)

Variables

View Source
var (
	Ready_name = map[int32]string{
		0: "READY_UNSPECIFIED",
		1: "READY_TRUE",
		2: "READY_FALSE",
	}
	Ready_value = map[string]int32{
		"READY_UNSPECIFIED": 0,
		"READY_TRUE":        1,
		"READY_FALSE":       2,
	}
)

Enum value maps for Ready.

View Source
var (
	Severity_name = map[int32]string{
		0: "SEVERITY_UNSPECIFIED",
		1: "SEVERITY_FATAL",
		2: "SEVERITY_WARNING",
		3: "SEVERITY_NORMAL",
	}
	Severity_value = map[string]int32{
		"SEVERITY_UNSPECIFIED": 0,
		"SEVERITY_FATAL":       1,
		"SEVERITY_WARNING":     2,
		"SEVERITY_NORMAL":      3,
	}
)

Enum value maps for Severity.

View Source
var File_v1beta1_run_function_proto protoreflect.FileDescriptor
View Source
var FunctionRunnerService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "apiextensions.fn.proto.v1beta1.FunctionRunnerService",
	HandlerType: (*FunctionRunnerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RunFunction",
			Handler:    _FunctionRunnerService_RunFunction_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "v1beta1/run_function.proto",
}

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

Functions

func RegisterFunctionRunnerServiceServer

func RegisterFunctionRunnerServiceServer(s grpc.ServiceRegistrar, srv FunctionRunnerServiceServer)

Types

type FunctionRunnerServiceClient

type FunctionRunnerServiceClient interface {
	// RunFunction runs the Composition Function.
	RunFunction(ctx context.Context, in *RunFunctionRequest, opts ...grpc.CallOption) (*RunFunctionResponse, error)
}

FunctionRunnerServiceClient is the client API for FunctionRunnerService 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 FunctionRunnerServiceServer

type FunctionRunnerServiceServer interface {
	// RunFunction runs the Composition Function.
	RunFunction(context.Context, *RunFunctionRequest) (*RunFunctionResponse, error)
	// contains filtered or unexported methods
}

FunctionRunnerServiceServer is the server API for FunctionRunnerService service. All implementations must embed UnimplementedFunctionRunnerServiceServer for forward compatibility

type MatchLabels added in v0.2.0

type MatchLabels struct {
	Labels map[string]string `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

MatchLabels defines a set of labels to match resources against.

func (*MatchLabels) Descriptor deprecated added in v0.2.0

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

Deprecated: Use MatchLabels.ProtoReflect.Descriptor instead.

func (*MatchLabels) GetLabels added in v0.2.0

func (x *MatchLabels) GetLabels() map[string]string

func (*MatchLabels) ProtoMessage added in v0.2.0

func (*MatchLabels) ProtoMessage()

func (*MatchLabels) ProtoReflect added in v0.2.0

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

func (*MatchLabels) Reset added in v0.2.0

func (x *MatchLabels) Reset()

func (*MatchLabels) String added in v0.2.0

func (x *MatchLabels) String() string

type Ready

type Ready int32

Ready indicates whether a composed resource should be considered ready.

const (
	Ready_READY_UNSPECIFIED Ready = 0
	// True means the composed resource has been observed to be ready.
	Ready_READY_TRUE Ready = 1
	// False means the composed resource has not been observed to be ready.
	Ready_READY_FALSE Ready = 2
)

func (Ready) Descriptor

func (Ready) Descriptor() protoreflect.EnumDescriptor

func (Ready) Enum

func (x Ready) Enum() *Ready

func (Ready) EnumDescriptor deprecated

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

Deprecated: Use Ready.Descriptor instead.

func (Ready) Number

func (x Ready) Number() protoreflect.EnumNumber

func (Ready) String

func (x Ready) String() string

func (Ready) Type

func (Ready) Type() protoreflect.EnumType

type RequestMeta

type RequestMeta struct {

	// An opaque string identifying the content of the request. Two identical
	// requests should have the same tag.
	Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
	// contains filtered or unexported fields
}

RequestMeta contains metadata pertaining to a RunFunctionRequest.

func (*RequestMeta) Descriptor deprecated

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

Deprecated: Use RequestMeta.ProtoReflect.Descriptor instead.

func (*RequestMeta) GetTag

func (x *RequestMeta) GetTag() string

func (*RequestMeta) ProtoMessage

func (*RequestMeta) ProtoMessage()

func (*RequestMeta) ProtoReflect

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

func (*RequestMeta) Reset

func (x *RequestMeta) Reset()

func (*RequestMeta) String

func (x *RequestMeta) String() string

type Requirements added in v0.2.0

type Requirements struct {

	// Extra resources that this Function requires.
	// The map key uniquely identifies the group of resources.
	ExtraResources map[string]*ResourceSelector `` /* 191-byte string literal not displayed */
	// contains filtered or unexported fields
}

Requirements that must be satisfied for a Function to run successfully.

func (*Requirements) Descriptor deprecated added in v0.2.0

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

Deprecated: Use Requirements.ProtoReflect.Descriptor instead.

func (*Requirements) GetExtraResources added in v0.2.0

func (x *Requirements) GetExtraResources() map[string]*ResourceSelector

func (*Requirements) ProtoMessage added in v0.2.0

func (*Requirements) ProtoMessage()

func (*Requirements) ProtoReflect added in v0.2.0

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

func (*Requirements) Reset added in v0.2.0

func (x *Requirements) Reset()

func (*Requirements) String added in v0.2.0

func (x *Requirements) String() string

type Resource

type Resource struct {

	// The JSON representation of the resource.
	//
	//   - Crossplane will set this field in a RunFunctionRequest to the entire
	//     observed state of a resource - including its metadata, spec, and status.
	//
	//   - A Function should set this field in a RunFunctionRequest to communicate
	//     the desired state of a composite or composed resource.
	//
	//   - A Function may only specify the desired status of a composite resource -
	//     not its metadata or spec. A Function should not return desired metadata
	//     or spec for a composite resource. This will be ignored.
	//
	//   - A Function may not specify the desired status of a composed resource -
	//     only its metadata and spec. A Function should not return desired status
	//     for a composed resource. This will be ignored.
	Resource *structpb.Struct `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"`
	// The resource's connection details.
	//
	//   - Crossplane will set this field in a RunFunctionRequest to communicate the
	//     the observed connection details of a composite or composed resource.
	//
	//   - A Function should set this field in a RunFunctionResponse to indicate the
	//     desired connection details of the composite resource.
	//
	//   - A Function should not set this field in a RunFunctionResponse to indicate
	//     the desired connection details of a composed resource. This will be
	//     ignored.
	ConnectionDetails map[string][]byte `` /* 200-byte string literal not displayed */
	// Ready indicates whether the resource should be considered ready.
	//
	// * Crossplane will never set this field in a RunFunctionRequest.
	//
	//   - A Function should set this field to READY_TRUE in a RunFunctionResponse
	//     to indicate that a desired composed resource is ready.
	//
	//   - A Function should not set this field in a RunFunctionResponse to indicate
	//     that the desired composite resource is ready. This will be ignored.
	Ready Ready `protobuf:"varint,3,opt,name=ready,proto3,enum=apiextensions.fn.proto.v1beta1.Ready" json:"ready,omitempty"`
	// contains filtered or unexported fields
}

A Resource represents the state of a composite or composed resource.

func (*Resource) Descriptor deprecated

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

Deprecated: Use Resource.ProtoReflect.Descriptor instead.

func (*Resource) GetConnectionDetails

func (x *Resource) GetConnectionDetails() map[string][]byte

func (*Resource) GetReady

func (x *Resource) GetReady() Ready

func (*Resource) GetResource

func (x *Resource) GetResource() *structpb.Struct

func (*Resource) ProtoMessage

func (*Resource) ProtoMessage()

func (*Resource) ProtoReflect

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

func (*Resource) Reset

func (x *Resource) Reset()

func (*Resource) String

func (x *Resource) String() string

type ResourceSelector added in v0.2.0

type ResourceSelector struct {
	ApiVersion string `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"`
	Kind       string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"`
	// Types that are assignable to Match:
	//
	//	*ResourceSelector_MatchName
	//	*ResourceSelector_MatchLabels
	Match isResourceSelector_Match `protobuf_oneof:"match"`
	// contains filtered or unexported fields
}

ResourceSelector selects a group of resources, either by name or by label.

func (*ResourceSelector) Descriptor deprecated added in v0.2.0

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

Deprecated: Use ResourceSelector.ProtoReflect.Descriptor instead.

func (*ResourceSelector) GetApiVersion added in v0.2.0

func (x *ResourceSelector) GetApiVersion() string

func (*ResourceSelector) GetKind added in v0.2.0

func (x *ResourceSelector) GetKind() string

func (*ResourceSelector) GetMatch added in v0.2.0

func (m *ResourceSelector) GetMatch() isResourceSelector_Match

func (*ResourceSelector) GetMatchLabels added in v0.2.0

func (x *ResourceSelector) GetMatchLabels() *MatchLabels

func (*ResourceSelector) GetMatchName added in v0.2.0

func (x *ResourceSelector) GetMatchName() string

func (*ResourceSelector) ProtoMessage added in v0.2.0

func (*ResourceSelector) ProtoMessage()

func (*ResourceSelector) ProtoReflect added in v0.2.0

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

func (*ResourceSelector) Reset added in v0.2.0

func (x *ResourceSelector) Reset()

func (*ResourceSelector) String added in v0.2.0

func (x *ResourceSelector) String() string

type ResourceSelector_MatchLabels added in v0.2.0

type ResourceSelector_MatchLabels struct {
	MatchLabels *MatchLabels `protobuf:"bytes,4,opt,name=match_labels,json=matchLabels,proto3,oneof"`
}

type ResourceSelector_MatchName added in v0.2.0

type ResourceSelector_MatchName struct {
	MatchName string `protobuf:"bytes,3,opt,name=match_name,json=matchName,proto3,oneof"`
}

type Resources added in v0.2.0

type Resources struct {
	Items []*Resource `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

Resources represents the state of several Crossplane resources.

func (*Resources) Descriptor deprecated added in v0.2.0

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

Deprecated: Use Resources.ProtoReflect.Descriptor instead.

func (*Resources) GetItems added in v0.2.0

func (x *Resources) GetItems() []*Resource

func (*Resources) ProtoMessage added in v0.2.0

func (*Resources) ProtoMessage()

func (*Resources) ProtoReflect added in v0.2.0

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

func (*Resources) Reset added in v0.2.0

func (x *Resources) Reset()

func (*Resources) String added in v0.2.0

func (x *Resources) String() string

type ResponseMeta

type ResponseMeta struct {

	// An opaque string identifying the content of the request. Must match the
	// meta.tag of the corresponding RunFunctionRequest.
	Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
	// Time-to-live of this response. Deterministic Functions with no side-effects
	// (e.g. simple templating Functions) may specify a TTL. Crossplane may choose
	// to cache responses until the TTL expires.
	Ttl *durationpb.Duration `protobuf:"bytes,2,opt,name=ttl,proto3,oneof" json:"ttl,omitempty"`
	// contains filtered or unexported fields
}

ResponseMeta contains metadata pertaining to a RunFunctionResponse.

func (*ResponseMeta) Descriptor deprecated

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

Deprecated: Use ResponseMeta.ProtoReflect.Descriptor instead.

func (*ResponseMeta) GetTag

func (x *ResponseMeta) GetTag() string

func (*ResponseMeta) GetTtl

func (x *ResponseMeta) GetTtl() *durationpb.Duration

func (*ResponseMeta) ProtoMessage

func (*ResponseMeta) ProtoMessage()

func (*ResponseMeta) ProtoReflect

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

func (*ResponseMeta) Reset

func (x *ResponseMeta) Reset()

func (*ResponseMeta) String

func (x *ResponseMeta) String() string

type Result

type Result struct {

	// Severity of this result.
	Severity Severity `protobuf:"varint,1,opt,name=severity,proto3,enum=apiextensions.fn.proto.v1beta1.Severity" json:"severity,omitempty"`
	// Human-readable details about the result.
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

A Result of running a Function.

func (*Result) Descriptor deprecated

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

Deprecated: Use Result.ProtoReflect.Descriptor instead.

func (*Result) GetMessage

func (x *Result) GetMessage() string

func (*Result) GetSeverity

func (x *Result) GetSeverity() Severity

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) ProtoReflect

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

func (*Result) Reset

func (x *Result) Reset()

func (*Result) String

func (x *Result) String() string

type RunFunctionRequest

type RunFunctionRequest struct {

	// Metadata pertaining to this request.
	Meta *RequestMeta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"`
	// The observed state prior to invocation of a Function pipeline. State passed
	// to each Function is fresh as of the time the pipeline was invoked, not as
	// of the time each Function was invoked.
	Observed *State `protobuf:"bytes,2,opt,name=observed,proto3" json:"observed,omitempty"`
	// Desired state according to a Function pipeline. The state passed to a
	// particular Function may have been accumulated by previous Functions in the
	// pipeline.
	//
	// Note that the desired state must be a partial object with only the fields
	// that this function (and its predecessors in the pipeline) wants to have
	// set in the object. Copying a non-partial observed state to desired is most
	// likely not what you want to do. Leaving out fields that had been returned
	// as desired before will result in them being deleted from the objects in the
	// cluster.
	Desired *State `protobuf:"bytes,3,opt,name=desired,proto3" json:"desired,omitempty"`
	// Optional input specific to this Function invocation. A JSON representation
	// of the 'input' block of the relevant entry in a Composition's pipeline.
	Input *structpb.Struct `protobuf:"bytes,4,opt,name=input,proto3,oneof" json:"input,omitempty"`
	// Optional context. Crossplane may pass arbitary contextual information to a
	// Function. A Function may also return context in its RunFunctionResponse,
	// and that context will be passed to subsequent Functions. Crossplane
	// discards all context returned by the last Function in the pipeline.
	Context *structpb.Struct `protobuf:"bytes,5,opt,name=context,proto3,oneof" json:"context,omitempty"`
	// Optional extra resources that the Function required.
	// Note that extra resources is a map to Resources, plural.
	// The map key corresponds to the key in a RunFunctionResponse's
	// extra_resources field. If a Function requested extra resources that
	// did not exist, Crossplane sets the map key to an empty Resources message to
	// indicate that it attempted to satisfy the request.
	ExtraResources map[string]*Resources `` /* 191-byte string literal not displayed */
	// contains filtered or unexported fields
}

A RunFunctionRequest requests that the Composition Function be run.

func (*RunFunctionRequest) Descriptor deprecated

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

Deprecated: Use RunFunctionRequest.ProtoReflect.Descriptor instead.

func (*RunFunctionRequest) GetContext

func (x *RunFunctionRequest) GetContext() *structpb.Struct

func (*RunFunctionRequest) GetDesired

func (x *RunFunctionRequest) GetDesired() *State

func (*RunFunctionRequest) GetExtraResources added in v0.2.0

func (x *RunFunctionRequest) GetExtraResources() map[string]*Resources

func (*RunFunctionRequest) GetInput

func (x *RunFunctionRequest) GetInput() *structpb.Struct

func (*RunFunctionRequest) GetMeta

func (x *RunFunctionRequest) GetMeta() *RequestMeta

func (*RunFunctionRequest) GetObserved

func (x *RunFunctionRequest) GetObserved() *State

func (*RunFunctionRequest) ProtoMessage

func (*RunFunctionRequest) ProtoMessage()

func (*RunFunctionRequest) ProtoReflect

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

func (*RunFunctionRequest) Reset

func (x *RunFunctionRequest) Reset()

func (*RunFunctionRequest) String

func (x *RunFunctionRequest) String() string

type RunFunctionResponse

type RunFunctionResponse struct {

	// Metadata pertaining to this response.
	Meta *ResponseMeta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"`
	// Desired state according to a Function pipeline. Functions may add desired
	// state, and may mutate or delete any part of the desired state they are
	// concerned with. A Function must pass through any part of the desired state
	// that it is not concerned with.
	//
	// Note that the desired state must be a partial object with only the fields
	// that this function (and its predecessors in the pipeline) wants to have
	// set in the object. Copying a non-partial observed state to desired is most
	// likely not what you want to do. Leaving out fields that had been returned
	// as desired before will result in them being deleted from the objects in the
	// cluster.
	Desired *State `protobuf:"bytes,2,opt,name=desired,proto3" json:"desired,omitempty"`
	// Results of the Function run. Results are used for observability purposes.
	Results []*Result `protobuf:"bytes,3,rep,name=results,proto3" json:"results,omitempty"`
	// Optional context to be passed to the next Function in the pipeline as part
	// of the RunFunctionRequest. Dropped on the last function in the pipeline.
	Context *structpb.Struct `protobuf:"bytes,4,opt,name=context,proto3,oneof" json:"context,omitempty"`
	// Requirements that must be satisfied for this Function to run successfully.
	Requirements *Requirements `protobuf:"bytes,5,opt,name=requirements,proto3" json:"requirements,omitempty"`
	// contains filtered or unexported fields
}

A RunFunctionResponse contains the result of a Composition Function run.

func (*RunFunctionResponse) Descriptor deprecated

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

Deprecated: Use RunFunctionResponse.ProtoReflect.Descriptor instead.

func (*RunFunctionResponse) GetContext

func (x *RunFunctionResponse) GetContext() *structpb.Struct

func (*RunFunctionResponse) GetDesired

func (x *RunFunctionResponse) GetDesired() *State

func (*RunFunctionResponse) GetMeta

func (x *RunFunctionResponse) GetMeta() *ResponseMeta

func (*RunFunctionResponse) GetRequirements added in v0.2.0

func (x *RunFunctionResponse) GetRequirements() *Requirements

func (*RunFunctionResponse) GetResults

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

func (*RunFunctionResponse) ProtoMessage

func (*RunFunctionResponse) ProtoMessage()

func (*RunFunctionResponse) ProtoReflect

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

func (*RunFunctionResponse) Reset

func (x *RunFunctionResponse) Reset()

func (*RunFunctionResponse) String

func (x *RunFunctionResponse) String() string

type Severity

type Severity int32

Severity of Function results.

const (
	Severity_SEVERITY_UNSPECIFIED Severity = 0
	// Fatal results are fatal; subsequent Composition Functions may run, but
	// the Composition Function pipeline run will be considered a failure and
	// the first fatal result will be returned as an error.
	Severity_SEVERITY_FATAL Severity = 1
	// Warning results are non-fatal; the entire Composition will run to
	// completion but warning events and debug logs associated with the
	// composite resource will be emitted.
	Severity_SEVERITY_WARNING Severity = 2
	// Normal results are emitted as normal events and debug logs associated
	// with the composite resource.
	Severity_SEVERITY_NORMAL Severity = 3
)

func (Severity) Descriptor

func (Severity) Descriptor() protoreflect.EnumDescriptor

func (Severity) Enum

func (x Severity) Enum() *Severity

func (Severity) EnumDescriptor deprecated

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

Deprecated: Use Severity.Descriptor instead.

func (Severity) Number

func (x Severity) Number() protoreflect.EnumNumber

func (Severity) String

func (x Severity) String() string

func (Severity) Type

type State

type State struct {

	// The state of the composite resource (XR).
	Composite *Resource `protobuf:"bytes,1,opt,name=composite,proto3" json:"composite,omitempty"`
	// The state of any composed resources.
	Resources map[string]*Resource `` /* 159-byte string literal not displayed */
	// contains filtered or unexported fields
}

State of the composite resource (XR) and any composed resources.

func (*State) Descriptor deprecated

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

Deprecated: Use State.ProtoReflect.Descriptor instead.

func (*State) GetComposite

func (x *State) GetComposite() *Resource

func (*State) GetResources

func (x *State) GetResources() map[string]*Resource

func (*State) ProtoMessage

func (*State) ProtoMessage()

func (*State) ProtoReflect

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

func (*State) Reset

func (x *State) Reset()

func (*State) String

func (x *State) String() string

type UnimplementedFunctionRunnerServiceServer

type UnimplementedFunctionRunnerServiceServer struct {
}

UnimplementedFunctionRunnerServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedFunctionRunnerServiceServer) RunFunction

type UnsafeFunctionRunnerServiceServer

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

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

Jump to

Keyboard shortcuts

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