mirror of
https://github.com/siderolabs/talos.git
synced 2025-08-20 06:01:13 +02:00
This enables the ability to specify additional <talos> endpoints to connect to to pull back data. Signed-off-by: Brad Beam <brad.beam@talos-systems.com>
1803 lines
56 KiB
Go
1803 lines
56 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: api.proto
|
|
|
|
package osapi
|
|
|
|
import (
|
|
context "context"
|
|
fmt "fmt"
|
|
math "math"
|
|
strings "strings"
|
|
sync "sync"
|
|
|
|
proto "github.com/golang/protobuf/proto"
|
|
empty "github.com/golang/protobuf/ptypes/empty"
|
|
go_multierror "github.com/hashicorp/go-multierror"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
credentials "google.golang.org/grpc/credentials"
|
|
metadata "google.golang.org/grpc/metadata"
|
|
status "google.golang.org/grpc/status"
|
|
|
|
tls "github.com/talos-systems/talos/pkg/grpc/tls"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
|
// The request message containing the containerd namespace.
|
|
type ContainerDriver int32
|
|
|
|
const (
|
|
ContainerDriver_CONTAINERD ContainerDriver = 0
|
|
ContainerDriver_CRI ContainerDriver = 1
|
|
)
|
|
|
|
var ContainerDriver_name = map[int32]string{
|
|
0: "CONTAINERD",
|
|
1: "CRI",
|
|
}
|
|
|
|
var ContainerDriver_value = map[string]int32{
|
|
"CONTAINERD": 0,
|
|
"CRI": 1,
|
|
}
|
|
|
|
func (x ContainerDriver) String() string {
|
|
return proto.EnumName(ContainerDriver_name, int32(x))
|
|
}
|
|
|
|
func (ContainerDriver) EnumDescriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{0}
|
|
}
|
|
|
|
// Common metadata message nested in all reply message types
|
|
type NodeMetadata struct {
|
|
Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *NodeMetadata) Reset() { *m = NodeMetadata{} }
|
|
func (m *NodeMetadata) String() string { return proto.CompactTextString(m) }
|
|
func (*NodeMetadata) ProtoMessage() {}
|
|
func (*NodeMetadata) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{0}
|
|
}
|
|
|
|
func (m *NodeMetadata) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_NodeMetadata.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *NodeMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_NodeMetadata.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *NodeMetadata) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_NodeMetadata.Merge(m, src)
|
|
}
|
|
|
|
func (m *NodeMetadata) XXX_Size() int {
|
|
return xxx_messageInfo_NodeMetadata.Size(m)
|
|
}
|
|
|
|
func (m *NodeMetadata) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_NodeMetadata.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_NodeMetadata proto.InternalMessageInfo
|
|
|
|
func (m *NodeMetadata) GetHostname() string {
|
|
if m != nil {
|
|
return m.Hostname
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type ContainersRequest struct {
|
|
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
|
|
// driver might be default "containerd" or "cri"
|
|
Driver ContainerDriver `protobuf:"varint,2,opt,name=driver,proto3,enum=proto.ContainerDriver" json:"driver,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *ContainersRequest) Reset() { *m = ContainersRequest{} }
|
|
func (m *ContainersRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*ContainersRequest) ProtoMessage() {}
|
|
func (*ContainersRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{1}
|
|
}
|
|
|
|
func (m *ContainersRequest) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_ContainersRequest.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *ContainersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_ContainersRequest.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *ContainersRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_ContainersRequest.Merge(m, src)
|
|
}
|
|
|
|
func (m *ContainersRequest) XXX_Size() int {
|
|
return xxx_messageInfo_ContainersRequest.Size(m)
|
|
}
|
|
|
|
func (m *ContainersRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_ContainersRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_ContainersRequest proto.InternalMessageInfo
|
|
|
|
func (m *ContainersRequest) GetNamespace() string {
|
|
if m != nil {
|
|
return m.Namespace
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *ContainersRequest) GetDriver() ContainerDriver {
|
|
if m != nil {
|
|
return m.Driver
|
|
}
|
|
return ContainerDriver_CONTAINERD
|
|
}
|
|
|
|
// The response message containing the requested containers.
|
|
type Container struct {
|
|
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
|
|
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
|
|
Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"`
|
|
Pid uint32 `protobuf:"varint,4,opt,name=pid,proto3" json:"pid,omitempty"`
|
|
Status string `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"`
|
|
PodId string `protobuf:"bytes,6,opt,name=pod_id,json=podId,proto3" json:"pod_id,omitempty"`
|
|
Name string `protobuf:"bytes,7,opt,name=name,proto3" json:"name,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Container) Reset() { *m = Container{} }
|
|
func (m *Container) String() string { return proto.CompactTextString(m) }
|
|
func (*Container) ProtoMessage() {}
|
|
func (*Container) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{2}
|
|
}
|
|
|
|
func (m *Container) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_Container.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *Container) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_Container.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *Container) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Container.Merge(m, src)
|
|
}
|
|
|
|
func (m *Container) XXX_Size() int {
|
|
return xxx_messageInfo_Container.Size(m)
|
|
}
|
|
|
|
func (m *Container) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Container.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Container proto.InternalMessageInfo
|
|
|
|
func (m *Container) GetNamespace() string {
|
|
if m != nil {
|
|
return m.Namespace
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Container) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Container) GetImage() string {
|
|
if m != nil {
|
|
return m.Image
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Container) GetPid() uint32 {
|
|
if m != nil {
|
|
return m.Pid
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *Container) GetStatus() string {
|
|
if m != nil {
|
|
return m.Status
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Container) GetPodId() string {
|
|
if m != nil {
|
|
return m.PodId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Container) GetName() string {
|
|
if m != nil {
|
|
return m.Name
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// The response message containing the requested containers.
|
|
type ContainerResponse struct {
|
|
Metadata *NodeMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
|
|
Containers []*Container `protobuf:"bytes,2,rep,name=containers,proto3" json:"containers,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *ContainerResponse) Reset() { *m = ContainerResponse{} }
|
|
func (m *ContainerResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*ContainerResponse) ProtoMessage() {}
|
|
func (*ContainerResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{3}
|
|
}
|
|
|
|
func (m *ContainerResponse) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_ContainerResponse.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *ContainerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_ContainerResponse.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *ContainerResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_ContainerResponse.Merge(m, src)
|
|
}
|
|
|
|
func (m *ContainerResponse) XXX_Size() int {
|
|
return xxx_messageInfo_ContainerResponse.Size(m)
|
|
}
|
|
|
|
func (m *ContainerResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_ContainerResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_ContainerResponse proto.InternalMessageInfo
|
|
|
|
func (m *ContainerResponse) GetMetadata() *NodeMetadata {
|
|
if m != nil {
|
|
return m.Metadata
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *ContainerResponse) GetContainers() []*Container {
|
|
if m != nil {
|
|
return m.Containers
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type ContainersReply struct {
|
|
Response []*ContainerResponse `protobuf:"bytes,1,rep,name=response,proto3" json:"response,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *ContainersReply) Reset() { *m = ContainersReply{} }
|
|
func (m *ContainersReply) String() string { return proto.CompactTextString(m) }
|
|
func (*ContainersReply) ProtoMessage() {}
|
|
func (*ContainersReply) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{4}
|
|
}
|
|
|
|
func (m *ContainersReply) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_ContainersReply.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *ContainersReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_ContainersReply.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *ContainersReply) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_ContainersReply.Merge(m, src)
|
|
}
|
|
|
|
func (m *ContainersReply) XXX_Size() int {
|
|
return xxx_messageInfo_ContainersReply.Size(m)
|
|
}
|
|
|
|
func (m *ContainersReply) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_ContainersReply.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_ContainersReply proto.InternalMessageInfo
|
|
|
|
func (m *ContainersReply) GetResponse() []*ContainerResponse {
|
|
if m != nil {
|
|
return m.Response
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// The response message containing the requested logs.
|
|
type Data struct {
|
|
Bytes []byte `protobuf:"bytes,1,opt,name=bytes,proto3" json:"bytes,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Data) Reset() { *m = Data{} }
|
|
func (m *Data) String() string { return proto.CompactTextString(m) }
|
|
func (*Data) ProtoMessage() {}
|
|
func (*Data) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{5}
|
|
}
|
|
|
|
func (m *Data) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_Data.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_Data.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *Data) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Data.Merge(m, src)
|
|
}
|
|
|
|
func (m *Data) XXX_Size() int {
|
|
return xxx_messageInfo_Data.Size(m)
|
|
}
|
|
|
|
func (m *Data) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Data.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Data proto.InternalMessageInfo
|
|
|
|
func (m *Data) GetBytes() []byte {
|
|
if m != nil {
|
|
return m.Bytes
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type DataResponse struct {
|
|
Metadata *NodeMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
|
|
Bytes *Data `protobuf:"bytes,2,opt,name=bytes,proto3" json:"bytes,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *DataResponse) Reset() { *m = DataResponse{} }
|
|
func (m *DataResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*DataResponse) ProtoMessage() {}
|
|
func (*DataResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{6}
|
|
}
|
|
|
|
func (m *DataResponse) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_DataResponse.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *DataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_DataResponse.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *DataResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_DataResponse.Merge(m, src)
|
|
}
|
|
|
|
func (m *DataResponse) XXX_Size() int {
|
|
return xxx_messageInfo_DataResponse.Size(m)
|
|
}
|
|
|
|
func (m *DataResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_DataResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_DataResponse proto.InternalMessageInfo
|
|
|
|
func (m *DataResponse) GetMetadata() *NodeMetadata {
|
|
if m != nil {
|
|
return m.Metadata
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *DataResponse) GetBytes() *Data {
|
|
if m != nil {
|
|
return m.Bytes
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type DataReply struct {
|
|
Response []*DataResponse `protobuf:"bytes,1,rep,name=response,proto3" json:"response,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *DataReply) Reset() { *m = DataReply{} }
|
|
func (m *DataReply) String() string { return proto.CompactTextString(m) }
|
|
func (*DataReply) ProtoMessage() {}
|
|
func (*DataReply) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{7}
|
|
}
|
|
|
|
func (m *DataReply) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_DataReply.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *DataReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_DataReply.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *DataReply) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_DataReply.Merge(m, src)
|
|
}
|
|
|
|
func (m *DataReply) XXX_Size() int {
|
|
return xxx_messageInfo_DataReply.Size(m)
|
|
}
|
|
|
|
func (m *DataReply) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_DataReply.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_DataReply proto.InternalMessageInfo
|
|
|
|
func (m *DataReply) GetResponse() []*DataResponse {
|
|
if m != nil {
|
|
return m.Response
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// The request message containing the process name.
|
|
type LogsRequest struct {
|
|
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
|
|
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
|
|
// driver might be default "containerd" or "cri"
|
|
Driver ContainerDriver `protobuf:"varint,3,opt,name=driver,proto3,enum=proto.ContainerDriver" json:"driver,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *LogsRequest) Reset() { *m = LogsRequest{} }
|
|
func (m *LogsRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*LogsRequest) ProtoMessage() {}
|
|
func (*LogsRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{8}
|
|
}
|
|
|
|
func (m *LogsRequest) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_LogsRequest.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *LogsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_LogsRequest.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *LogsRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_LogsRequest.Merge(m, src)
|
|
}
|
|
|
|
func (m *LogsRequest) XXX_Size() int {
|
|
return xxx_messageInfo_LogsRequest.Size(m)
|
|
}
|
|
|
|
func (m *LogsRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_LogsRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_LogsRequest proto.InternalMessageInfo
|
|
|
|
func (m *LogsRequest) GetNamespace() string {
|
|
if m != nil {
|
|
return m.Namespace
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *LogsRequest) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *LogsRequest) GetDriver() ContainerDriver {
|
|
if m != nil {
|
|
return m.Driver
|
|
}
|
|
return ContainerDriver_CONTAINERD
|
|
}
|
|
|
|
// rpc processes
|
|
type ProcessesRequest struct {
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *ProcessesRequest) Reset() { *m = ProcessesRequest{} }
|
|
func (m *ProcessesRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*ProcessesRequest) ProtoMessage() {}
|
|
func (*ProcessesRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{9}
|
|
}
|
|
|
|
func (m *ProcessesRequest) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_ProcessesRequest.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *ProcessesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_ProcessesRequest.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *ProcessesRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_ProcessesRequest.Merge(m, src)
|
|
}
|
|
|
|
func (m *ProcessesRequest) XXX_Size() int {
|
|
return xxx_messageInfo_ProcessesRequest.Size(m)
|
|
}
|
|
|
|
func (m *ProcessesRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_ProcessesRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_ProcessesRequest proto.InternalMessageInfo
|
|
|
|
type ProcessesReply struct {
|
|
Response []*ProcessResponse `protobuf:"bytes,1,rep,name=response,proto3" json:"response,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *ProcessesReply) Reset() { *m = ProcessesReply{} }
|
|
func (m *ProcessesReply) String() string { return proto.CompactTextString(m) }
|
|
func (*ProcessesReply) ProtoMessage() {}
|
|
func (*ProcessesReply) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{10}
|
|
}
|
|
|
|
func (m *ProcessesReply) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_ProcessesReply.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *ProcessesReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_ProcessesReply.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *ProcessesReply) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_ProcessesReply.Merge(m, src)
|
|
}
|
|
|
|
func (m *ProcessesReply) XXX_Size() int {
|
|
return xxx_messageInfo_ProcessesReply.Size(m)
|
|
}
|
|
|
|
func (m *ProcessesReply) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_ProcessesReply.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_ProcessesReply proto.InternalMessageInfo
|
|
|
|
func (m *ProcessesReply) GetResponse() []*ProcessResponse {
|
|
if m != nil {
|
|
return m.Response
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type ProcessResponse struct {
|
|
Metadata *NodeMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
|
|
Processes []*Process `protobuf:"bytes,2,rep,name=processes,proto3" json:"processes,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *ProcessResponse) Reset() { *m = ProcessResponse{} }
|
|
func (m *ProcessResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*ProcessResponse) ProtoMessage() {}
|
|
func (*ProcessResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{11}
|
|
}
|
|
|
|
func (m *ProcessResponse) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_ProcessResponse.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *ProcessResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_ProcessResponse.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *ProcessResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_ProcessResponse.Merge(m, src)
|
|
}
|
|
|
|
func (m *ProcessResponse) XXX_Size() int {
|
|
return xxx_messageInfo_ProcessResponse.Size(m)
|
|
}
|
|
|
|
func (m *ProcessResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_ProcessResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_ProcessResponse proto.InternalMessageInfo
|
|
|
|
func (m *ProcessResponse) GetMetadata() *NodeMetadata {
|
|
if m != nil {
|
|
return m.Metadata
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *ProcessResponse) GetProcesses() []*Process {
|
|
if m != nil {
|
|
return m.Processes
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type Process struct {
|
|
Pid int32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"`
|
|
Ppid int32 `protobuf:"varint,2,opt,name=ppid,proto3" json:"ppid,omitempty"`
|
|
State string `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"`
|
|
Threads int32 `protobuf:"varint,4,opt,name=threads,proto3" json:"threads,omitempty"`
|
|
CpuTime float64 `protobuf:"fixed64,5,opt,name=cpu_time,json=cpuTime,proto3" json:"cpu_time,omitempty"`
|
|
VirtualMemory uint64 `protobuf:"varint,6,opt,name=virtual_memory,json=virtualMemory,proto3" json:"virtual_memory,omitempty"`
|
|
ResidentMemory uint64 `protobuf:"varint,7,opt,name=resident_memory,json=residentMemory,proto3" json:"resident_memory,omitempty"`
|
|
Command string `protobuf:"bytes,8,opt,name=command,proto3" json:"command,omitempty"`
|
|
Executable string `protobuf:"bytes,9,opt,name=executable,proto3" json:"executable,omitempty"`
|
|
Args string `protobuf:"bytes,10,opt,name=args,proto3" json:"args,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Process) Reset() { *m = Process{} }
|
|
func (m *Process) String() string { return proto.CompactTextString(m) }
|
|
func (*Process) ProtoMessage() {}
|
|
func (*Process) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{12}
|
|
}
|
|
|
|
func (m *Process) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_Process.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *Process) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_Process.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *Process) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Process.Merge(m, src)
|
|
}
|
|
|
|
func (m *Process) XXX_Size() int {
|
|
return xxx_messageInfo_Process.Size(m)
|
|
}
|
|
|
|
func (m *Process) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Process.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Process proto.InternalMessageInfo
|
|
|
|
func (m *Process) GetPid() int32 {
|
|
if m != nil {
|
|
return m.Pid
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *Process) GetPpid() int32 {
|
|
if m != nil {
|
|
return m.Ppid
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *Process) GetState() string {
|
|
if m != nil {
|
|
return m.State
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Process) GetThreads() int32 {
|
|
if m != nil {
|
|
return m.Threads
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *Process) GetCpuTime() float64 {
|
|
if m != nil {
|
|
return m.CpuTime
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *Process) GetVirtualMemory() uint64 {
|
|
if m != nil {
|
|
return m.VirtualMemory
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *Process) GetResidentMemory() uint64 {
|
|
if m != nil {
|
|
return m.ResidentMemory
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *Process) GetCommand() string {
|
|
if m != nil {
|
|
return m.Command
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Process) GetExecutable() string {
|
|
if m != nil {
|
|
return m.Executable
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Process) GetArgs() string {
|
|
if m != nil {
|
|
return m.Args
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// rpc restart
|
|
// The request message containing the process to restart.
|
|
type RestartRequest struct {
|
|
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
|
|
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
|
|
// driver might be default "containerd" or "cri"
|
|
Driver ContainerDriver `protobuf:"varint,3,opt,name=driver,proto3,enum=proto.ContainerDriver" json:"driver,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *RestartRequest) Reset() { *m = RestartRequest{} }
|
|
func (m *RestartRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*RestartRequest) ProtoMessage() {}
|
|
func (*RestartRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{13}
|
|
}
|
|
|
|
func (m *RestartRequest) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_RestartRequest.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *RestartRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_RestartRequest.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *RestartRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_RestartRequest.Merge(m, src)
|
|
}
|
|
|
|
func (m *RestartRequest) XXX_Size() int {
|
|
return xxx_messageInfo_RestartRequest.Size(m)
|
|
}
|
|
|
|
func (m *RestartRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_RestartRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_RestartRequest proto.InternalMessageInfo
|
|
|
|
func (m *RestartRequest) GetNamespace() string {
|
|
if m != nil {
|
|
return m.Namespace
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *RestartRequest) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *RestartRequest) GetDriver() ContainerDriver {
|
|
if m != nil {
|
|
return m.Driver
|
|
}
|
|
return ContainerDriver_CONTAINERD
|
|
}
|
|
|
|
type RestartResponse struct {
|
|
Metadata *NodeMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *RestartResponse) Reset() { *m = RestartResponse{} }
|
|
func (m *RestartResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*RestartResponse) ProtoMessage() {}
|
|
func (*RestartResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{14}
|
|
}
|
|
|
|
func (m *RestartResponse) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_RestartResponse.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *RestartResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_RestartResponse.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *RestartResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_RestartResponse.Merge(m, src)
|
|
}
|
|
|
|
func (m *RestartResponse) XXX_Size() int {
|
|
return xxx_messageInfo_RestartResponse.Size(m)
|
|
}
|
|
|
|
func (m *RestartResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_RestartResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_RestartResponse proto.InternalMessageInfo
|
|
|
|
func (m *RestartResponse) GetMetadata() *NodeMetadata {
|
|
if m != nil {
|
|
return m.Metadata
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// The response message containing the restart status.
|
|
type RestartReply struct {
|
|
Response []*RestartResponse `protobuf:"bytes,1,rep,name=response,proto3" json:"response,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *RestartReply) Reset() { *m = RestartReply{} }
|
|
func (m *RestartReply) String() string { return proto.CompactTextString(m) }
|
|
func (*RestartReply) ProtoMessage() {}
|
|
func (*RestartReply) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{15}
|
|
}
|
|
|
|
func (m *RestartReply) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_RestartReply.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *RestartReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_RestartReply.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *RestartReply) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_RestartReply.Merge(m, src)
|
|
}
|
|
|
|
func (m *RestartReply) XXX_Size() int {
|
|
return xxx_messageInfo_RestartReply.Size(m)
|
|
}
|
|
|
|
func (m *RestartReply) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_RestartReply.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_RestartReply proto.InternalMessageInfo
|
|
|
|
func (m *RestartReply) GetResponse() []*RestartResponse {
|
|
if m != nil {
|
|
return m.Response
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// The request message containing the containerd namespace.
|
|
type StatsRequest struct {
|
|
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
|
|
// driver might be default "containerd" or "cri"
|
|
Driver ContainerDriver `protobuf:"varint,2,opt,name=driver,proto3,enum=proto.ContainerDriver" json:"driver,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *StatsRequest) Reset() { *m = StatsRequest{} }
|
|
func (m *StatsRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*StatsRequest) ProtoMessage() {}
|
|
func (*StatsRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{16}
|
|
}
|
|
|
|
func (m *StatsRequest) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_StatsRequest.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *StatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_StatsRequest.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *StatsRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_StatsRequest.Merge(m, src)
|
|
}
|
|
|
|
func (m *StatsRequest) XXX_Size() int {
|
|
return xxx_messageInfo_StatsRequest.Size(m)
|
|
}
|
|
|
|
func (m *StatsRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_StatsRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_StatsRequest proto.InternalMessageInfo
|
|
|
|
func (m *StatsRequest) GetNamespace() string {
|
|
if m != nil {
|
|
return m.Namespace
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *StatsRequest) GetDriver() ContainerDriver {
|
|
if m != nil {
|
|
return m.Driver
|
|
}
|
|
return ContainerDriver_CONTAINERD
|
|
}
|
|
|
|
// The response message containing the requested stats.
|
|
type StatsResponse struct {
|
|
Metadata *NodeMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
|
|
Stats []*Stat `protobuf:"bytes,2,rep,name=stats,proto3" json:"stats,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *StatsResponse) Reset() { *m = StatsResponse{} }
|
|
func (m *StatsResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*StatsResponse) ProtoMessage() {}
|
|
func (*StatsResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{17}
|
|
}
|
|
|
|
func (m *StatsResponse) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_StatsResponse.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *StatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_StatsResponse.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *StatsResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_StatsResponse.Merge(m, src)
|
|
}
|
|
|
|
func (m *StatsResponse) XXX_Size() int {
|
|
return xxx_messageInfo_StatsResponse.Size(m)
|
|
}
|
|
|
|
func (m *StatsResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_StatsResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_StatsResponse proto.InternalMessageInfo
|
|
|
|
func (m *StatsResponse) GetMetadata() *NodeMetadata {
|
|
if m != nil {
|
|
return m.Metadata
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *StatsResponse) GetStats() []*Stat {
|
|
if m != nil {
|
|
return m.Stats
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type StatsReply struct {
|
|
Response []*StatsResponse `protobuf:"bytes,1,rep,name=response,proto3" json:"response,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *StatsReply) Reset() { *m = StatsReply{} }
|
|
func (m *StatsReply) String() string { return proto.CompactTextString(m) }
|
|
func (*StatsReply) ProtoMessage() {}
|
|
func (*StatsReply) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{18}
|
|
}
|
|
|
|
func (m *StatsReply) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_StatsReply.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *StatsReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_StatsReply.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *StatsReply) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_StatsReply.Merge(m, src)
|
|
}
|
|
|
|
func (m *StatsReply) XXX_Size() int {
|
|
return xxx_messageInfo_StatsReply.Size(m)
|
|
}
|
|
|
|
func (m *StatsReply) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_StatsReply.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_StatsReply proto.InternalMessageInfo
|
|
|
|
func (m *StatsReply) GetResponse() []*StatsResponse {
|
|
if m != nil {
|
|
return m.Response
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// The response message containing the requested stat.
|
|
type Stat struct {
|
|
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
|
|
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
|
|
MemoryUsage uint64 `protobuf:"varint,4,opt,name=memory_usage,json=memoryUsage,proto3" json:"memory_usage,omitempty"`
|
|
CpuUsage uint64 `protobuf:"varint,5,opt,name=cpu_usage,json=cpuUsage,proto3" json:"cpu_usage,omitempty"`
|
|
PodId string `protobuf:"bytes,6,opt,name=pod_id,json=podId,proto3" json:"pod_id,omitempty"`
|
|
Name string `protobuf:"bytes,7,opt,name=name,proto3" json:"name,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Stat) Reset() { *m = Stat{} }
|
|
func (m *Stat) String() string { return proto.CompactTextString(m) }
|
|
func (*Stat) ProtoMessage() {}
|
|
func (*Stat) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_00212fb1f9d3bf1c, []int{19}
|
|
}
|
|
|
|
func (m *Stat) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_Stat.Unmarshal(m, b)
|
|
}
|
|
|
|
func (m *Stat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_Stat.Marshal(b, m, deterministic)
|
|
}
|
|
|
|
func (m *Stat) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Stat.Merge(m, src)
|
|
}
|
|
|
|
func (m *Stat) XXX_Size() int {
|
|
return xxx_messageInfo_Stat.Size(m)
|
|
}
|
|
|
|
func (m *Stat) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Stat.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Stat proto.InternalMessageInfo
|
|
|
|
func (m *Stat) GetNamespace() string {
|
|
if m != nil {
|
|
return m.Namespace
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Stat) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Stat) GetMemoryUsage() uint64 {
|
|
if m != nil {
|
|
return m.MemoryUsage
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *Stat) GetCpuUsage() uint64 {
|
|
if m != nil {
|
|
return m.CpuUsage
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (m *Stat) GetPodId() string {
|
|
if m != nil {
|
|
return m.PodId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *Stat) GetName() string {
|
|
if m != nil {
|
|
return m.Name
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterEnum("proto.ContainerDriver", ContainerDriver_name, ContainerDriver_value)
|
|
proto.RegisterType((*NodeMetadata)(nil), "proto.NodeMetadata")
|
|
proto.RegisterType((*ContainersRequest)(nil), "proto.ContainersRequest")
|
|
proto.RegisterType((*Container)(nil), "proto.Container")
|
|
proto.RegisterType((*ContainerResponse)(nil), "proto.ContainerResponse")
|
|
proto.RegisterType((*ContainersReply)(nil), "proto.ContainersReply")
|
|
proto.RegisterType((*Data)(nil), "proto.Data")
|
|
proto.RegisterType((*DataResponse)(nil), "proto.DataResponse")
|
|
proto.RegisterType((*DataReply)(nil), "proto.DataReply")
|
|
proto.RegisterType((*LogsRequest)(nil), "proto.LogsRequest")
|
|
proto.RegisterType((*ProcessesRequest)(nil), "proto.ProcessesRequest")
|
|
proto.RegisterType((*ProcessesReply)(nil), "proto.ProcessesReply")
|
|
proto.RegisterType((*ProcessResponse)(nil), "proto.ProcessResponse")
|
|
proto.RegisterType((*Process)(nil), "proto.Process")
|
|
proto.RegisterType((*RestartRequest)(nil), "proto.RestartRequest")
|
|
proto.RegisterType((*RestartResponse)(nil), "proto.RestartResponse")
|
|
proto.RegisterType((*RestartReply)(nil), "proto.RestartReply")
|
|
proto.RegisterType((*StatsRequest)(nil), "proto.StatsRequest")
|
|
proto.RegisterType((*StatsResponse)(nil), "proto.StatsResponse")
|
|
proto.RegisterType((*StatsReply)(nil), "proto.StatsReply")
|
|
proto.RegisterType((*Stat)(nil), "proto.Stat")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) }
|
|
|
|
var fileDescriptor_00212fb1f9d3bf1c = []byte{
|
|
// 886 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xdd, 0x6f, 0xe3, 0x44,
|
|
0x10, 0xc7, 0x49, 0x9c, 0xc4, 0x93, 0x34, 0xcd, 0x6d, 0x3f, 0x64, 0x72, 0x15, 0xea, 0x59, 0x42,
|
|
0x94, 0x0a, 0xa5, 0x25, 0x7c, 0x3c, 0x20, 0x74, 0xd2, 0xb5, 0x39, 0xa1, 0x0a, 0xae, 0x3d, 0xed,
|
|
0x1d, 0x2f, 0x08, 0xa9, 0xda, 0xd8, 0x7b, 0xb9, 0x15, 0xb1, 0x77, 0xf1, 0xae, 0x2b, 0xf2, 0x9f,
|
|
0xf0, 0xc6, 0x0b, 0x7f, 0x27, 0x42, 0xfb, 0x61, 0xd7, 0x49, 0x0a, 0xb4, 0x87, 0xe0, 0xc9, 0x3b,
|
|
0x33, 0xbf, 0x9d, 0xd9, 0x99, 0xfd, 0xcd, 0xac, 0x21, 0x20, 0x82, 0x8d, 0x45, 0xce, 0x15, 0x47,
|
|
0xbe, 0xf9, 0x8c, 0x1e, 0xcf, 0x39, 0x9f, 0x2f, 0xe8, 0x89, 0x91, 0x66, 0xc5, 0x9b, 0x13, 0x9a,
|
|
0x0a, 0xb5, 0xb4, 0x98, 0xe8, 0x18, 0xfa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 0x0d, 0xb6, 0xb3, 0xae, 0xb6, 0xaf, 0x93, 0x6f,
|
|
0x88, 0x83, 0x76, 0x56, 0x69, 0x64, 0xb7, 0x3c, 0x5a, 0x55, 0x8a, 0xc5, 0xf2, 0xec, 0x40, 0x3f,
|
|
0xec, 0xe9, 0x98, 0xcb, 0x31, 0x11, 0xec, 0xcc, 0xbf, 0x92, 0xcf, 0x04, 0x7b, 0xe9, 0xfd, 0xe0,
|
|
0x73, 0x49, 0x04, 0x9b, 0xb5, 0x0d, 0xfe, 0xb3, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x04, 0x9c,
|
|
0xcc, 0xe8, 0xaa, 0x09, 0x00, 0x00,
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConn
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc.SupportPackageIsVersion4
|
|
|
|
// OSClient is the client API for OS service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type OSClient interface {
|
|
Containers(ctx context.Context, in *ContainersRequest, opts ...grpc.CallOption) (*ContainersReply, error)
|
|
Dmesg(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*DataReply, error)
|
|
Kubeconfig(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*DataReply, error)
|
|
Logs(ctx context.Context, in *LogsRequest, opts ...grpc.CallOption) (OS_LogsClient, error)
|
|
Processes(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ProcessesReply, error)
|
|
Restart(ctx context.Context, in *RestartRequest, opts ...grpc.CallOption) (*RestartReply, error)
|
|
Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsReply, error)
|
|
}
|
|
|
|
type oSClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewOSClient(cc *grpc.ClientConn) OSClient {
|
|
return &oSClient{cc}
|
|
}
|
|
|
|
func (c *oSClient) Containers(ctx context.Context, in *ContainersRequest, opts ...grpc.CallOption) (*ContainersReply, error) {
|
|
out := new(ContainersReply)
|
|
err := c.cc.Invoke(ctx, "/proto.OS/Containers", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *oSClient) Dmesg(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*DataReply, error) {
|
|
out := new(DataReply)
|
|
err := c.cc.Invoke(ctx, "/proto.OS/Dmesg", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *oSClient) Kubeconfig(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*DataReply, error) {
|
|
out := new(DataReply)
|
|
err := c.cc.Invoke(ctx, "/proto.OS/Kubeconfig", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *oSClient) Logs(ctx context.Context, in *LogsRequest, opts ...grpc.CallOption) (OS_LogsClient, error) {
|
|
stream, err := c.cc.NewStream(ctx, &_OS_serviceDesc.Streams[0], "/proto.OS/Logs", opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
x := &oSLogsClient{stream}
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
|
return nil, err
|
|
}
|
|
return x, nil
|
|
}
|
|
|
|
type OS_LogsClient interface {
|
|
Recv() (*Data, error)
|
|
grpc.ClientStream
|
|
}
|
|
|
|
type oSLogsClient struct {
|
|
grpc.ClientStream
|
|
}
|
|
|
|
func (x *oSLogsClient) Recv() (*Data, error) {
|
|
m := new(Data)
|
|
if err := x.ClientStream.RecvMsg(m); err != nil {
|
|
return nil, err
|
|
}
|
|
return m, nil
|
|
}
|
|
|
|
func (c *oSClient) Processes(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ProcessesReply, error) {
|
|
out := new(ProcessesReply)
|
|
err := c.cc.Invoke(ctx, "/proto.OS/Processes", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *oSClient) Restart(ctx context.Context, in *RestartRequest, opts ...grpc.CallOption) (*RestartReply, error) {
|
|
out := new(RestartReply)
|
|
err := c.cc.Invoke(ctx, "/proto.OS/Restart", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *oSClient) Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsReply, error) {
|
|
out := new(StatsReply)
|
|
err := c.cc.Invoke(ctx, "/proto.OS/Stats", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// OSServer is the server API for OS service.
|
|
type OSServer interface {
|
|
Containers(context.Context, *ContainersRequest) (*ContainersReply, error)
|
|
Dmesg(context.Context, *empty.Empty) (*DataReply, error)
|
|
Kubeconfig(context.Context, *empty.Empty) (*DataReply, error)
|
|
Logs(*LogsRequest, OS_LogsServer) error
|
|
Processes(context.Context, *empty.Empty) (*ProcessesReply, error)
|
|
Restart(context.Context, *RestartRequest) (*RestartReply, error)
|
|
Stats(context.Context, *StatsRequest) (*StatsReply, error)
|
|
}
|
|
|
|
// UnimplementedOSServer can be embedded to have forward compatible implementations.
|
|
type UnimplementedOSServer struct {
|
|
}
|
|
|
|
func (*UnimplementedOSServer) Containers(ctx context.Context, req *ContainersRequest) (*ContainersReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Containers not implemented")
|
|
}
|
|
|
|
func (*UnimplementedOSServer) Dmesg(ctx context.Context, req *empty.Empty) (*DataReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Dmesg not implemented")
|
|
}
|
|
|
|
func (*UnimplementedOSServer) Kubeconfig(ctx context.Context, req *empty.Empty) (*DataReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Kubeconfig not implemented")
|
|
}
|
|
|
|
func (*UnimplementedOSServer) Logs(req *LogsRequest, srv OS_LogsServer) error {
|
|
return status.Errorf(codes.Unimplemented, "method Logs not implemented")
|
|
}
|
|
|
|
func (*UnimplementedOSServer) Processes(ctx context.Context, req *empty.Empty) (*ProcessesReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Processes not implemented")
|
|
}
|
|
|
|
func (*UnimplementedOSServer) Restart(ctx context.Context, req *RestartRequest) (*RestartReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Restart not implemented")
|
|
}
|
|
|
|
func (*UnimplementedOSServer) Stats(ctx context.Context, req *StatsRequest) (*StatsReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Stats not implemented")
|
|
}
|
|
|
|
func RegisterOSServer(s *grpc.Server, srv OSServer) {
|
|
s.RegisterService(&_OS_serviceDesc, srv)
|
|
}
|
|
|
|
func _OS_Containers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ContainersRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OSServer).Containers(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/proto.OS/Containers",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OSServer).Containers(ctx, req.(*ContainersRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _OS_Dmesg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(empty.Empty)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OSServer).Dmesg(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/proto.OS/Dmesg",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OSServer).Dmesg(ctx, req.(*empty.Empty))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _OS_Kubeconfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(empty.Empty)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OSServer).Kubeconfig(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/proto.OS/Kubeconfig",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OSServer).Kubeconfig(ctx, req.(*empty.Empty))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _OS_Logs_Handler(srv interface{}, stream grpc.ServerStream) error {
|
|
m := new(LogsRequest)
|
|
if err := stream.RecvMsg(m); err != nil {
|
|
return err
|
|
}
|
|
return srv.(OSServer).Logs(m, &oSLogsServer{stream})
|
|
}
|
|
|
|
type OS_LogsServer interface {
|
|
Send(*Data) error
|
|
grpc.ServerStream
|
|
}
|
|
|
|
type oSLogsServer struct {
|
|
grpc.ServerStream
|
|
}
|
|
|
|
func (x *oSLogsServer) Send(m *Data) error {
|
|
return x.ServerStream.SendMsg(m)
|
|
}
|
|
|
|
func _OS_Processes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(empty.Empty)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OSServer).Processes(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/proto.OS/Processes",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OSServer).Processes(ctx, req.(*empty.Empty))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _OS_Restart_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(RestartRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OSServer).Restart(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/proto.OS/Restart",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OSServer).Restart(ctx, req.(*RestartRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _OS_Stats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(StatsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OSServer).Stats(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/proto.OS/Stats",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OSServer).Stats(ctx, req.(*StatsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _OS_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "proto.OS",
|
|
HandlerType: (*OSServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Containers",
|
|
Handler: _OS_Containers_Handler,
|
|
},
|
|
{
|
|
MethodName: "Dmesg",
|
|
Handler: _OS_Dmesg_Handler,
|
|
},
|
|
{
|
|
MethodName: "Kubeconfig",
|
|
Handler: _OS_Kubeconfig_Handler,
|
|
},
|
|
{
|
|
MethodName: "Processes",
|
|
Handler: _OS_Processes_Handler,
|
|
},
|
|
{
|
|
MethodName: "Restart",
|
|
Handler: _OS_Restart_Handler,
|
|
},
|
|
{
|
|
MethodName: "Stats",
|
|
Handler: _OS_Stats_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{
|
|
{
|
|
StreamName: "Logs",
|
|
Handler: _OS_Logs_Handler,
|
|
ServerStreams: true,
|
|
},
|
|
},
|
|
Metadata: "api.proto",
|
|
}
|
|
|
|
type runnerfn func(*proxyOSClient, interface{}, *sync.WaitGroup, chan proto.Message, chan error)
|
|
|
|
type proxyOSClient struct {
|
|
Conn OSClient
|
|
Context context.Context
|
|
Target string
|
|
DialOpts []grpc.DialOption
|
|
}
|
|
|
|
func proxyOSRunner(clients []*proxyOSClient, in interface{}, runner runnerfn) ([]proto.Message, error) {
|
|
var (
|
|
errors *go_multierror.Error
|
|
wg sync.WaitGroup
|
|
)
|
|
respCh := make(chan proto.Message, len(clients))
|
|
errCh := make(chan error, len(clients))
|
|
wg.Add(len(clients))
|
|
for _, client := range clients {
|
|
go runner(client, in, &wg, respCh, errCh)
|
|
}
|
|
wg.Wait()
|
|
close(respCh)
|
|
close(errCh)
|
|
|
|
var response []proto.Message
|
|
for resp := range respCh {
|
|
response = append(response, resp)
|
|
}
|
|
for err := range errCh {
|
|
errors = go_multierror.Append(errors, err)
|
|
}
|
|
return response, errors.ErrorOrNil()
|
|
}
|
|
|
|
type OSProxy struct {
|
|
Provider tls.CertificateProvider
|
|
}
|
|
|
|
func NewOSProxy(provider tls.CertificateProvider) *OSProxy {
|
|
return &OSProxy{Provider: provider}
|
|
}
|
|
|
|
func (p *OSProxy) UnaryInterceptor() grpc.UnaryServerInterceptor {
|
|
return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
|
|
pkg := strings.Split(info.FullMethod, "/")[1]
|
|
if pkg != "proto.OS" {
|
|
return handler(ctx, req)
|
|
}
|
|
md, _ := metadata.FromIncomingContext(ctx)
|
|
if _, ok := md["proxyfrom"]; ok {
|
|
return handler(ctx, req)
|
|
}
|
|
ca, err := p.Provider.GetCA()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
certs, err := p.Provider.GetCertificate(nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
tlsConfig, err := tls.New(
|
|
tls.WithClientAuthType(tls.Mutual),
|
|
tls.WithCACertPEM(ca),
|
|
tls.WithKeypair(*certs),
|
|
)
|
|
return p.Proxy(ctx, info.FullMethod, credentials.NewTLS(tlsConfig), req)
|
|
}
|
|
}
|
|
|
|
func (p *OSProxy) Proxy(ctx context.Context, method string, creds credentials.TransportCredentials, in interface{}, opts ...grpc.CallOption) (proto.Message, error) {
|
|
var (
|
|
err error
|
|
errors *go_multierror.Error
|
|
msgs []proto.Message
|
|
ok bool
|
|
response proto.Message
|
|
targets []string
|
|
)
|
|
md, _ := metadata.FromIncomingContext(ctx)
|
|
// default to target node specified in config or on cli
|
|
if targets, ok = md["targets"]; !ok {
|
|
targets = md[":authority"]
|
|
}
|
|
proxyMd := metadata.New(make(map[string]string))
|
|
proxyMd.Set("proxyfrom", md[":authority"]...)
|
|
|
|
clients := []*proxyOSClient{}
|
|
for _, target := range targets {
|
|
c := &proxyOSClient{
|
|
Context: metadata.NewOutgoingContext(context.Background(), proxyMd),
|
|
Target: target,
|
|
}
|
|
overrideCreds := creds
|
|
conn, err := grpc.Dial(fmt.Sprintf("%s:%d", c.Target, 50000), grpc.WithTransportCredentials(overrideCreds))
|
|
if err != nil {
|
|
errors = go_multierror.Append(errors, err)
|
|
continue
|
|
}
|
|
c.Conn = NewOSClient(conn)
|
|
clients = append(clients, c)
|
|
}
|
|
switch method {
|
|
case "/proto.OS/Containers":
|
|
resp := &ContainersReply{}
|
|
msgs, err = proxyOSRunner(clients, in, proxyContainers)
|
|
for _, msg := range msgs {
|
|
resp.Response = append(resp.Response, msg.(*ContainersReply).Response[0])
|
|
}
|
|
response = resp
|
|
case "/proto.OS/Dmesg":
|
|
resp := &DataReply{}
|
|
msgs, err = proxyOSRunner(clients, in, proxyDmesg)
|
|
for _, msg := range msgs {
|
|
resp.Response = append(resp.Response, msg.(*DataReply).Response[0])
|
|
}
|
|
response = resp
|
|
case "/proto.OS/Kubeconfig":
|
|
resp := &DataReply{}
|
|
msgs, err = proxyOSRunner(clients, in, proxyKubeconfig)
|
|
for _, msg := range msgs {
|
|
resp.Response = append(resp.Response, msg.(*DataReply).Response[0])
|
|
}
|
|
response = resp
|
|
case "/proto.OS/Processes":
|
|
resp := &ProcessesReply{}
|
|
msgs, err = proxyOSRunner(clients, in, proxyProcesses)
|
|
for _, msg := range msgs {
|
|
resp.Response = append(resp.Response, msg.(*ProcessesReply).Response[0])
|
|
}
|
|
response = resp
|
|
case "/proto.OS/Restart":
|
|
resp := &RestartReply{}
|
|
msgs, err = proxyOSRunner(clients, in, proxyRestart)
|
|
for _, msg := range msgs {
|
|
resp.Response = append(resp.Response, msg.(*RestartReply).Response[0])
|
|
}
|
|
response = resp
|
|
case "/proto.OS/Stats":
|
|
resp := &StatsReply{}
|
|
msgs, err = proxyOSRunner(clients, in, proxyStats)
|
|
for _, msg := range msgs {
|
|
resp.Response = append(resp.Response, msg.(*StatsReply).Response[0])
|
|
}
|
|
response = resp
|
|
}
|
|
|
|
if err != nil {
|
|
errors = go_multierror.Append(errors, err)
|
|
}
|
|
return response, errors.ErrorOrNil()
|
|
}
|
|
|
|
func proxyContainers(client *proxyOSClient, in interface{}, wg *sync.WaitGroup, respCh chan proto.Message, errCh chan error) {
|
|
defer wg.Done()
|
|
resp, err := client.Conn.Containers(client.Context, in.(*ContainersRequest))
|
|
if err != nil {
|
|
errCh <- err
|
|
return
|
|
}
|
|
resp.Response[0].Metadata = &NodeMetadata{Hostname: client.Target}
|
|
respCh <- resp
|
|
}
|
|
|
|
func proxyDmesg(client *proxyOSClient, in interface{}, wg *sync.WaitGroup, respCh chan proto.Message, errCh chan error) {
|
|
defer wg.Done()
|
|
resp, err := client.Conn.Dmesg(client.Context, in.(*empty.Empty))
|
|
if err != nil {
|
|
errCh <- err
|
|
return
|
|
}
|
|
resp.Response[0].Metadata = &NodeMetadata{Hostname: client.Target}
|
|
respCh <- resp
|
|
}
|
|
|
|
func proxyKubeconfig(client *proxyOSClient, in interface{}, wg *sync.WaitGroup, respCh chan proto.Message, errCh chan error) {
|
|
defer wg.Done()
|
|
resp, err := client.Conn.Kubeconfig(client.Context, in.(*empty.Empty))
|
|
if err != nil {
|
|
errCh <- err
|
|
return
|
|
}
|
|
resp.Response[0].Metadata = &NodeMetadata{Hostname: client.Target}
|
|
respCh <- resp
|
|
}
|
|
|
|
func proxyProcesses(client *proxyOSClient, in interface{}, wg *sync.WaitGroup, respCh chan proto.Message, errCh chan error) {
|
|
defer wg.Done()
|
|
resp, err := client.Conn.Processes(client.Context, in.(*empty.Empty))
|
|
if err != nil {
|
|
errCh <- err
|
|
return
|
|
}
|
|
resp.Response[0].Metadata = &NodeMetadata{Hostname: client.Target}
|
|
respCh <- resp
|
|
}
|
|
|
|
func proxyRestart(client *proxyOSClient, in interface{}, wg *sync.WaitGroup, respCh chan proto.Message, errCh chan error) {
|
|
defer wg.Done()
|
|
resp, err := client.Conn.Restart(client.Context, in.(*RestartRequest))
|
|
if err != nil {
|
|
errCh <- err
|
|
return
|
|
}
|
|
resp.Response[0].Metadata = &NodeMetadata{Hostname: client.Target}
|
|
respCh <- resp
|
|
}
|
|
|
|
func proxyStats(client *proxyOSClient, in interface{}, wg *sync.WaitGroup, respCh chan proto.Message, errCh chan error) {
|
|
defer wg.Done()
|
|
resp, err := client.Conn.Stats(client.Context, in.(*StatsRequest))
|
|
if err != nil {
|
|
errCh <- err
|
|
return
|
|
}
|
|
resp.Response[0].Metadata = &NodeMetadata{Hostname: client.Target}
|
|
respCh <- resp
|
|
}
|