Skip to content

API Definition

CMGS edited this page Jul 30, 2019 · 10 revisions

Core GRPC API definition

Table of Contents

Top

rpc/gen/core.proto

AddNodeOptions

Field Type Label Description
nodename string
endpoint string
podname string
ca string
cert string
key string
cpu int32
share int32
memory int64
labels AddNodeOptions.LabelsEntry repeated
numa AddNodeOptions.NumaEntry repeated
numa_memory AddNodeOptions.NumaMemoryEntry repeated
storage int64

AddNodeOptions.LabelsEntry

Field Type Label Description
key string
value string

AddNodeOptions.NumaEntry

Field Type Label Description
key string
value string

AddNodeOptions.NumaMemoryEntry

Field Type Label Description
key string
value int64

AddPodOptions

Field Type Label Description
name string
desc string

Build

Field Type Label Description
base string
repo string
version string
dir string
submodule bool
commands string repeated
envs Build.EnvsEntry repeated
args Build.ArgsEntry repeated
labels Build.LabelsEntry repeated
artifacts Build.ArtifactsEntry repeated
cache Build.CacheEntry repeated
stop_signal string

Build.ArgsEntry

Field Type Label Description
key string
value string

Build.ArtifactsEntry

Field Type Label Description
key string
value string

Build.CacheEntry

Field Type Label Description
key string
value string

Build.EnvsEntry

Field Type Label Description
key string
value string

Build.LabelsEntry

Field Type Label Description
key string
value string

BuildImageMessage

Field Type Label Description
id string
status string
progress string
error string
stream string
error_detail ErrorDetail

BuildImageOptions

Field Type Label Description
name string
user string
uid int32
tags string repeated
builds Builds
tar bytes

Builds

Field Type Label Description
stages string repeated
builds Builds.BuildsEntry repeated

Builds.BuildsEntry

Field Type Label Description
key string
value Build

CacheImageMessage

Field Type Label Description
image string
success bool
nodename string
message string

CacheImageOptions

Field Type Label Description
podname string
nodename string
images string repeated
step int32

Container

Field Type Label Description
id string
podname string
nodename string
name string
cpu Container.CpuEntry repeated
quota double
memory int64
privileged bool
labels Container.LabelsEntry repeated
publish Container.PublishEntry repeated
image string
storage int64
status_data bytes

Container.CpuEntry

Field Type Label Description
key string
value int32

Container.LabelsEntry

Field Type Label Description
key string
value string

Container.PublishEntry

Field Type Label Description
key string
value string

ContainerDeployedOptions

Field Type Label Description
id string
appname string
entrypoint string
nodename string
data bytes
ttl int64

ContainerID

Field Type Label Description
id string

ContainerIDs

Field Type Label Description
ids string repeated

Containers

Field Type Label Description
containers Container repeated

ControlContainerMessage

Field Type Label Description
id string
error string
hook bytes

ControlContainerOptions

Field Type Label Description
ids string repeated
type string
force bool

CopyMessage

Field Type Label Description
id string
status string
name string
path string
error string
data bytes

CopyOptions

Field Type Label Description
targets CopyOptions.TargetsEntry repeated

CopyOptions.TargetsEntry

Field Type Label Description
key string
value CopyPaths

CopyPaths

Field Type Label Description
paths string repeated

CreateContainerMessage

Field Type Label Description
podname string
nodename string
id string
name string
error string
success bool
cpu CreateContainerMessage.CpuEntry repeated
quota double
memory int64
publish CreateContainerMessage.PublishEntry repeated
hook bytes
storage int64

CreateContainerMessage.CpuEntry

Field Type Label Description
key string
value int32

CreateContainerMessage.PublishEntry

Field Type Label Description
key string
value string

DeployOptions

Field Type Label Description
name string
entrypoint EntrypointOptions
podname string
nodename string
image string
extra_args string
cpu_quota double
memory int64
count int32
env string repeated
dns string repeated
extra_hosts string repeated
volumes string repeated
networks DeployOptions.NetworksEntry repeated
networkmode string
user string
debug bool
openStdin bool
labels DeployOptions.LabelsEntry repeated
nodelabels DeployOptions.NodelabelsEntry repeated
deploy_method string
data DeployOptions.DataEntry repeated
soft_limit bool
nodes_limit int32
cpu_bind bool
ignore_hook bool
after_create string repeated

DeployOptions.DataEntry

Field Type Label Description
key string
value bytes

DeployOptions.LabelsEntry

Field Type Label Description
key string
value string

DeployOptions.NetworksEntry

Field Type Label Description
key string
value string

DeployOptions.NodelabelsEntry

Field Type Label Description
key string
value string

DeployStatusMessage

Field Type Label Description
action string
appname string
entrypoint string
nodename string
id string
data bytes

DeployStatusOptions

Field Type Label Description
appname string
entrypoint string
nodename string

DissociateContainerMessage

Field Type Label Description
id string
error string

DissociateContainerOptions

Field Type Label Description
ids string repeated

Empty

EntrypointOptions

Field Type Label Description
name string
command string
privileged bool
dir string
log LogOptions
publish string repeated
healthcheck HealthCheckOptions
hook HookOptions
restart_policy string
sysctls EntrypointOptions.SysctlsEntry repeated

EntrypointOptions.SysctlsEntry

Field Type Label Description
key string
value string

ErrorDetail

Field Type Label Description
code int64
message string

ExecuteContainerMessage

Field Type Label Description
container_id string
data bytes

ExecuteContainerOptions

Field Type Label Description
container_id string
commands string repeated
envs string repeated
workdir string
open_stdin bool
repl_cmd bytes

GetNodeOptions

Field Type Label Description
podname string
nodename string

GetPodOptions

Field Type Label Description
name string

HealthCheckOptions

Field Type Label Description
tcp_ports string repeated
http_port string
url string
code int32

HookOptions

Field Type Label Description
after_start string repeated
before_stop string repeated
force bool

ListContainersOptions

Field Type Label Description
appname string
entrypoint string
nodename string
labels ListContainersOptions.LabelsEntry repeated
limit int64

ListContainersOptions.LabelsEntry

Field Type Label Description
key string
value string

ListNetworkOptions

Field Type Label Description
podname string
driver string

ListNodesOptions

Field Type Label Description
podname string
all bool

LogOptions

Field Type Label Description
type string
config LogOptions.ConfigEntry repeated

LogOptions.ConfigEntry

Field Type Label Description
key string
value string

LogStreamMessage

Field Type Label Description
id string
error string
data bytes

Network

Field Type Label Description
name string
subnets string repeated

Networks

Field Type Label Description
networks Network repeated

Node

Field Type Label Description
name string
endpoint string
podname string
cpu Node.CpuEntry repeated
cpu_used double
memory int64
memory_used int64
available bool
labels Node.LabelsEntry repeated
init_memory int64
init_cpu Node.InitCpuEntry repeated
info string
numa Node.NumaEntry repeated
numa_memory Node.NumaMemoryEntry repeated
storage int64
storage_used int64
init_storage int64

Node.CpuEntry

Field Type Label Description
key string
value int32

Node.InitCpuEntry

Field Type Label Description
key string
value int32

Node.LabelsEntry

Field Type Label Description
key string
value string

Node.NumaEntry

Field Type Label Description
key string
value string

Node.NumaMemoryEntry

Field Type Label Description
key string
value int64

NodeAvailable

Field Type Label Description
nodename string
podname string

NodeResource

Field Type Label Description
name string
cpu_percent double
memory_percent double
verification bool
details string repeated
storage_percent double

Nodes

Field Type Label Description
nodes Node repeated

Pod

对的, protobuf 就是这样...

Field Type Label Description
name string
desc string

PodResource

Field Type Label Description
name string
cpu_percents PodResource.CpuPercentsEntry repeated
memory_percents PodResource.MemoryPercentsEntry repeated
verifications PodResource.VerificationsEntry repeated
details PodResource.DetailsEntry repeated
storage_percents PodResource.StoragePercentsEntry repeated

PodResource.CpuPercentsEntry

Field Type Label Description
key string
value double

PodResource.DetailsEntry

Field Type Label Description
key string
value string

PodResource.MemoryPercentsEntry

Field Type Label Description
key string
value double

PodResource.StoragePercentsEntry

Field Type Label Description
key string
value double

PodResource.VerificationsEntry

Field Type Label Description
key string
value bool

Pods

Field Type Label Description
pods Pod repeated

ReallocOptions

Field Type Label Description
ids string repeated
cpu double
memory int64

ReallocResourceMessage

Field Type Label Description
id string
success bool

RemoveContainerMessage

Field Type Label Description
id string
success bool
hook string

RemoveContainerOptions

Field Type Label Description
ids string repeated
force bool
step int32

RemoveImageMessage

Field Type Label Description
image string
success bool
messages string repeated

RemoveImageOptions

Field Type Label Description
podname string
nodename string
images string repeated
step int32
prune bool

RemoveNodeOptions

Field Type Label Description
nodename string
podname string

RemovePodOptions

Field Type Label Description
name string

ReplaceContainerMessage

Field Type Label Description
create CreateContainerMessage
remove RemoveContainerMessage
error string

ReplaceOptions

Field Type Label Description
deployOpt DeployOptions
networkinherit bool
filter_labels ReplaceOptions.FilterLabelsEntry repeated
copy ReplaceOptions.CopyEntry repeated
ids string repeated

ReplaceOptions.CopyEntry

Field Type Label Description
key string
value string

ReplaceOptions.FilterLabelsEntry

Field Type Label Description
key string
value string

RunAndWaitMessage

Field Type Label Description
container_id string
data bytes

RunAndWaitOptions

Field Type Label Description
DeployOptions DeployOptions
Cmd bytes

SendMessage

Field Type Label Description
id string
path string
error string

SendOptions

Field Type Label Description
ids string repeated
data SendOptions.DataEntry repeated

SendOptions.DataEntry

Field Type Label Description
key string
value bytes

SetNodeOptions

Field Type Label Description
nodename string
podname string
status int32
delta_cpu SetNodeOptions.DeltaCpuEntry repeated
delta_memory int64
delta_storage int64
delta_numa_memory SetNodeOptions.DeltaNumaMemoryEntry repeated
numa SetNodeOptions.NumaEntry repeated
labels SetNodeOptions.LabelsEntry repeated

SetNodeOptions.DeltaCpuEntry

Field Type Label Description
key string
value int32

SetNodeOptions.DeltaNumaMemoryEntry

Field Type Label Description
key string
value int64

SetNodeOptions.LabelsEntry

Field Type Label Description
key string
value string

SetNodeOptions.NumaEntry

Field Type Label Description
key string
value string

CoreRPC

Method Name Request Type Response Type Description
ListPods Empty Pods
AddPod AddPodOptions Pod
RemovePod RemovePodOptions Empty
GetPod GetPodOptions Pod
GetPodResource GetPodOptions PodResource
AddNode AddNodeOptions Node
RemoveNode RemoveNodeOptions Empty
SetNode SetNodeOptions Node
GetNode GetNodeOptions Node
GetNodeResource GetNodeOptions NodeResource
GetContainer ContainerID Container
GetContainers ContainerIDs Containers
GetNodeByName GetNodeOptions Node
ListPodNodes ListNodesOptions Nodes
ListNetworks ListNetworkOptions Networks
ListNodeContainers GetNodeOptions Containers
ListContainers ListContainersOptions Container stream
ContainerDeployed ContainerDeployedOptions Empty
Copy CopyOptions CopyMessage stream
Send SendOptions SendMessage stream
BuildImage BuildImageOptions BuildImageMessage stream
CacheImage CacheImageOptions CacheImageMessage stream
RemoveImage RemoveImageOptions RemoveImageMessage stream
DeployStatus DeployStatusOptions DeployStatusMessage stream
RunAndWait RunAndWaitOptions stream RunAndWaitMessage stream
CreateContainer DeployOptions CreateContainerMessage stream
ReplaceContainer ReplaceOptions ReplaceContainerMessage stream
RemoveContainer RemoveContainerOptions RemoveContainerMessage stream
DissociateContainer DissociateContainerOptions DissociateContainerMessage stream
ControlContainer ControlContainerOptions ControlContainerMessage stream
ExecuteContainer ExecuteContainerOptions ExecuteContainerMessage stream
ReallocResource ReallocOptions ReallocResourceMessage stream
LogStream ContainerID LogStreamMessage stream

Scalar Value Types

.proto Type Notes C++ Type Java Type Python Type
double double double float
float float float float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long
uint32 Uses variable-length encoding. uint32 int int/long
uint64 Uses variable-length encoding. uint64 long int/long
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long
sfixed32 Always four bytes. int32 int int
sfixed64 Always eight bytes. int64 long int/long
bool bool boolean boolean
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode
bytes May contain any arbitrary sequence of bytes. string ByteString str
Clone this wiki locally