rpcpb

package
v0.0.0-...-d3da680 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package rpcpb contains LUCI Deploy pRPC APIs.

Index

Constants

View Source
const (
	Actuations_BeginActuation_FullMethodName = "/deploy.service.Actuations/BeginActuation"
	Actuations_EndActuation_FullMethodName   = "/deploy.service.Actuations/EndActuation"
)
View Source
const (
	Assets_GetAsset_FullMethodName         = "/deploy.service.Assets/GetAsset"
	Assets_ListAssets_FullMethodName       = "/deploy.service.Assets/ListAssets"
	Assets_ListAssetHistory_FullMethodName = "/deploy.service.Assets/ListAssetHistory"
)

Variables

View Source
var Actuations_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "deploy.service.Actuations",
	HandlerType: (*ActuationsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "BeginActuation",
			Handler:    _Actuations_BeginActuation_Handler,
		},
		{
			MethodName: "EndActuation",
			Handler:    _Actuations_EndActuation_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "go.chromium.org/luci/deploy/api/rpcpb/actuations.proto",
}

Actuations_ServiceDesc is the grpc.ServiceDesc for Actuations 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 Assets_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "deploy.service.Assets",
	HandlerType: (*AssetsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetAsset",
			Handler:    _Assets_GetAsset_Handler,
		},
		{
			MethodName: "ListAssets",
			Handler:    _Assets_ListAssets_Handler,
		},
		{
			MethodName: "ListAssetHistory",
			Handler:    _Assets_ListAssetHistory_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "go.chromium.org/luci/deploy/api/rpcpb/assets.proto",
}

Assets_ServiceDesc is the grpc.ServiceDesc for Assets 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_go_chromium_org_luci_deploy_api_rpcpb_actuations_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_luci_deploy_api_rpcpb_assets_proto protoreflect.FileDescriptor
View Source
var File_go_chromium_org_luci_deploy_api_rpcpb_deployments_proto protoreflect.FileDescriptor

Functions

func FileDescriptorSet

func FileDescriptorSet() *descriptorpb.FileDescriptorSet

FileDescriptorSet returns a descriptor set for this proto package, which includes all defined services, and all transitive dependencies.

Will not return nil.

Do NOT modify the returned descriptor.

func RegisterActuationsServer

func RegisterActuationsServer(s grpc.ServiceRegistrar, srv ActuationsServer)

func RegisterAssetsServer

func RegisterAssetsServer(s grpc.ServiceRegistrar, srv AssetsServer)

Types

type ActuatedAsset

type ActuatedAsset struct {

	// The actual state of the asset post actuation (as scanned by the actuator).
	State *modelpb.AssetState `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"`
	// contains filtered or unexported fields
}

The state of the actuated asset post-actuation.

func (*ActuatedAsset) Descriptor deprecated

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

Deprecated: Use ActuatedAsset.ProtoReflect.Descriptor instead.

func (*ActuatedAsset) GetState

func (x *ActuatedAsset) GetState() *modelpb.AssetState

func (*ActuatedAsset) ProtoMessage

func (*ActuatedAsset) ProtoMessage()

func (*ActuatedAsset) ProtoReflect

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

func (*ActuatedAsset) Reset

func (x *ActuatedAsset) Reset()

func (*ActuatedAsset) String

func (x *ActuatedAsset) String() string

type ActuationsClient

type ActuationsClient interface {
	// Called by the actuator before it starts updating a deployment.
	//
	// The request contains the intended and current states of all assets in the
	// deployment. For each asset the backend responds if it should be actuated
	// or skipped.
	BeginActuation(ctx context.Context, in *BeginActuationRequest, opts ...grpc.CallOption) (*BeginActuationResponse, error)
	// Called by the actuator after it updated all assets it was asked to actuate.
	//
	// If there were no assets that needed actuation, this call is skipped.
	EndActuation(ctx context.Context, in *EndActuationRequest, opts ...grpc.CallOption) (*EndActuationResponse, error)
}

ActuationsClient is the client API for Actuations 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.

Actuations service is used exclusively by the actuator agents.

For each deployment the actuator first calls BeginActuation to report the state of assets there and to get a decision from the backend if it should perform the actuation.

Once the actuation is complete (successfully or not), the actuator calls EndActuation to notify the backend about the results.

func NewActuationsClient

func NewActuationsClient(cc grpc.ClientConnInterface) ActuationsClient

type ActuationsServer

type ActuationsServer interface {
	// Called by the actuator before it starts updating a deployment.
	//
	// The request contains the intended and current states of all assets in the
	// deployment. For each asset the backend responds if it should be actuated
	// or skipped.
	BeginActuation(context.Context, *BeginActuationRequest) (*BeginActuationResponse, error)
	// Called by the actuator after it updated all assets it was asked to actuate.
	//
	// If there were no assets that needed actuation, this call is skipped.
	EndActuation(context.Context, *EndActuationRequest) (*EndActuationResponse, error)
	// contains filtered or unexported methods
}

ActuationsServer is the server API for Actuations service. All implementations must embed UnimplementedActuationsServer for forward compatibility.

Actuations service is used exclusively by the actuator agents.

For each deployment the actuator first calls BeginActuation to report the state of assets there and to get a decision from the backend if it should perform the actuation.

Once the actuation is complete (successfully or not), the actuator calls EndActuation to notify the backend about the results.

type AssetToActuate

type AssetToActuate struct {

	// Asset configuration as defined in the IaC repo.
	Config *modelpb.AssetConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	// The intended state of the asset as defined in the IaC repo.
	IntendedState *modelpb.AssetState `protobuf:"bytes,2,opt,name=intended_state,json=intendedState,proto3" json:"intended_state,omitempty"`
	// The actual state of the asset (as scanned by the actuator).
	ReportedState *modelpb.AssetState `protobuf:"bytes,3,opt,name=reported_state,json=reportedState,proto3" json:"reported_state,omitempty"`
	// contains filtered or unexported fields
}

AssetToActuate describes an asset the actuator is considering for actuation.

Meaning of fields matches deploy.model.Asset message, see its doc for details.

Fields `deployment` and `actuator` of AssetState will be populated based on corresponding fields in BeginActuationRequest and can be omitted here.

func (*AssetToActuate) Descriptor deprecated

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

Deprecated: Use AssetToActuate.ProtoReflect.Descriptor instead.

func (*AssetToActuate) GetConfig

func (x *AssetToActuate) GetConfig() *modelpb.AssetConfig

func (*AssetToActuate) GetIntendedState

func (x *AssetToActuate) GetIntendedState() *modelpb.AssetState

func (*AssetToActuate) GetReportedState

func (x *AssetToActuate) GetReportedState() *modelpb.AssetState

func (*AssetToActuate) ProtoMessage

func (*AssetToActuate) ProtoMessage()

func (*AssetToActuate) ProtoReflect

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

func (*AssetToActuate) Reset

func (x *AssetToActuate) Reset()

func (*AssetToActuate) String

func (x *AssetToActuate) String() string

type AssetsClient

type AssetsClient interface {
	// GetAsset returns an Asset given its ID.
	GetAsset(ctx context.Context, in *GetAssetRequest, opts ...grpc.CallOption) (*modelpb.Asset, error)
	// ListAssets lists assets matching specified filters (if any).
	ListAssets(ctx context.Context, in *ListAssetsRequest, opts ...grpc.CallOption) (*ListAssetsResponse, error)
	// ListAssetHistory fetches an asset and its actuation history.
	ListAssetHistory(ctx context.Context, in *ListAssetHistoryRequest, opts ...grpc.CallOption) (*ListAssetHistoryResponse, error)
}

AssetsClient is the client API for Assets 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.

Assets service allows to view and interact with Assets.

func NewAssetsClient

func NewAssetsClient(cc grpc.ClientConnInterface) AssetsClient

type AssetsServer

type AssetsServer interface {
	// GetAsset returns an Asset given its ID.
	GetAsset(context.Context, *GetAssetRequest) (*modelpb.Asset, error)
	// ListAssets lists assets matching specified filters (if any).
	ListAssets(context.Context, *ListAssetsRequest) (*ListAssetsResponse, error)
	// ListAssetHistory fetches an asset and its actuation history.
	ListAssetHistory(context.Context, *ListAssetHistoryRequest) (*ListAssetHistoryResponse, error)
	// contains filtered or unexported methods
}

AssetsServer is the server API for Assets service. All implementations must embed UnimplementedAssetsServer for forward compatibility.

Assets service allows to view and interact with Assets.

type BeginActuationRequest

type BeginActuationRequest struct {

	// A new actuation to perform.
	//
	// Must have a new unique ID and be in EXECUTING state. If an actuation with
	// such ID already exists, this request is assumed to be a retry and handled
	// as such (perhaps producing FAILED_PRECONDITION response if something
	// doesn't add up).
	Actuation *modelpb.Actuation `protobuf:"bytes,1,opt,name=actuation,proto3" json:"actuation,omitempty"`
	// Assets to be actuated as a map asset_id => AssetToActuate.
	//
	// For each asset the BeginActuationResponse would contain the corresponding
	// ActuationDecision.
	Assets map[string]*AssetToActuate `` /* 153-byte string literal not displayed */
	// Metadata of all artifacts referenced in `assets`.
	Artifacts []*modelpb.Artifact `protobuf:"bytes,3,rep,name=artifacts,proto3" json:"artifacts,omitempty"`
	// contains filtered or unexported fields
}

Sent the actuator before it starts updating a deployment.

func (*BeginActuationRequest) Descriptor deprecated

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

Deprecated: Use BeginActuationRequest.ProtoReflect.Descriptor instead.

func (*BeginActuationRequest) GetActuation

func (x *BeginActuationRequest) GetActuation() *modelpb.Actuation

func (*BeginActuationRequest) GetArtifacts

func (x *BeginActuationRequest) GetArtifacts() []*modelpb.Artifact

func (*BeginActuationRequest) GetAssets

func (x *BeginActuationRequest) GetAssets() map[string]*AssetToActuate

func (*BeginActuationRequest) ProtoMessage

func (*BeginActuationRequest) ProtoMessage()

func (*BeginActuationRequest) ProtoReflect

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

func (*BeginActuationRequest) Reset

func (x *BeginActuationRequest) Reset()

func (*BeginActuationRequest) String

func (x *BeginActuationRequest) String() string

type BeginActuationResponse

type BeginActuationResponse struct {

	// Per-asset decision whether to proceed with the actuation or to skip it.
	Decisions map[string]*modelpb.ActuationDecision `` /* 159-byte string literal not displayed */
	// contains filtered or unexported fields
}

Describes what to to with assets reported in BeginActuationRequest.

func (*BeginActuationResponse) Descriptor deprecated

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

Deprecated: Use BeginActuationResponse.ProtoReflect.Descriptor instead.

func (*BeginActuationResponse) GetDecisions

func (x *BeginActuationResponse) GetDecisions() map[string]*modelpb.ActuationDecision

func (*BeginActuationResponse) ProtoMessage

func (*BeginActuationResponse) ProtoMessage()

func (*BeginActuationResponse) ProtoReflect

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

func (*BeginActuationResponse) Reset

func (x *BeginActuationResponse) Reset()

func (*BeginActuationResponse) String

func (x *BeginActuationResponse) String() string

type EndActuationRequest

type EndActuationRequest struct {

	// ID of the actuation that was passed to BeginActuation RPC previously.
	ActuationId string `protobuf:"bytes,1,opt,name=actuation_id,json=actuationId,proto3" json:"actuation_id,omitempty"`
	// Error details if the actuation failed (perhaps partially).
	Status *status.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// Link to a human-readable actuation log (if available).
	LogUrl string `protobuf:"bytes,3,opt,name=log_url,json=logUrl,proto3" json:"log_url,omitempty"`
	// The state of the actuated (non-skipped) assets post-actuation.
	Assets map[string]*ActuatedAsset `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

Reports the outcome of an actuation.

func (*EndActuationRequest) Descriptor deprecated

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

Deprecated: Use EndActuationRequest.ProtoReflect.Descriptor instead.

func (*EndActuationRequest) GetActuationId

func (x *EndActuationRequest) GetActuationId() string

func (*EndActuationRequest) GetAssets

func (x *EndActuationRequest) GetAssets() map[string]*ActuatedAsset

func (*EndActuationRequest) GetLogUrl

func (x *EndActuationRequest) GetLogUrl() string

func (*EndActuationRequest) GetStatus

func (x *EndActuationRequest) GetStatus() *status.Status

func (*EndActuationRequest) ProtoMessage

func (*EndActuationRequest) ProtoMessage()

func (*EndActuationRequest) ProtoReflect

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

func (*EndActuationRequest) Reset

func (x *EndActuationRequest) Reset()

func (*EndActuationRequest) String

func (x *EndActuationRequest) String() string

type EndActuationResponse

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

EndActuation RPC response.

func (*EndActuationResponse) Descriptor deprecated

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

Deprecated: Use EndActuationResponse.ProtoReflect.Descriptor instead.

func (*EndActuationResponse) ProtoMessage

func (*EndActuationResponse) ProtoMessage()

func (*EndActuationResponse) ProtoReflect

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

func (*EndActuationResponse) Reset

func (x *EndActuationResponse) Reset()

func (*EndActuationResponse) String

func (x *EndActuationResponse) String() string

type GetAssetRequest

type GetAssetRequest struct {
	AssetId string `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"`
	// contains filtered or unexported fields
}

GetAssetRequest specifies what asset to fetch.

func (*GetAssetRequest) Descriptor deprecated

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

Deprecated: Use GetAssetRequest.ProtoReflect.Descriptor instead.

func (*GetAssetRequest) GetAssetId

func (x *GetAssetRequest) GetAssetId() string

func (*GetAssetRequest) ProtoMessage

func (*GetAssetRequest) ProtoMessage()

func (*GetAssetRequest) ProtoReflect

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

func (*GetAssetRequest) Reset

func (x *GetAssetRequest) Reset()

func (*GetAssetRequest) String

func (x *GetAssetRequest) String() string

type ListAssetHistoryRequest

type ListAssetHistoryRequest struct {

	// ID of an asset to fetch the history of.
	AssetId string `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"`
	// ID of the most recent historical entry to fetch (for pagination).
	LatestHistoryId int64 `protobuf:"varint,2,opt,name=latest_history_id,json=latestHistoryId,proto3" json:"latest_history_id,omitempty"`
	// Limit on the number of entries to fetch.
	Limit int32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

ListAssetHistoryRequest specifies what historical records to fetch.

AssetHistory records have consecutive integer IDs. Newer entries have larger IDs. Oldest entries are periodically trimmed. As a result, possible IDs lie in an interval `[oldest_retained_id, last_recorded_id]`, where both ends can increase any time when older entries are trimmed and newer entries are recorded.

ListAssetHistory fetches entries in reverse chronological order (the most recent entries with highest ID come first).

If `latest_history_id` is given, it defines a range of records to fetch as `(latest_history_id-limit, latest_history_id]`. The response will contain records from intersection of this interval with interval of all possible IDs (as defined above).

If `latest_history_id` is absent, it is assumed to be `last_recorded_id`.

If `limit` is absent, it is assumed to be some default page size. It is also silently capped by some largish value.

func (*ListAssetHistoryRequest) Descriptor deprecated

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

Deprecated: Use ListAssetHistoryRequest.ProtoReflect.Descriptor instead.

func (*ListAssetHistoryRequest) GetAssetId

func (x *ListAssetHistoryRequest) GetAssetId() string

func (*ListAssetHistoryRequest) GetLatestHistoryId

func (x *ListAssetHistoryRequest) GetLatestHistoryId() int64

func (*ListAssetHistoryRequest) GetLimit

func (x *ListAssetHistoryRequest) GetLimit() int32

func (*ListAssetHistoryRequest) ProtoMessage

func (*ListAssetHistoryRequest) ProtoMessage()

func (*ListAssetHistoryRequest) ProtoReflect

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

func (*ListAssetHistoryRequest) Reset

func (x *ListAssetHistoryRequest) Reset()

func (*ListAssetHistoryRequest) String

func (x *ListAssetHistoryRequest) String() string

type ListAssetHistoryResponse

type ListAssetHistoryResponse struct {

	// Asset at its current state.
	Asset *modelpb.Asset `protobuf:"bytes,1,opt,name=asset,proto3" json:"asset,omitempty"`
	// A historical entry being recorded right now, if any.
	Current *modelpb.AssetHistory `protobuf:"bytes,2,opt,name=current,proto3" json:"current,omitempty"`
	// ID of the most recently recorded and committed entry (for pagination back).
	LastRecordedHistoryId int64 `` /* 129-byte string literal not displayed */
	// Historical records starting with `latest_history_id`.
	History []*modelpb.AssetHistory `protobuf:"bytes,4,rep,name=history,proto3" json:"history,omitempty"`
	// contains filtered or unexported fields
}

ListAssetHistoryResponse contains an asset and its actuation history.

func (*ListAssetHistoryResponse) Descriptor deprecated

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

Deprecated: Use ListAssetHistoryResponse.ProtoReflect.Descriptor instead.

func (*ListAssetHistoryResponse) GetAsset

func (x *ListAssetHistoryResponse) GetAsset() *modelpb.Asset

func (*ListAssetHistoryResponse) GetCurrent

func (*ListAssetHistoryResponse) GetHistory

func (x *ListAssetHistoryResponse) GetHistory() []*modelpb.AssetHistory

func (*ListAssetHistoryResponse) GetLastRecordedHistoryId

func (x *ListAssetHistoryResponse) GetLastRecordedHistoryId() int64

func (*ListAssetHistoryResponse) ProtoMessage

func (*ListAssetHistoryResponse) ProtoMessage()

func (*ListAssetHistoryResponse) ProtoReflect

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

func (*ListAssetHistoryResponse) Reset

func (x *ListAssetHistoryResponse) Reset()

func (*ListAssetHistoryResponse) String

func (x *ListAssetHistoryResponse) String() string

type ListAssetsRequest

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

ListAssetsRequest specifies what assets to list.

Empty request means to list all available assets.

func (*ListAssetsRequest) Descriptor deprecated

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

Deprecated: Use ListAssetsRequest.ProtoReflect.Descriptor instead.

func (*ListAssetsRequest) ProtoMessage

func (*ListAssetsRequest) ProtoMessage()

func (*ListAssetsRequest) ProtoReflect

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

func (*ListAssetsRequest) Reset

func (x *ListAssetsRequest) Reset()

func (*ListAssetsRequest) String

func (x *ListAssetsRequest) String() string

type ListAssetsResponse

type ListAssetsResponse struct {

	// Assets in order of their IDs.
	Assets []*modelpb.Asset `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets,omitempty"`
	// contains filtered or unexported fields
}

ListAssetsResponse contains asset listing.

func (*ListAssetsResponse) Descriptor deprecated

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

Deprecated: Use ListAssetsResponse.ProtoReflect.Descriptor instead.

func (*ListAssetsResponse) GetAssets

func (x *ListAssetsResponse) GetAssets() []*modelpb.Asset

func (*ListAssetsResponse) ProtoMessage

func (*ListAssetsResponse) ProtoMessage()

func (*ListAssetsResponse) ProtoReflect

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

func (*ListAssetsResponse) Reset

func (x *ListAssetsResponse) Reset()

func (*ListAssetsResponse) String

func (x *ListAssetsResponse) String() string

type UnimplementedActuationsServer

type UnimplementedActuationsServer struct{}

UnimplementedActuationsServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedActuationsServer) BeginActuation

func (UnimplementedActuationsServer) EndActuation

type UnimplementedAssetsServer

type UnimplementedAssetsServer struct{}

UnimplementedAssetsServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedAssetsServer) GetAsset

func (UnimplementedAssetsServer) ListAssetHistory

func (UnimplementedAssetsServer) ListAssets

type UnsafeActuationsServer

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

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

type UnsafeAssetsServer

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

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

Jump to

Keyboard shortcuts

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