Documentation ¶
Overview ¶
Package node is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func DefaultConfigMetadata() metadata.MD
- func IsDefaultConfig(trailer metadata.MD) bool
- func RegisterNodeConfigurationHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterNodeConfigurationHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NodeConfigurationClient) error
- func RegisterNodeConfigurationHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterNodeConfigurationHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NodeConfigurationServer) error
- func RegisterNodeConfigurationServer(s grpc.ServiceRegistrar, srv NodeConfigurationServer)
- func RegisterNodeMetricsCapabilityServer(s grpc.ServiceRegistrar, srv NodeMetricsCapabilityServer)
- type ConfigStatus
- func (ConfigStatus) Descriptor() protoreflect.EnumDescriptor
- func (x ConfigStatus) Enum() *ConfigStatus
- func (ConfigStatus) EnumDescriptor() ([]byte, []int)deprecated
- func (x ConfigStatus) Number() protoreflect.EnumNumber
- func (x ConfigStatus) String() string
- func (ConfigStatus) Type() protoreflect.EnumType
- type MetricsCapabilityConfig
- func (*MetricsCapabilityConfig) Descriptor() ([]byte, []int)deprecated
- func (x *MetricsCapabilityConfig) GetConditions() []string
- func (x *MetricsCapabilityConfig) GetEnabled() bool
- func (x *MetricsCapabilityConfig) GetSpec() *MetricsCapabilitySpec
- func (*MetricsCapabilityConfig) ProtoMessage()
- func (x *MetricsCapabilityConfig) ProtoReflect() protoreflect.Message
- func (x *MetricsCapabilityConfig) Reset()
- func (x *MetricsCapabilityConfig) String() string
- type MetricsCapabilitySpec
- func (*MetricsCapabilitySpec) Descriptor() ([]byte, []int)deprecated
- func (x *MetricsCapabilitySpec) GetPrometheus() *PrometheusSpec
- func (x *MetricsCapabilitySpec) GetRules() *v1beta1.RulesSpec
- func (*MetricsCapabilitySpec) ProtoMessage()
- func (x *MetricsCapabilitySpec) ProtoReflect() protoreflect.Message
- func (x *MetricsCapabilitySpec) Reset()
- func (x *MetricsCapabilitySpec) String() string
- type NodeConfigRequest
- func (*NodeConfigRequest) Descriptor() ([]byte, []int)deprecated
- func (x *NodeConfigRequest) GetNode() *v1.Reference
- func (x *NodeConfigRequest) GetSpec() *MetricsCapabilitySpec
- func (*NodeConfigRequest) ProtoMessage()
- func (x *NodeConfigRequest) ProtoReflect() protoreflect.Message
- func (x *NodeConfigRequest) Reset()
- func (x *NodeConfigRequest) String() string
- type NodeConfigurationClient
- type NodeConfigurationServer
- type NodeMetricsCapabilityClient
- type NodeMetricsCapabilityServer
- type PrometheusSpec
- func (*PrometheusSpec) Descriptor() ([]byte, []int)deprecated
- func (x *PrometheusSpec) GetDeploymentStrategy() string
- func (x *PrometheusSpec) GetImage() string
- func (*PrometheusSpec) ProtoMessage()
- func (x *PrometheusSpec) ProtoReflect() protoreflect.Message
- func (x *PrometheusSpec) Reset()
- func (x *PrometheusSpec) String() string
- type SyncRequest
- func (*SyncRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SyncRequest) GetCurrentConfig() *MetricsCapabilityConfig
- func (*SyncRequest) ProtoMessage()
- func (x *SyncRequest) ProtoReflect() protoreflect.Message
- func (x *SyncRequest) Reset()
- func (x *SyncRequest) String() string
- func (s *SyncRequest) Validate() error
- type SyncResponse
- func (*SyncResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SyncResponse) GetConfigStatus() ConfigStatus
- func (x *SyncResponse) GetUpdatedConfig() *MetricsCapabilityConfig
- func (*SyncResponse) ProtoMessage()
- func (x *SyncResponse) ProtoReflect() protoreflect.Message
- func (x *SyncResponse) Reset()
- func (x *SyncResponse) String() string
- type UnimplementedNodeConfigurationServer
- func (UnimplementedNodeConfigurationServer) GetDefaultConfiguration(context.Context, *emptypb.Empty) (*MetricsCapabilitySpec, error)
- func (UnimplementedNodeConfigurationServer) GetNodeConfiguration(context.Context, *v1.Reference) (*MetricsCapabilitySpec, error)
- func (UnimplementedNodeConfigurationServer) SetDefaultConfiguration(context.Context, *MetricsCapabilitySpec) (*emptypb.Empty, error)
- func (UnimplementedNodeConfigurationServer) SetNodeConfiguration(context.Context, *NodeConfigRequest) (*emptypb.Empty, error)
- type UnimplementedNodeMetricsCapabilityServer
- type UnsafeNodeConfigurationServer
- type UnsafeNodeMetricsCapabilityServer
Constants ¶
const ( NodeConfiguration_GetDefaultConfiguration_FullMethodName = "/node.metrics.NodeConfiguration/GetDefaultConfiguration" NodeConfiguration_SetDefaultConfiguration_FullMethodName = "/node.metrics.NodeConfiguration/SetDefaultConfiguration" NodeConfiguration_GetNodeConfiguration_FullMethodName = "/node.metrics.NodeConfiguration/GetNodeConfiguration" NodeConfiguration_SetNodeConfiguration_FullMethodName = "/node.metrics.NodeConfiguration/SetNodeConfiguration" )
const (
NodeMetricsCapability_Sync_FullMethodName = "/node.metrics.NodeMetricsCapability/Sync"
)
Variables ¶
var ( ConfigStatus_name = map[int32]string{ 0: "Unknown", 1: "UpToDate", 2: "NeedsUpdate", } ConfigStatus_value = map[string]int32{ "Unknown": 0, "UpToDate": 1, "NeedsUpdate": 2, } )
Enum value maps for ConfigStatus.
var File_github_com_rancher_opni_plugins_metrics_pkg_apis_node_node_proto protoreflect.FileDescriptor
var NodeConfiguration_ServiceDesc = grpc.ServiceDesc{ ServiceName: "node.metrics.NodeConfiguration", HandlerType: (*NodeConfigurationServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetDefaultConfiguration", Handler: _NodeConfiguration_GetDefaultConfiguration_Handler, }, { MethodName: "SetDefaultConfiguration", Handler: _NodeConfiguration_SetDefaultConfiguration_Handler, }, { MethodName: "GetNodeConfiguration", Handler: _NodeConfiguration_GetNodeConfiguration_Handler, }, { MethodName: "SetNodeConfiguration", Handler: _NodeConfiguration_SetNodeConfiguration_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "github.com/rancher/opni/plugins/metrics/pkg/apis/node/node.proto", }
NodeConfiguration_ServiceDesc is the grpc.ServiceDesc for NodeConfiguration service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var NodeMetricsCapability_ServiceDesc = grpc.ServiceDesc{ ServiceName: "node.metrics.NodeMetricsCapability", HandlerType: (*NodeMetricsCapabilityServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Sync", Handler: _NodeMetricsCapability_Sync_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "github.com/rancher/opni/plugins/metrics/pkg/apis/node/node.proto", }
NodeMetricsCapability_ServiceDesc is the grpc.ServiceDesc for NodeMetricsCapability service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func DefaultConfigMetadata ¶ added in v0.9.2
func IsDefaultConfig ¶ added in v0.9.2
func RegisterNodeConfigurationHandler ¶ added in v0.9.2
func RegisterNodeConfigurationHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterNodeConfigurationHandler registers the http handlers for service NodeConfiguration to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterNodeConfigurationHandlerClient ¶ added in v0.9.2
func RegisterNodeConfigurationHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NodeConfigurationClient) error
RegisterNodeConfigurationHandlerClient registers the http handlers for service NodeConfiguration to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NodeConfigurationClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NodeConfigurationClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "NodeConfigurationClient" to call the correct interceptors.
func RegisterNodeConfigurationHandlerFromEndpoint ¶ added in v0.9.2
func RegisterNodeConfigurationHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterNodeConfigurationHandlerFromEndpoint is same as RegisterNodeConfigurationHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterNodeConfigurationHandlerServer ¶ added in v0.9.2
func RegisterNodeConfigurationHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NodeConfigurationServer) error
RegisterNodeConfigurationHandlerServer registers the http handlers for service NodeConfiguration to "mux". UnaryRPC :call NodeConfigurationServer 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 RegisterNodeConfigurationHandlerFromEndpoint instead.
func RegisterNodeConfigurationServer ¶ added in v0.9.2
func RegisterNodeConfigurationServer(s grpc.ServiceRegistrar, srv NodeConfigurationServer)
func RegisterNodeMetricsCapabilityServer ¶
func RegisterNodeMetricsCapabilityServer(s grpc.ServiceRegistrar, srv NodeMetricsCapabilityServer)
Types ¶
type ConfigStatus ¶
type ConfigStatus int32
const ( ConfigStatus_Unknown ConfigStatus = 0 ConfigStatus_UpToDate ConfigStatus = 1 ConfigStatus_NeedsUpdate ConfigStatus = 2 )
func (ConfigStatus) Descriptor ¶
func (ConfigStatus) Descriptor() protoreflect.EnumDescriptor
func (ConfigStatus) Enum ¶
func (x ConfigStatus) Enum() *ConfigStatus
func (ConfigStatus) EnumDescriptor
deprecated
func (ConfigStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use ConfigStatus.Descriptor instead.
func (ConfigStatus) Number ¶
func (x ConfigStatus) Number() protoreflect.EnumNumber
func (ConfigStatus) String ¶
func (x ConfigStatus) String() string
func (ConfigStatus) Type ¶
func (ConfigStatus) Type() protoreflect.EnumType
type MetricsCapabilityConfig ¶
type MetricsCapabilityConfig struct { Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` // If enabled is false, conditions may contain a list of relevant status // messages describing why the capability is disabled. Conditions []string `protobuf:"bytes,2,rep,name=conditions,proto3" json:"conditions,omitempty"` Spec *MetricsCapabilitySpec `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` // contains filtered or unexported fields }
func (*MetricsCapabilityConfig) Descriptor
deprecated
func (*MetricsCapabilityConfig) Descriptor() ([]byte, []int)
Deprecated: Use MetricsCapabilityConfig.ProtoReflect.Descriptor instead.
func (*MetricsCapabilityConfig) GetConditions ¶
func (x *MetricsCapabilityConfig) GetConditions() []string
func (*MetricsCapabilityConfig) GetEnabled ¶
func (x *MetricsCapabilityConfig) GetEnabled() bool
func (*MetricsCapabilityConfig) GetSpec ¶
func (x *MetricsCapabilityConfig) GetSpec() *MetricsCapabilitySpec
func (*MetricsCapabilityConfig) ProtoMessage ¶
func (*MetricsCapabilityConfig) ProtoMessage()
func (*MetricsCapabilityConfig) ProtoReflect ¶
func (x *MetricsCapabilityConfig) ProtoReflect() protoreflect.Message
func (*MetricsCapabilityConfig) Reset ¶
func (x *MetricsCapabilityConfig) Reset()
func (*MetricsCapabilityConfig) String ¶
func (x *MetricsCapabilityConfig) String() string
type MetricsCapabilitySpec ¶
type MetricsCapabilitySpec struct { Rules *v1beta1.RulesSpec `protobuf:"bytes,1,opt,name=rules,proto3" json:"rules,omitempty"` Prometheus *PrometheusSpec `protobuf:"bytes,2,opt,name=prometheus,proto3" json:"prometheus,omitempty"` // TODO: add config options for metrics capability here // contains filtered or unexported fields }
func (*MetricsCapabilitySpec) Descriptor
deprecated
func (*MetricsCapabilitySpec) Descriptor() ([]byte, []int)
Deprecated: Use MetricsCapabilitySpec.ProtoReflect.Descriptor instead.
func (*MetricsCapabilitySpec) GetPrometheus ¶
func (x *MetricsCapabilitySpec) GetPrometheus() *PrometheusSpec
func (*MetricsCapabilitySpec) GetRules ¶
func (x *MetricsCapabilitySpec) GetRules() *v1beta1.RulesSpec
func (*MetricsCapabilitySpec) ProtoMessage ¶
func (*MetricsCapabilitySpec) ProtoMessage()
func (*MetricsCapabilitySpec) ProtoReflect ¶
func (x *MetricsCapabilitySpec) ProtoReflect() protoreflect.Message
func (*MetricsCapabilitySpec) Reset ¶
func (x *MetricsCapabilitySpec) Reset()
func (*MetricsCapabilitySpec) String ¶
func (x *MetricsCapabilitySpec) String() string
type NodeConfigRequest ¶ added in v0.9.2
type NodeConfigRequest struct { Node *v1.Reference `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` // Can be set to nil to use the default configuration for this node. Spec *MetricsCapabilitySpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"` // contains filtered or unexported fields }
func (*NodeConfigRequest) Descriptor
deprecated
added in
v0.9.2
func (*NodeConfigRequest) Descriptor() ([]byte, []int)
Deprecated: Use NodeConfigRequest.ProtoReflect.Descriptor instead.
func (*NodeConfigRequest) GetNode ¶ added in v0.9.2
func (x *NodeConfigRequest) GetNode() *v1.Reference
func (*NodeConfigRequest) GetSpec ¶ added in v0.9.2
func (x *NodeConfigRequest) GetSpec() *MetricsCapabilitySpec
func (*NodeConfigRequest) ProtoMessage ¶ added in v0.9.2
func (*NodeConfigRequest) ProtoMessage()
func (*NodeConfigRequest) ProtoReflect ¶ added in v0.9.2
func (x *NodeConfigRequest) ProtoReflect() protoreflect.Message
func (*NodeConfigRequest) Reset ¶ added in v0.9.2
func (x *NodeConfigRequest) Reset()
func (*NodeConfigRequest) String ¶ added in v0.9.2
func (x *NodeConfigRequest) String() string
type NodeConfigurationClient ¶ added in v0.9.2
type NodeConfigurationClient interface { GetDefaultConfiguration(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*MetricsCapabilitySpec, error) SetDefaultConfiguration(ctx context.Context, in *MetricsCapabilitySpec, opts ...grpc.CallOption) (*emptypb.Empty, error) GetNodeConfiguration(ctx context.Context, in *v1.Reference, opts ...grpc.CallOption) (*MetricsCapabilitySpec, error) SetNodeConfiguration(ctx context.Context, in *NodeConfigRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) }
NodeConfigurationClient is the client API for NodeConfiguration 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 NewNodeConfigurationClient ¶ added in v0.9.2
func NewNodeConfigurationClient(cc grpc.ClientConnInterface) NodeConfigurationClient
type NodeConfigurationServer ¶ added in v0.9.2
type NodeConfigurationServer interface { GetDefaultConfiguration(context.Context, *emptypb.Empty) (*MetricsCapabilitySpec, error) SetDefaultConfiguration(context.Context, *MetricsCapabilitySpec) (*emptypb.Empty, error) GetNodeConfiguration(context.Context, *v1.Reference) (*MetricsCapabilitySpec, error) SetNodeConfiguration(context.Context, *NodeConfigRequest) (*emptypb.Empty, error) // contains filtered or unexported methods }
NodeConfigurationServer is the server API for NodeConfiguration service. All implementations must embed UnimplementedNodeConfigurationServer for forward compatibility
type NodeMetricsCapabilityClient ¶
type NodeMetricsCapabilityClient interface {
Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error)
}
NodeMetricsCapabilityClient is the client API for NodeMetricsCapability 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 NewNodeMetricsCapabilityClient ¶
func NewNodeMetricsCapabilityClient(cc grpc.ClientConnInterface) NodeMetricsCapabilityClient
type NodeMetricsCapabilityServer ¶
type NodeMetricsCapabilityServer interface { Sync(context.Context, *SyncRequest) (*SyncResponse, error) // contains filtered or unexported methods }
NodeMetricsCapabilityServer is the server API for NodeMetricsCapability service. All implementations must embed UnimplementedNodeMetricsCapabilityServer for forward compatibility
type PrometheusSpec ¶
type PrometheusSpec struct { // default: quay.io/prometheus/prometheus:latest Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` // can be one of: ["externalPromOperator"] DeploymentStrategy string `protobuf:"bytes,2,opt,name=deploymentStrategy,proto3" json:"deploymentStrategy,omitempty"` // contains filtered or unexported fields }
func (*PrometheusSpec) Descriptor
deprecated
func (*PrometheusSpec) Descriptor() ([]byte, []int)
Deprecated: Use PrometheusSpec.ProtoReflect.Descriptor instead.
func (*PrometheusSpec) GetDeploymentStrategy ¶
func (x *PrometheusSpec) GetDeploymentStrategy() string
func (*PrometheusSpec) GetImage ¶
func (x *PrometheusSpec) GetImage() string
func (*PrometheusSpec) ProtoMessage ¶
func (*PrometheusSpec) ProtoMessage()
func (*PrometheusSpec) ProtoReflect ¶
func (x *PrometheusSpec) ProtoReflect() protoreflect.Message
func (*PrometheusSpec) Reset ¶
func (x *PrometheusSpec) Reset()
func (*PrometheusSpec) String ¶
func (x *PrometheusSpec) String() string
type SyncRequest ¶
type SyncRequest struct { CurrentConfig *MetricsCapabilityConfig `protobuf:"bytes,1,opt,name=currentConfig,proto3" json:"currentConfig,omitempty"` // contains filtered or unexported fields }
func (*SyncRequest) Descriptor
deprecated
func (*SyncRequest) Descriptor() ([]byte, []int)
Deprecated: Use SyncRequest.ProtoReflect.Descriptor instead.
func (*SyncRequest) GetCurrentConfig ¶
func (x *SyncRequest) GetCurrentConfig() *MetricsCapabilityConfig
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 ¶
func (s *SyncRequest) Validate() error
type SyncResponse ¶
type SyncResponse struct { ConfigStatus ConfigStatus `protobuf:"varint,1,opt,name=configStatus,proto3,enum=node.metrics.ConfigStatus" json:"configStatus,omitempty"` UpdatedConfig *MetricsCapabilityConfig `protobuf:"bytes,2,opt,name=updatedConfig,proto3" json:"updatedConfig,omitempty"` // contains filtered or unexported fields }
func (*SyncResponse) Descriptor
deprecated
func (*SyncResponse) Descriptor() ([]byte, []int)
Deprecated: Use SyncResponse.ProtoReflect.Descriptor instead.
func (*SyncResponse) GetConfigStatus ¶
func (x *SyncResponse) GetConfigStatus() ConfigStatus
func (*SyncResponse) GetUpdatedConfig ¶
func (x *SyncResponse) GetUpdatedConfig() *MetricsCapabilityConfig
func (*SyncResponse) ProtoMessage ¶
func (*SyncResponse) ProtoMessage()
func (*SyncResponse) ProtoReflect ¶
func (x *SyncResponse) ProtoReflect() protoreflect.Message
func (*SyncResponse) Reset ¶
func (x *SyncResponse) Reset()
func (*SyncResponse) String ¶
func (x *SyncResponse) String() string
type UnimplementedNodeConfigurationServer ¶ added in v0.9.2
type UnimplementedNodeConfigurationServer struct { }
UnimplementedNodeConfigurationServer must be embedded to have forward compatible implementations.
func (UnimplementedNodeConfigurationServer) GetDefaultConfiguration ¶ added in v0.9.2
func (UnimplementedNodeConfigurationServer) GetDefaultConfiguration(context.Context, *emptypb.Empty) (*MetricsCapabilitySpec, error)
func (UnimplementedNodeConfigurationServer) GetNodeConfiguration ¶ added in v0.9.2
func (UnimplementedNodeConfigurationServer) GetNodeConfiguration(context.Context, *v1.Reference) (*MetricsCapabilitySpec, error)
func (UnimplementedNodeConfigurationServer) SetDefaultConfiguration ¶ added in v0.9.2
func (UnimplementedNodeConfigurationServer) SetDefaultConfiguration(context.Context, *MetricsCapabilitySpec) (*emptypb.Empty, error)
func (UnimplementedNodeConfigurationServer) SetNodeConfiguration ¶ added in v0.9.2
func (UnimplementedNodeConfigurationServer) SetNodeConfiguration(context.Context, *NodeConfigRequest) (*emptypb.Empty, error)
type UnimplementedNodeMetricsCapabilityServer ¶
type UnimplementedNodeMetricsCapabilityServer struct { }
UnimplementedNodeMetricsCapabilityServer must be embedded to have forward compatible implementations.
func (UnimplementedNodeMetricsCapabilityServer) Sync ¶
func (UnimplementedNodeMetricsCapabilityServer) Sync(context.Context, *SyncRequest) (*SyncResponse, error)
type UnsafeNodeConfigurationServer ¶ added in v0.9.2
type UnsafeNodeConfigurationServer interface {
// contains filtered or unexported methods
}
UnsafeNodeConfigurationServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NodeConfigurationServer will result in compilation errors.
type UnsafeNodeMetricsCapabilityServer ¶
type UnsafeNodeMetricsCapabilityServer interface {
// contains filtered or unexported methods
}
UnsafeNodeMetricsCapabilityServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NodeMetricsCapabilityServer will result in compilation errors.