alertops

package
v0.9.1-rc1 Latest Latest
Warning

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

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

Documentation

Overview

Package alertops is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	AlertingAdmin_GetClusterConfiguration_FullMethodName = "/alerting.ops.AlertingAdmin/GetClusterConfiguration"
	AlertingAdmin_ConfigureCluster_FullMethodName        = "/alerting.ops.AlertingAdmin/ConfigureCluster"
	AlertingAdmin_GetClusterStatus_FullMethodName        = "/alerting.ops.AlertingAdmin/GetClusterStatus"
	AlertingAdmin_InstallCluster_FullMethodName          = "/alerting.ops.AlertingAdmin/InstallCluster"
	AlertingAdmin_UninstallCluster_FullMethodName        = "/alerting.ops.AlertingAdmin/UninstallCluster"
)
View Source
const (
	ConfigReconciler_ConnectRemoteSyncer_FullMethodName = "/alerting.ops.ConfigReconciler/ConnectRemoteSyncer"
)

Variables

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

Enum value maps for InstallState.

View Source
var AlertingAdmin_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "alerting.ops.AlertingAdmin",
	HandlerType: (*AlertingAdminServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetClusterConfiguration",
			Handler:    _AlertingAdmin_GetClusterConfiguration_Handler,
		},
		{
			MethodName: "ConfigureCluster",
			Handler:    _AlertingAdmin_ConfigureCluster_Handler,
		},
		{
			MethodName: "GetClusterStatus",
			Handler:    _AlertingAdmin_GetClusterStatus_Handler,
		},
		{
			MethodName: "InstallCluster",
			Handler:    _AlertingAdmin_InstallCluster_Handler,
		},
		{
			MethodName: "UninstallCluster",
			Handler:    _AlertingAdmin_UninstallCluster_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/rancher/opni/plugins/alerting/pkg/apis/alertops/alertops.proto",
}

AlertingAdmin_ServiceDesc is the grpc.ServiceDesc for AlertingAdmin 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 ConfigReconciler_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "alerting.ops.ConfigReconciler",
	HandlerType: (*ConfigReconcilerServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ConnectRemoteSyncer",
			Handler:       _ConfigReconciler_ConnectRemoteSyncer_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "github.com/rancher/opni/plugins/alerting/pkg/apis/alertops/alertops.proto",
}

ConfigReconciler_ServiceDesc is the grpc.ServiceDesc for ConfigReconciler 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_alerting_pkg_apis_alertops_alertops_proto protoreflect.FileDescriptor

Functions

func RegisterAlertingAdminHandler

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

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

func RegisterAlertingAdminHandlerClient

func RegisterAlertingAdminHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AlertingAdminClient) error

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

func RegisterAlertingAdminHandlerFromEndpoint

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

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

func RegisterAlertingAdminHandlerServer

func RegisterAlertingAdminHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AlertingAdminServer) error

RegisterAlertingAdminHandlerServer registers the http handlers for service AlertingAdmin to "mux". UnaryRPC :call AlertingAdminServer 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 RegisterAlertingAdminHandlerFromEndpoint instead.

func RegisterAlertingAdminServer

func RegisterAlertingAdminServer(s grpc.ServiceRegistrar, srv AlertingAdminServer)

func RegisterConfigReconcilerServer added in v0.8.2

func RegisterConfigReconcilerServer(s grpc.ServiceRegistrar, srv ConfigReconcilerServer)

Types

type AlertingAdminClient

type AlertingAdminClient interface {
	GetClusterConfiguration(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ClusterConfiguration, error)
	// Install/Uninstall the alerting cluster by setting enabled=true/false
	ConfigureCluster(ctx context.Context, in *ClusterConfiguration, opts ...grpc.CallOption) (*emptypb.Empty, error)
	GetClusterStatus(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*InstallStatus, error)
	InstallCluster(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
	UninstallCluster(ctx context.Context, in *UninstallRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

AlertingAdminClient is the client API for AlertingAdmin 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 NewClient added in v0.8.2

type AlertingAdminServer

type AlertingAdminServer interface {
	GetClusterConfiguration(context.Context, *emptypb.Empty) (*ClusterConfiguration, error)
	// Install/Uninstall the alerting cluster by setting enabled=true/false
	ConfigureCluster(context.Context, *ClusterConfiguration) (*emptypb.Empty, error)
	GetClusterStatus(context.Context, *emptypb.Empty) (*InstallStatus, error)
	InstallCluster(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	UninstallCluster(context.Context, *UninstallRequest) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

AlertingAdminServer is the server API for AlertingAdmin service. All implementations must embed UnimplementedAlertingAdminServer for forward compatibility

type ClusterConfiguration

type ClusterConfiguration struct {

	// number of replicas for the opni-alerting (odd-number for HA)
	NumReplicas int32 `protobuf:"varint,2,opt,name=numReplicas,proto3" json:"numReplicas,omitempty"`
	// Maximum time to wait for cluster
	// connections to settle before
	// evaluating notifications.
	ClusterSettleTimeout string `protobuf:"bytes,3,opt,name=clusterSettleTimeout,proto3" json:"clusterSettleTimeout,omitempty"`
	// Interval for gossip state syncs.
	// Setting this interval lower
	// (more frequent) will increase
	// convergence speeds across larger
	// clusters at the expense of
	// increased bandwidth usage.
	ClusterPushPullInterval string `protobuf:"bytes,4,opt,name=clusterPushPullInterval,proto3" json:"clusterPushPullInterval,omitempty"`
	// Interval between sending gossip
	// messages. By lowering this
	// value (more frequent) gossip
	// messages are propagated across
	// the cluster more quickly at the
	// expense of increased bandwidth.
	ClusterGossipInterval string             `protobuf:"bytes,5,opt,name=clusterGossipInterval,proto3" json:"clusterGossipInterval,omitempty"`
	ResourceLimits        *ResourceLimitSpec `protobuf:"bytes,6,opt,name=resourceLimits,proto3" json:"resourceLimits,omitempty"`
	// contains filtered or unexported fields
}

func (*ClusterConfiguration) Descriptor deprecated

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

Deprecated: Use ClusterConfiguration.ProtoReflect.Descriptor instead.

func (*ClusterConfiguration) GetClusterGossipInterval

func (x *ClusterConfiguration) GetClusterGossipInterval() string

func (*ClusterConfiguration) GetClusterPushPullInterval

func (x *ClusterConfiguration) GetClusterPushPullInterval() string

func (*ClusterConfiguration) GetClusterSettleTimeout

func (x *ClusterConfiguration) GetClusterSettleTimeout() string

func (*ClusterConfiguration) GetNumReplicas

func (x *ClusterConfiguration) GetNumReplicas() int32

func (*ClusterConfiguration) GetResourceLimits

func (x *ClusterConfiguration) GetResourceLimits() *ResourceLimitSpec

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

func (*ClusterConfiguration) Validate

func (c *ClusterConfiguration) Validate() error

type ConfigReconcilerClient added in v0.8.2

type ConfigReconcilerClient interface {
	ConnectRemoteSyncer(ctx context.Context, in *ConnectRequest, opts ...grpc.CallOption) (ConfigReconciler_ConnectRemoteSyncerClient, error)
}

ConfigReconcilerClient is the client API for ConfigReconciler 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 NewConfigReconcilerClient added in v0.8.2

func NewConfigReconcilerClient(cc grpc.ClientConnInterface) ConfigReconcilerClient

type ConfigReconcilerServer added in v0.8.2

type ConfigReconcilerServer interface {
	ConnectRemoteSyncer(*ConnectRequest, ConfigReconciler_ConnectRemoteSyncerServer) error
	// contains filtered or unexported methods
}

ConfigReconcilerServer is the server API for ConfigReconciler service. All implementations must embed UnimplementedConfigReconcilerServer for forward compatibility

type ConfigReconciler_ConnectRemoteSyncerClient added in v0.8.2

type ConfigReconciler_ConnectRemoteSyncerClient interface {
	Recv() (*SyncRequest, error)
	grpc.ClientStream
}

type ConfigReconciler_ConnectRemoteSyncerServer added in v0.8.2

type ConfigReconciler_ConnectRemoteSyncerServer interface {
	Send(*SyncRequest) error
	grpc.ServerStream
}

type ConnectRequest added in v0.8.2

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

func (*ConnectRequest) Descriptor deprecated added in v0.8.2

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

Deprecated: Use ConnectRequest.ProtoReflect.Descriptor instead.

func (*ConnectRequest) GetLifecycleUuid added in v0.8.2

func (x *ConnectRequest) GetLifecycleUuid() string

func (*ConnectRequest) ProtoMessage added in v0.8.2

func (*ConnectRequest) ProtoMessage()

func (*ConnectRequest) ProtoReflect added in v0.8.2

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

func (*ConnectRequest) Reset added in v0.8.2

func (x *ConnectRequest) Reset()

func (*ConnectRequest) String added in v0.8.2

func (x *ConnectRequest) String() string

type InstallState

type InstallState int32
const (
	InstallState_InstallUnknown  InstallState = 0
	InstallState_NotInstalled    InstallState = 1
	InstallState_InstallUpdating 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=alerting.ops.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 added in v0.8.2

type OpsClientOption func(*OpsClientOptions)

func WithDialOptions added in v0.8.2

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

func WithListenAddress added in v0.8.2

func WithListenAddress(addr string) OpsClientOption

type OpsClientOptions added in v0.8.2

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

type ResourceLimitSpec

type ResourceLimitSpec struct {

	// Storage resource limit for alerting volume
	Storage string `protobuf:"bytes,1,opt,name=storage,proto3" json:"storage,omitempty"`
	// CPU resource limit per replica
	Cpu string `protobuf:"bytes,2,opt,name=cpu,proto3" json:"cpu,omitempty"`
	// Memory resource limit per replica
	Memory string `protobuf:"bytes,3,opt,name=memory,proto3" json:"memory,omitempty"`
	// contains filtered or unexported fields
}

func (*ResourceLimitSpec) Descriptor deprecated

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

Deprecated: Use ResourceLimitSpec.ProtoReflect.Descriptor instead.

func (*ResourceLimitSpec) GetCpu

func (x *ResourceLimitSpec) GetCpu() string

func (*ResourceLimitSpec) GetMemory

func (x *ResourceLimitSpec) GetMemory() string

func (*ResourceLimitSpec) GetStorage

func (x *ResourceLimitSpec) GetStorage() string

func (*ResourceLimitSpec) ProtoMessage

func (*ResourceLimitSpec) ProtoMessage()

func (*ResourceLimitSpec) ProtoReflect

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

func (*ResourceLimitSpec) Reset

func (x *ResourceLimitSpec) Reset()

func (*ResourceLimitSpec) String

func (x *ResourceLimitSpec) String() string

func (*ResourceLimitSpec) Validate

func (r *ResourceLimitSpec) Validate() error

type SyncRequest added in v0.8.2

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

func (*SyncRequest) Descriptor deprecated added in v0.8.2

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

Deprecated: Use SyncRequest.ProtoReflect.Descriptor instead.

func (*SyncRequest) GetItems added in v0.8.2

func (x *SyncRequest) GetItems() []*v1.PutConfigRequest

func (*SyncRequest) ProtoMessage added in v0.8.2

func (*SyncRequest) ProtoMessage()

func (*SyncRequest) ProtoReflect added in v0.8.2

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

func (*SyncRequest) Reset added in v0.8.2

func (x *SyncRequest) Reset()

func (*SyncRequest) String added in v0.8.2

func (x *SyncRequest) String() string

type UnimplementedAlertingAdminServer

type UnimplementedAlertingAdminServer struct {
}

UnimplementedAlertingAdminServer must be embedded to have forward compatible implementations.

func (UnimplementedAlertingAdminServer) ConfigureCluster

func (UnimplementedAlertingAdminServer) GetClusterConfiguration

func (UnimplementedAlertingAdminServer) GetClusterStatus

func (UnimplementedAlertingAdminServer) InstallCluster

func (UnimplementedAlertingAdminServer) UninstallCluster

type UnimplementedConfigReconcilerServer added in v0.8.2

type UnimplementedConfigReconcilerServer struct {
}

UnimplementedConfigReconcilerServer must be embedded to have forward compatible implementations.

func (UnimplementedConfigReconcilerServer) ConnectRemoteSyncer added in v0.8.2

type UninstallRequest added in v0.8.2

type UninstallRequest struct {
	DeleteData bool `protobuf:"varint,1,opt,name=deleteData,proto3" json:"deleteData,omitempty"`
	// contains filtered or unexported fields
}

func (*UninstallRequest) Descriptor deprecated added in v0.8.2

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

Deprecated: Use UninstallRequest.ProtoReflect.Descriptor instead.

func (*UninstallRequest) GetDeleteData added in v0.8.2

func (x *UninstallRequest) GetDeleteData() bool

func (*UninstallRequest) ProtoMessage added in v0.8.2

func (*UninstallRequest) ProtoMessage()

func (*UninstallRequest) ProtoReflect added in v0.8.2

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

func (*UninstallRequest) Reset added in v0.8.2

func (x *UninstallRequest) Reset()

func (*UninstallRequest) String added in v0.8.2

func (x *UninstallRequest) String() string

type UnsafeAlertingAdminServer

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

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

type UnsafeConfigReconcilerServer added in v0.8.2

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

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

Jump to

Keyboard shortcuts

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