alertops

package
v0.8.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package alertops 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: "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 DynamicAlerting_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "alerting.ops.DynamicAlerting",
	HandlerType: (*DynamicAlertingServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Fetch",
			Handler:    _DynamicAlerting_Fetch_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _DynamicAlerting_Update_Handler,
		},
		{
			MethodName: "Reload",
			Handler:    _DynamicAlerting_Reload_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/rancher/opni/plugins/alerting/pkg/apis/alertops/alertops.proto",
}

DynamicAlerting_ServiceDesc is the grpc.ServiceDesc for DynamicAlerting 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 RegisterDynamicAlertingHandler

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

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

func RegisterDynamicAlertingHandlerClient

func RegisterDynamicAlertingHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DynamicAlertingClient) error

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

func RegisterDynamicAlertingHandlerFromEndpoint

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

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

func RegisterDynamicAlertingHandlerServer

func RegisterDynamicAlertingHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DynamicAlertingServer) error

RegisterDynamicAlertingHandlerServer registers the http handlers for service DynamicAlerting to "mux". UnaryRPC :call DynamicAlertingServer 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 RegisterDynamicAlertingHandlerFromEndpoint instead.

func RegisterDynamicAlertingServer

func RegisterDynamicAlertingServer(s grpc.ServiceRegistrar, srv DynamicAlertingServer)

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 *emptypb.Empty, 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.

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, *emptypb.Empty) (*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 AlertingConfig

type AlertingConfig struct {
	RawAlertManagerConfig string `protobuf:"bytes,1,opt,name=rawAlertManagerConfig,proto3" json:"rawAlertManagerConfig,omitempty"`
	RawInternalRouting    string `protobuf:"bytes,2,opt,name=rawInternalRouting,proto3" json:"rawInternalRouting,omitempty"`
	// contains filtered or unexported fields
}

func (*AlertingConfig) Descriptor deprecated

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

Deprecated: Use AlertingConfig.ProtoReflect.Descriptor instead.

func (*AlertingConfig) GetRawAlertManagerConfig

func (x *AlertingConfig) GetRawAlertManagerConfig() string

func (*AlertingConfig) GetRawInternalRouting

func (x *AlertingConfig) GetRawInternalRouting() string

func (*AlertingConfig) ProtoMessage

func (*AlertingConfig) ProtoMessage()

func (*AlertingConfig) ProtoReflect

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

func (*AlertingConfig) Reset

func (x *AlertingConfig) Reset()

func (*AlertingConfig) String

func (x *AlertingConfig) String() string

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 DynamicAlertingClient

type DynamicAlertingClient interface {
	Fetch(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*AlertingConfig, error)
	Update(ctx context.Context, in *AlertingConfig, opts ...grpc.CallOption) (*emptypb.Empty, error)
	Reload(ctx context.Context, in *ReloadInfo, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

DynamicAlertingClient is the client API for DynamicAlerting 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.

type DynamicAlertingServer

type DynamicAlertingServer interface {
	Fetch(context.Context, *emptypb.Empty) (*AlertingConfig, error)
	Update(context.Context, *AlertingConfig) (*emptypb.Empty, error)
	Reload(context.Context, *ReloadInfo) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

DynamicAlertingServer is the server API for DynamicAlerting service. All implementations must embed UnimplementedDynamicAlertingServer for forward compatibility

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 ReloadInfo

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

func (*ReloadInfo) Descriptor deprecated

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

Deprecated: Use ReloadInfo.ProtoReflect.Descriptor instead.

func (*ReloadInfo) GetUpdatedConfig

func (x *ReloadInfo) GetUpdatedConfig() string

func (*ReloadInfo) ProtoMessage

func (*ReloadInfo) ProtoMessage()

func (*ReloadInfo) ProtoReflect

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

func (*ReloadInfo) Reset

func (x *ReloadInfo) Reset()

func (*ReloadInfo) String

func (x *ReloadInfo) String() string

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 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 UnimplementedDynamicAlertingServer

type UnimplementedDynamicAlertingServer struct {
}

UnimplementedDynamicAlertingServer must be embedded to have forward compatible implementations.

func (UnimplementedDynamicAlertingServer) Fetch

func (UnimplementedDynamicAlertingServer) Reload

func (UnimplementedDynamicAlertingServer) Update

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 UnsafeDynamicAlertingServer

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

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

Jump to

Keyboard shortcuts

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