instances

package
v0.0.0-...-d3e053c Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 14 Imported by: 9

Documentation

Overview

Package instances contains a GCE instances service.

Index

Constants

This section is empty.

Variables

View Source
var File_go_chromium_org_luci_gce_api_instances_v1_service_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 RegisterInstancesServer

func RegisterInstancesServer(s prpc.Registrar, srv InstancesServer)

Types

type DecoratedInstances

type DecoratedInstances struct {
	// Service is the service to decorate.
	Service InstancesServer
	// Prelude is called for each method before forwarding the call to Service.
	// If Prelude returns an error, then the call is skipped and the error is
	// processed via the Postlude (if one is defined), or it is returned directly.
	Prelude func(ctx context.Context, methodName string, req proto.Message) (context.Context, error)
	// Postlude is called for each method after Service has processed the call, or
	// after the Prelude has returned an error. This takes the Service's
	// response proto (which may be nil) and/or any error. The decorated
	// service will return the response (possibly mutated) and error that Postlude
	// returns.
	Postlude func(ctx context.Context, methodName string, rsp proto.Message, err error) error
}

func (*DecoratedInstances) Delete

func (s *DecoratedInstances) Delete(ctx context.Context, req *DeleteRequest) (rsp *emptypb.Empty, err error)

func (*DecoratedInstances) Get

func (s *DecoratedInstances) Get(ctx context.Context, req *GetRequest) (rsp *Instance, err error)

func (*DecoratedInstances) List

func (s *DecoratedInstances) List(ctx context.Context, req *ListRequest) (rsp *ListResponse, err error)

type DeleteRequest

type DeleteRequest struct {

	// The ID of the instance to delete.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The hostname of the instance to delete.
	Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3" json:"hostname,omitempty"`
	// contains filtered or unexported fields
}

A request to delete an instance.

func (*DeleteRequest) Descriptor deprecated

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

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetHostname

func (x *DeleteRequest) GetHostname() string

func (*DeleteRequest) GetId

func (x *DeleteRequest) GetId() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

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

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type Disk

type Disk struct {

	// The image associated with this disk.
	// https://cloud.google.com/compute/docs/reference/rest/v1/images/list.
	Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"`
	// contains filtered or unexported fields
}

A disk associated with a GCE instance.

func (*Disk) Descriptor deprecated

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

Deprecated: Use Disk.ProtoReflect.Descriptor instead.

func (*Disk) GetImage

func (x *Disk) GetImage() string

func (*Disk) ProtoMessage

func (*Disk) ProtoMessage()

func (*Disk) ProtoReflect

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

func (*Disk) Reset

func (x *Disk) Reset()

func (*Disk) String

func (x *Disk) String() string

type GetRequest

type GetRequest struct {

	// The ID of the instance to get.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The hostname of the instance to get.
	Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3" json:"hostname,omitempty"`
	// contains filtered or unexported fields
}

A request to get an existing instance.

func (*GetRequest) Descriptor deprecated

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

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetHostname

func (x *GetRequest) GetHostname() string

func (*GetRequest) GetId

func (x *GetRequest) GetId() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

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

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

type Instance

type Instance struct {

	// The ID of the VM this instance was created from.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// The hostname associated with this instance.
	Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3" json:"hostname,omitempty"`
	// The zone associated with this instance.
	// https://cloud.google.com/compute/docs/reference/rest/v1/zones/list.
	Zone string `protobuf:"bytes,3,opt,name=zone,proto3" json:"zone,omitempty"`
	// The GCP project associated with this instance.
	Project string `protobuf:"bytes,4,opt,name=project,proto3" json:"project,omitempty"`
	// The timestamp when this instance was created.
	Created *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created,proto3" json:"created,omitempty"`
	// The lifetime of this instance.
	// At the end of its lifetime, the instance is deleted.
	Lifetime int64 `protobuf:"varint,6,opt,name=lifetime,proto3" json:"lifetime,omitempty"`
	// The hostname of the Swarming server this instance should connect to.
	Swarming string `protobuf:"bytes,7,opt,name=swarming,proto3" json:"swarming,omitempty"`
	// The timestamp when this instance connected to Swarming.
	Connected *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=connected,proto3" json:"connected,omitempty"`
	// The timeout of this instance.
	// If no Swarming bot has connected by the timeout, the instance is deleted.
	Timeout int64 `protobuf:"varint,9,opt,name=timeout,proto3" json:"timeout,omitempty"`
	// Whether this instance is drained or not.
	// A drained instance will be safely deleted regardless of lifetime.
	Drained bool `protobuf:"varint,10,opt,name=drained,proto3" json:"drained,omitempty"`
	// The config revision associated with this instance.
	ConfigRevision string `protobuf:"bytes,11,opt,name=config_revision,json=configRevision,proto3" json:"config_revision,omitempty"`
	// The disks associated with this instance.
	Disks []*Disk `protobuf:"bytes,12,rep,name=disks,proto3" json:"disks,omitempty"`
	// The network interfaces associated with this instance.
	NetworkInterfaces []*NetworkInterface `protobuf:"bytes,13,rep,name=network_interfaces,json=networkInterfaces,proto3" json:"network_interfaces,omitempty"`
	// The prefix associated with this instance.
	Prefix string `protobuf:"bytes,14,opt,name=prefix,proto3" json:"prefix,omitempty"`
	// contains filtered or unexported fields
}

A GCE instance configured to exist. The instance actually exists iff the created timestamp is set.

func (*Instance) Descriptor deprecated

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

Deprecated: Use Instance.ProtoReflect.Descriptor instead.

func (*Instance) GetConfigRevision

func (x *Instance) GetConfigRevision() string

func (*Instance) GetConnected

func (x *Instance) GetConnected() *timestamppb.Timestamp

func (*Instance) GetCreated

func (x *Instance) GetCreated() *timestamppb.Timestamp

func (*Instance) GetDisks

func (x *Instance) GetDisks() []*Disk

func (*Instance) GetDrained

func (x *Instance) GetDrained() bool

func (*Instance) GetHostname

func (x *Instance) GetHostname() string

func (*Instance) GetId

func (x *Instance) GetId() string

func (*Instance) GetLifetime

func (x *Instance) GetLifetime() int64

func (*Instance) GetNetworkInterfaces

func (x *Instance) GetNetworkInterfaces() []*NetworkInterface

func (*Instance) GetPrefix

func (x *Instance) GetPrefix() string

func (*Instance) GetProject

func (x *Instance) GetProject() string

func (*Instance) GetSwarming

func (x *Instance) GetSwarming() string

func (*Instance) GetTimeout

func (x *Instance) GetTimeout() int64

func (*Instance) GetZone

func (x *Instance) GetZone() string

func (*Instance) ProtoMessage

func (*Instance) ProtoMessage()

func (*Instance) ProtoReflect

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

func (*Instance) Reset

func (x *Instance) Reset()

func (*Instance) String

func (x *Instance) String() string

type InstancesClient

type InstancesClient interface {
	// Delete deletes an instance asynchronously.
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Get returns an existing instance.
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*Instance, error)
	// List returns existing instances.
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
}

InstancesClient is the client API for Instances service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewInstancesClient

func NewInstancesClient(cc grpc.ClientConnInterface) InstancesClient

func NewInstancesPRPCClient

func NewInstancesPRPCClient(client *prpc.Client) InstancesClient

type InstancesServer

type InstancesServer interface {
	// Delete deletes an instance asynchronously.
	Delete(context.Context, *DeleteRequest) (*emptypb.Empty, error)
	// Get returns an existing instance.
	Get(context.Context, *GetRequest) (*Instance, error)
	// List returns existing instances.
	List(context.Context, *ListRequest) (*ListResponse, error)
}

InstancesServer is the server API for Instances service.

type ListRequest

type ListRequest struct {

	// The prefix to list instances for.
	Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"`
	// The value of next_page_token received in a ListResponse. Used to get the
	// next page of instances. If empty, gets the first page.
	PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	// The maximum number of results to include in the response.
	PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// A filter to apply when listing instances. Currently the only supported
	// filter is "disks.image=<image>" where <image> is the name of the image to
	// filter for.
	Filter string `protobuf:"bytes,4,opt,name=filter,proto3" json:"filter,omitempty"`
	// contains filtered or unexported fields
}

A request to list existing instances.

func (*ListRequest) Descriptor deprecated

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

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetFilter

func (x *ListRequest) GetFilter() string

func (*ListRequest) GetPageSize

func (x *ListRequest) GetPageSize() int32

func (*ListRequest) GetPageToken

func (x *ListRequest) GetPageToken() string

func (*ListRequest) GetPrefix

func (x *ListRequest) GetPrefix() string

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

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

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

type ListResponse

type ListResponse struct {

	// The prefix the instances are for.
	Prefix string `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"`
	// The instances matching the prefix.
	Instances []*Instance `protobuf:"bytes,2,rep,name=instances,proto3" json:"instances,omitempty"`
	// The value to use as the page_token in a ListRequest to get the next page of
	// instances. If empty, there are no more instances.
	NextPageToken string `protobuf:"bytes,3,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
	// contains filtered or unexported fields
}

A response to a request to list instances.

func (*ListResponse) Descriptor deprecated

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

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetInstances

func (x *ListResponse) GetInstances() []*Instance

func (*ListResponse) GetNextPageToken

func (x *ListResponse) GetNextPageToken() string

func (*ListResponse) GetPrefix

func (x *ListResponse) GetPrefix() string

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect

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

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

type NetworkInterface

type NetworkInterface struct {

	// The internal IP address associated with this network interface.
	InternalIp string `protobuf:"bytes,1,opt,name=internal_ip,json=internalIp,proto3" json:"internal_ip,omitempty"`
	// The external IP addresses associated with this network interface.
	ExternalIps []string `protobuf:"bytes,2,rep,name=external_ips,json=externalIps,proto3" json:"external_ips,omitempty"`
	// contains filtered or unexported fields
}

A network interface associated with a GCE instance.

func (*NetworkInterface) Descriptor deprecated

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

Deprecated: Use NetworkInterface.ProtoReflect.Descriptor instead.

func (*NetworkInterface) GetExternalIps

func (x *NetworkInterface) GetExternalIps() []string

func (*NetworkInterface) GetInternalIp

func (x *NetworkInterface) GetInternalIp() string

func (*NetworkInterface) ProtoMessage

func (*NetworkInterface) ProtoMessage()

func (*NetworkInterface) ProtoReflect

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

func (*NetworkInterface) Reset

func (x *NetworkInterface) Reset()

func (*NetworkInterface) String

func (x *NetworkInterface) String() string

type UnimplementedInstancesServer

type UnimplementedInstancesServer struct {
}

UnimplementedInstancesServer can be embedded to have forward compatible implementations.

func (*UnimplementedInstancesServer) Delete

func (*UnimplementedInstancesServer) Get

func (*UnimplementedInstancesServer) List

Jump to

Keyboard shortcuts

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