cortexops

package
v0.9.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package cortexops is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	InstallState_name = map[int32]string{
		0: "Unknown",
		1: "NotInstalled",
		2: "Updating",
		3: "Installed",
		4: "Uninstalling",
	}
	InstallState_value = map[string]int32{
		"Unknown":      0,
		"NotInstalled": 1,
		"Updating":     2,
		"Installed":    3,
		"Uninstalling": 4,
	}
)

Enum value maps for InstallState.

View Source
var (
	DeploymentMode_name = map[int32]string{
		0: "AllInOne",
		1: "HighlyAvailable",
	}
	DeploymentMode_value = map[string]int32{
		"AllInOne":        0,
		"HighlyAvailable": 1,
	}
)

Enum value maps for DeploymentMode.

View Source
var CortexOps_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cortexops.CortexOps",
	HandlerType: (*CortexOpsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetClusterConfiguration",
			Handler:    _CortexOps_GetClusterConfiguration_Handler,
		},
		{
			MethodName: "ConfigureCluster",
			Handler:    _CortexOps_ConfigureCluster_Handler,
		},
		{
			MethodName: "GetClusterStatus",
			Handler:    _CortexOps_GetClusterStatus_Handler,
		},
		{
			MethodName: "UninstallCluster",
			Handler:    _CortexOps_UninstallCluster_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/rancher/opni/plugins/metrics/pkg/apis/cortexops/cortexops.proto",
}

CortexOps_ServiceDesc is the grpc.ServiceDesc for CortexOps 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_plugins_metrics_pkg_apis_cortexops_cortexops_proto protoreflect.FileDescriptor

Functions

func RegisterCortexOpsHandler

func RegisterCortexOpsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterCortexOpsHandler registers the http handlers for service CortexOps to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterCortexOpsHandlerClient

func RegisterCortexOpsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CortexOpsClient) error

RegisterCortexOpsHandlerClient registers the http handlers for service CortexOps to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CortexOpsClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CortexOpsClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CortexOpsClient" to call the correct interceptors.

func RegisterCortexOpsHandlerFromEndpoint

func RegisterCortexOpsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterCortexOpsHandlerFromEndpoint is same as RegisterCortexOpsHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterCortexOpsHandlerServer

func RegisterCortexOpsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CortexOpsServer) error

RegisterCortexOpsHandlerServer registers the http handlers for service CortexOps to "mux". UnaryRPC :call CortexOpsServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterCortexOpsHandlerFromEndpoint instead.

func RegisterCortexOpsServer

func RegisterCortexOpsServer(s grpc.ServiceRegistrar, srv CortexOpsServer)

Types

type ClusterConfiguration

type ClusterConfiguration struct {
	Mode    DeploymentMode  `protobuf:"varint,1,opt,name=mode,proto3,enum=cortexops.DeploymentMode" json:"mode,omitempty"`
	Storage *v1.StorageSpec `protobuf:"bytes,2,opt,name=storage,proto3" json:"storage,omitempty"`
	Grafana *GrafanaConfig  `protobuf:"bytes,3,opt,name=grafana,proto3" json:"grafana,omitempty"`
	// contains filtered or unexported fields
}

func (*ClusterConfiguration) Descriptor deprecated

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

Deprecated: Use ClusterConfiguration.ProtoReflect.Descriptor instead.

func (*ClusterConfiguration) GetGrafana

func (x *ClusterConfiguration) GetGrafana() *GrafanaConfig

func (*ClusterConfiguration) GetMode

func (x *ClusterConfiguration) GetMode() DeploymentMode

func (*ClusterConfiguration) GetStorage

func (x *ClusterConfiguration) GetStorage() *v1.StorageSpec

func (*ClusterConfiguration) ProtoMessage

func (*ClusterConfiguration) ProtoMessage()

func (*ClusterConfiguration) ProtoReflect

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

func (*ClusterConfiguration) Reset

func (x *ClusterConfiguration) Reset()

func (*ClusterConfiguration) String

func (x *ClusterConfiguration) String() string

type CortexOpsClient

type CortexOpsClient interface {
	GetClusterConfiguration(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ClusterConfiguration, error)
	ConfigureCluster(ctx context.Context, in *ClusterConfiguration, opts ...grpc.CallOption) (*emptypb.Empty, error)
	GetClusterStatus(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*InstallStatus, error)
	UninstallCluster(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

CortexOpsClient is the client API for CortexOps 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 NewCortexOpsClient

func NewCortexOpsClient(cc grpc.ClientConnInterface) CortexOpsClient

type CortexOpsServer

type CortexOpsServer interface {
	GetClusterConfiguration(context.Context, *emptypb.Empty) (*ClusterConfiguration, error)
	ConfigureCluster(context.Context, *ClusterConfiguration) (*emptypb.Empty, error)
	GetClusterStatus(context.Context, *emptypb.Empty) (*InstallStatus, error)
	UninstallCluster(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

CortexOpsServer is the server API for CortexOps service. All implementations must embed UnimplementedCortexOpsServer for forward compatibility

type DeploymentMode

type DeploymentMode int32
const (
	DeploymentMode_AllInOne        DeploymentMode = 0
	DeploymentMode_HighlyAvailable DeploymentMode = 1
)

func (DeploymentMode) Descriptor

func (DeploymentMode) Enum

func (x DeploymentMode) Enum() *DeploymentMode

func (DeploymentMode) EnumDescriptor deprecated

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

Deprecated: Use DeploymentMode.Descriptor instead.

func (DeploymentMode) Number

func (DeploymentMode) String

func (x DeploymentMode) String() string

func (DeploymentMode) Type

type GrafanaConfig

type GrafanaConfig struct {
	Enabled  *bool  `protobuf:"varint,1,opt,name=enabled,proto3,oneof" json:"enabled,omitempty"`
	Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3" json:"hostname,omitempty"`
	// contains filtered or unexported fields
}

func (*GrafanaConfig) Descriptor deprecated

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

Deprecated: Use GrafanaConfig.ProtoReflect.Descriptor instead.

func (*GrafanaConfig) GetEnabled

func (x *GrafanaConfig) GetEnabled() bool

func (*GrafanaConfig) GetHostname

func (x *GrafanaConfig) GetHostname() string

func (*GrafanaConfig) ProtoMessage

func (*GrafanaConfig) ProtoMessage()

func (*GrafanaConfig) ProtoReflect

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

func (*GrafanaConfig) Reset

func (x *GrafanaConfig) Reset()

func (*GrafanaConfig) String

func (x *GrafanaConfig) String() string

type InstallState

type InstallState int32
const (
	InstallState_Unknown      InstallState = 0
	InstallState_NotInstalled InstallState = 1
	InstallState_Updating     InstallState = 2
	InstallState_Installed    InstallState = 3
	InstallState_Uninstalling InstallState = 4
)

func (InstallState) Descriptor

func (InstallState) Enum

func (x InstallState) Enum() *InstallState

func (InstallState) EnumDescriptor deprecated

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

Deprecated: Use InstallState.Descriptor instead.

func (InstallState) Number

func (InstallState) String

func (x InstallState) String() string

func (InstallState) Type

type InstallStatus

type InstallStatus struct {
	State    InstallState      `protobuf:"varint,1,opt,name=state,proto3,enum=cortexops.InstallState" json:"state,omitempty"`
	Version  string            `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	Metadata map[string]string `` /* 157-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*InstallStatus) Descriptor deprecated

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

Deprecated: Use InstallStatus.ProtoReflect.Descriptor instead.

func (*InstallStatus) GetMetadata

func (x *InstallStatus) GetMetadata() map[string]string

func (*InstallStatus) GetState

func (x *InstallStatus) GetState() InstallState

func (*InstallStatus) GetVersion

func (x *InstallStatus) GetVersion() string

func (*InstallStatus) ProtoMessage

func (*InstallStatus) ProtoMessage()

func (*InstallStatus) ProtoReflect

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

func (*InstallStatus) Reset

func (x *InstallStatus) Reset()

func (*InstallStatus) String

func (x *InstallStatus) String() string

type OpsClientOption

type OpsClientOption func(*OpsClientOptions)

func WithDialOptions

func WithDialOptions(options ...grpc.DialOption) OpsClientOption

func WithListenAddress

func WithListenAddress(addr string) OpsClientOption

type OpsClientOptions

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

type UnimplementedCortexOpsServer

type UnimplementedCortexOpsServer struct {
}

UnimplementedCortexOpsServer must be embedded to have forward compatible implementations.

func (UnimplementedCortexOpsServer) ConfigureCluster

func (UnimplementedCortexOpsServer) GetClusterConfiguration

func (UnimplementedCortexOpsServer) GetClusterStatus

func (UnimplementedCortexOpsServer) UninstallCluster

type UnsafeCortexOpsServer

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

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

Jump to

Keyboard shortcuts

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