v1

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Backend_Info_FullMethodName              = "/capability.Backend/Info"
	Backend_CanInstall_FullMethodName        = "/capability.Backend/CanInstall"
	Backend_Install_FullMethodName           = "/capability.Backend/Install"
	Backend_Status_FullMethodName            = "/capability.Backend/Status"
	Backend_Uninstall_FullMethodName         = "/capability.Backend/Uninstall"
	Backend_UninstallStatus_FullMethodName   = "/capability.Backend/UninstallStatus"
	Backend_CancelUninstall_FullMethodName   = "/capability.Backend/CancelUninstall"
	Backend_InstallerTemplate_FullMethodName = "/capability.Backend/InstallerTemplate"
)
View Source
const (
	Node_SyncNow_FullMethodName = "/capability.Node/SyncNow"
)

Variables

View Source
var (
	InstallResponseStatus_name = map[int32]string{
		0: "Unknown",
		1: "Success",
		2: "Warning",
		3: "Error",
	}
	InstallResponseStatus_value = map[string]int32{
		"Unknown": 0,
		"Success": 1,
		"Warning": 2,
		"Error":   3,
	}
)

Enum value maps for InstallResponseStatus.

View Source
var Backend_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "capability.Backend",
	HandlerType: (*BackendServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Info",
			Handler:    _Backend_Info_Handler,
		},
		{
			MethodName: "CanInstall",
			Handler:    _Backend_CanInstall_Handler,
		},
		{
			MethodName: "Install",
			Handler:    _Backend_Install_Handler,
		},
		{
			MethodName: "Status",
			Handler:    _Backend_Status_Handler,
		},
		{
			MethodName: "Uninstall",
			Handler:    _Backend_Uninstall_Handler,
		},
		{
			MethodName: "UninstallStatus",
			Handler:    _Backend_UninstallStatus_Handler,
		},
		{
			MethodName: "CancelUninstall",
			Handler:    _Backend_CancelUninstall_Handler,
		},
		{
			MethodName: "InstallerTemplate",
			Handler:    _Backend_InstallerTemplate_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/rancher/opni/pkg/apis/capability/v1/capability.proto",
}

Backend_ServiceDesc is the grpc.ServiceDesc for Backend 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_github_com_rancher_opni_pkg_apis_capability_v1_capability_proto protoreflect.FileDescriptor
View Source
var Node_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "capability.Node",
	HandlerType: (*NodeServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SyncNow",
			Handler:    _Node_SyncNow_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/rancher/opni/pkg/apis/capability/v1/capability.proto",
}

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

Functions

func RegisterBackendServer

func RegisterBackendServer(s grpc.ServiceRegistrar, srv BackendServer)

func RegisterNodeServer

func RegisterNodeServer(s grpc.ServiceRegistrar, srv NodeServer)

Types

type BackendClient

type BackendClient interface {
	// Returns info about the backend, including capability name
	Info(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Details, error)
	// Deprecated: Do not use.
	// Returns an error if installing the capability would fail.
	CanInstall(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Installs the capability on a cluster.
	Install(ctx context.Context, in *InstallRequest, opts ...grpc.CallOption) (*InstallResponse, error)
	// Returns common runtime config info for this capability from a specific
	// cluster (node).
	Status(ctx context.Context, in *v1.Reference, opts ...grpc.CallOption) (*NodeCapabilityStatus, error)
	// Requests the backend to clean up any resources it owns and prepare
	// for uninstallation. This process is asynchronous. The status of the
	// operation can be queried using the UninstallStatus method, or canceled
	// using the CancelUninstall method.
	Uninstall(ctx context.Context, in *UninstallRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Gets the status of the uninstall task for the given cluster.
	UninstallStatus(ctx context.Context, in *v1.Reference, opts ...grpc.CallOption) (*v1.TaskStatus, error)
	// Cancels an uninstall task for the given cluster, if it is still pending.
	CancelUninstall(ctx context.Context, in *v1.Reference, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Deprecated: Do not use.
	// Returns a go template string which will generate a shell command used to
	// install the capability. This will be displayed to the user in the UI.
	// See InstallerTemplateSpec above for the available template fields.
	InstallerTemplate(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*InstallerTemplateResponse, error)
}

BackendClient is the client API for Backend 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 NewBackendClient

func NewBackendClient(cc grpc.ClientConnInterface) BackendClient

type BackendServer

type BackendServer interface {
	// Returns info about the backend, including capability name
	Info(context.Context, *emptypb.Empty) (*Details, error)
	// Deprecated: Do not use.
	// Returns an error if installing the capability would fail.
	CanInstall(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	// Installs the capability on a cluster.
	Install(context.Context, *InstallRequest) (*InstallResponse, error)
	// Returns common runtime config info for this capability from a specific
	// cluster (node).
	Status(context.Context, *v1.Reference) (*NodeCapabilityStatus, error)
	// Requests the backend to clean up any resources it owns and prepare
	// for uninstallation. This process is asynchronous. The status of the
	// operation can be queried using the UninstallStatus method, or canceled
	// using the CancelUninstall method.
	Uninstall(context.Context, *UninstallRequest) (*emptypb.Empty, error)
	// Gets the status of the uninstall task for the given cluster.
	UninstallStatus(context.Context, *v1.Reference) (*v1.TaskStatus, error)
	// Cancels an uninstall task for the given cluster, if it is still pending.
	CancelUninstall(context.Context, *v1.Reference) (*emptypb.Empty, error)
	// Deprecated: Do not use.
	// Returns a go template string which will generate a shell command used to
	// install the capability. This will be displayed to the user in the UI.
	// See InstallerTemplateSpec above for the available template fields.
	InstallerTemplate(context.Context, *emptypb.Empty) (*InstallerTemplateResponse, error)
	// contains filtered or unexported methods
}

BackendServer is the server API for Backend service. All implementations must embed UnimplementedBackendServer for forward compatibility

type DefaultUninstallOptions

type DefaultUninstallOptions struct {
	// If true, will permanently delete all stored data associated with this
	// capability.
	DeleteStoredData bool `json:"deleteStoredData,omitempty"`
	// Delay the uninstall operation by this amount of time, during which the
	// operation can be canceled without incurring any data loss.
	// If deleteStoredData is false, this option may not have any effect.
	InitialDelay Duration `json:"initialDelay,omitempty"`
}

func (*DefaultUninstallOptions) LoadFromStruct

func (uo *DefaultUninstallOptions) LoadFromStruct(s *structpb.Struct) error

func (DefaultUninstallOptions) ToStruct

func (uo DefaultUninstallOptions) ToStruct() *structpb.Struct

type Details added in v0.6.2

type Details struct {
	Name    string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Source  string   `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
	Drivers []string `protobuf:"bytes,3,rep,name=drivers,proto3" json:"drivers,omitempty"`
	// contains filtered or unexported fields
}

func (*Details) Descriptor deprecated added in v0.6.2

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

Deprecated: Use Details.ProtoReflect.Descriptor instead.

func (*Details) GetDrivers added in v0.6.2

func (x *Details) GetDrivers() []string

func (*Details) GetName added in v0.6.2

func (x *Details) GetName() string

func (*Details) GetSource added in v0.6.2

func (x *Details) GetSource() string

func (*Details) ProtoMessage added in v0.6.2

func (*Details) ProtoMessage()

func (*Details) ProtoReflect added in v0.6.2

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

func (*Details) Reset added in v0.6.2

func (x *Details) Reset()

func (*Details) String added in v0.6.2

func (x *Details) String() string

type Duration

type Duration time.Duration

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

type Filter

type Filter struct {
	CapabilityNames []string `protobuf:"bytes,1,rep,name=capabilityNames,proto3" json:"capabilityNames,omitempty"`
	// contains filtered or unexported fields
}

func (*Filter) Descriptor deprecated

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

Deprecated: Use Filter.ProtoReflect.Descriptor instead.

func (*Filter) GetCapabilityNames

func (x *Filter) GetCapabilityNames() []string

func (*Filter) ProtoMessage

func (*Filter) ProtoMessage()

func (*Filter) ProtoReflect

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

func (*Filter) Reset

func (x *Filter) Reset()

func (*Filter) String

func (x *Filter) String() string

type InstallRequest

type InstallRequest struct {
	Cluster        *v1.Reference `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"`
	IgnoreWarnings bool          `protobuf:"varint,2,opt,name=ignoreWarnings,proto3" json:"ignoreWarnings,omitempty"`
	// contains filtered or unexported fields
}

func (*InstallRequest) Descriptor deprecated

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

Deprecated: Use InstallRequest.ProtoReflect.Descriptor instead.

func (*InstallRequest) GetCluster

func (x *InstallRequest) GetCluster() *v1.Reference

func (*InstallRequest) GetIgnoreWarnings

func (x *InstallRequest) GetIgnoreWarnings() bool

func (*InstallRequest) ProtoMessage

func (*InstallRequest) ProtoMessage()

func (*InstallRequest) ProtoReflect

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

func (*InstallRequest) Reset

func (x *InstallRequest) Reset()

func (*InstallRequest) String

func (x *InstallRequest) String() string

func (*InstallRequest) Validate

func (req *InstallRequest) Validate() error

type InstallResponse

type InstallResponse struct {
	Status  InstallResponseStatus `protobuf:"varint,1,opt,name=status,proto3,enum=capability.InstallResponseStatus" json:"status,omitempty"`
	Message string                `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*InstallResponse) Descriptor deprecated

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

Deprecated: Use InstallResponse.ProtoReflect.Descriptor instead.

func (*InstallResponse) GetMessage

func (x *InstallResponse) GetMessage() string

func (*InstallResponse) GetStatus

func (x *InstallResponse) GetStatus() InstallResponseStatus

func (*InstallResponse) ProtoMessage

func (*InstallResponse) ProtoMessage()

func (*InstallResponse) ProtoReflect

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

func (*InstallResponse) Reset

func (x *InstallResponse) Reset()

func (*InstallResponse) String

func (x *InstallResponse) String() string

type InstallResponseStatus

type InstallResponseStatus int32
const (
	InstallResponseStatus_Unknown InstallResponseStatus = 0
	InstallResponseStatus_Success InstallResponseStatus = 1
	InstallResponseStatus_Warning InstallResponseStatus = 2
	InstallResponseStatus_Error   InstallResponseStatus = 3
)

func (InstallResponseStatus) Descriptor

func (InstallResponseStatus) Enum

func (InstallResponseStatus) EnumDescriptor deprecated

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

Deprecated: Use InstallResponseStatus.Descriptor instead.

func (InstallResponseStatus) Number

func (InstallResponseStatus) String

func (x InstallResponseStatus) String() string

func (InstallResponseStatus) Type

type InstallerTemplateResponse

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

func (*InstallerTemplateResponse) Descriptor deprecated

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

Deprecated: Use InstallerTemplateResponse.ProtoReflect.Descriptor instead.

func (*InstallerTemplateResponse) GetTemplate

func (x *InstallerTemplateResponse) GetTemplate() string

func (*InstallerTemplateResponse) ProtoMessage

func (*InstallerTemplateResponse) ProtoMessage()

func (*InstallerTemplateResponse) ProtoReflect

func (*InstallerTemplateResponse) Reset

func (x *InstallerTemplateResponse) Reset()

func (*InstallerTemplateResponse) String

func (x *InstallerTemplateResponse) String() string

type NodeCapabilityStatus

type NodeCapabilityStatus struct {
	Enabled      bool                   `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	LastSync     *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=lastSync,proto3" json:"lastSync,omitempty"`
	Conditions   []string               `protobuf:"bytes,3,rep,name=conditions,proto3" json:"conditions,omitempty"`
	LastRevision *v1.Revision           `protobuf:"bytes,4,opt,name=lastRevision,proto3" json:"lastRevision,omitempty"`
	// contains filtered or unexported fields
}

func (*NodeCapabilityStatus) Descriptor deprecated

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

Deprecated: Use NodeCapabilityStatus.ProtoReflect.Descriptor instead.

func (*NodeCapabilityStatus) GetConditions added in v0.10.0

func (x *NodeCapabilityStatus) GetConditions() []string

func (*NodeCapabilityStatus) GetEnabled

func (x *NodeCapabilityStatus) GetEnabled() bool

func (*NodeCapabilityStatus) GetLastRevision added in v0.12.0

func (x *NodeCapabilityStatus) GetLastRevision() *v1.Revision

func (*NodeCapabilityStatus) GetLastSync

func (x *NodeCapabilityStatus) GetLastSync() *timestamppb.Timestamp

func (*NodeCapabilityStatus) ProtoMessage

func (*NodeCapabilityStatus) ProtoMessage()

func (*NodeCapabilityStatus) ProtoReflect

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

func (*NodeCapabilityStatus) Reset

func (x *NodeCapabilityStatus) Reset()

func (*NodeCapabilityStatus) String

func (x *NodeCapabilityStatus) String() string

type NodeClient

type NodeClient interface {
	SyncNow(ctx context.Context, in *Filter, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

NodeClient is the client API for Node 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 NewNodeClient

func NewNodeClient(cc grpc.ClientConnInterface) NodeClient

type NodeServer

type NodeServer interface {
	SyncNow(context.Context, *Filter) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

NodeServer is the server API for Node service. All implementations must embed UnimplementedNodeServer for forward compatibility

type SyncRequest

type SyncRequest struct {

	// An empty cluster ID indicates that all clusters should be synced.
	Cluster *v1.Reference `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"`
	Filter  *Filter       `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"`
	// contains filtered or unexported fields
}

func (*SyncRequest) Descriptor deprecated

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

Deprecated: Use SyncRequest.ProtoReflect.Descriptor instead.

func (*SyncRequest) GetCluster

func (x *SyncRequest) GetCluster() *v1.Reference

func (*SyncRequest) GetFilter

func (x *SyncRequest) GetFilter() *Filter

func (*SyncRequest) ProtoMessage

func (*SyncRequest) ProtoMessage()

func (*SyncRequest) ProtoReflect

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

func (*SyncRequest) Reset

func (x *SyncRequest) Reset()

func (*SyncRequest) String

func (x *SyncRequest) String() string

func (*SyncRequest) Validate added in v0.9.2

func (req *SyncRequest) Validate() error

type UnimplementedBackendServer

type UnimplementedBackendServer struct {
}

UnimplementedBackendServer must be embedded to have forward compatible implementations.

func (UnimplementedBackendServer) CanInstall

func (UnimplementedBackendServer) CancelUninstall

func (UnimplementedBackendServer) Info

func (UnimplementedBackendServer) Install

func (UnimplementedBackendServer) InstallerTemplate

func (UnimplementedBackendServer) Status

func (UnimplementedBackendServer) Uninstall

func (UnimplementedBackendServer) UninstallStatus

type UnimplementedNodeServer

type UnimplementedNodeServer struct {
}

UnimplementedNodeServer must be embedded to have forward compatible implementations.

func (UnimplementedNodeServer) SyncNow

type UninstallRequest

type UninstallRequest struct {
	Cluster *v1.Reference    `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"`
	Options *structpb.Struct `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

func (*UninstallRequest) Descriptor deprecated

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

Deprecated: Use UninstallRequest.ProtoReflect.Descriptor instead.

func (*UninstallRequest) GetCluster

func (x *UninstallRequest) GetCluster() *v1.Reference

func (*UninstallRequest) GetOptions

func (x *UninstallRequest) GetOptions() *structpb.Struct

func (*UninstallRequest) ProtoMessage

func (*UninstallRequest) ProtoMessage()

func (*UninstallRequest) ProtoReflect

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

func (*UninstallRequest) Reset

func (x *UninstallRequest) Reset()

func (*UninstallRequest) String

func (x *UninstallRequest) String() string

func (*UninstallRequest) Validate

func (req *UninstallRequest) Validate() error

type UnsafeBackendServer

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

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

type UnsafeNodeServer

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

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

Jump to

Keyboard shortcuts

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