From c34d016fdb6c5810ab3ae23c1240948ce9450490 Mon Sep 17 00:00:00 2001 From: Djordje Lukic Date: Fri, 5 Jun 2020 16:28:18 +0200 Subject: [PATCH 1/2] Unify protos with client interfaces * change function names in containers.proto * add streams proto --- Dockerfile | 3 +- cli/cmd/exec.go | 14 +- cli/cmd/serve.go | 4 +- go.mod | 2 +- moby/backend.go | 7 +- protos/containers/v1/containers.pb.go | 1429 +++++------------ protos/containers/v1/containers.proto | 87 +- protos/streams/v1/streams.pb.go | 480 ++++++ protos/streams/v1/streams.proto | 31 + server/proxy/containers.go | 100 +- server/proxy/logstream.go | 25 + ...streamwriter_test.go => logstream_test.go} | 12 +- server/proxy/proxy.go | 22 + server/proxy/streams.go | 118 ++ server/proxy/streams_test.go | 119 ++ 15 files changed, 1262 insertions(+), 1191 deletions(-) create mode 100644 protos/streams/v1/streams.pb.go create mode 100644 protos/streams/v1/streams.proto create mode 100644 server/proxy/logstream.go rename server/proxy/{streamwriter_test.go => logstream_test.go} (84%) create mode 100644 server/proxy/streams.go create mode 100644 server/proxy/streams_test.go diff --git a/Dockerfile b/Dockerfile index 94c98a86..fc484731 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,8 @@ ENV GO111MODULE=on RUN apk add --no-cache \ docker \ make \ - protoc + protoc \ + protobuf-dev COPY go.* . RUN go mod download diff --git a/cli/cmd/exec.go b/cli/cmd/exec.go index a0199e20..ba85d8cb 100644 --- a/cli/cmd/exec.go +++ b/cli/cmd/exec.go @@ -3,8 +3,6 @@ package cmd import ( "context" "fmt" - "io" - "os" "strings" "github.com/containerd/console" @@ -41,15 +39,9 @@ func runExec(ctx context.Context, opts execOpts, name string, command string) er return errors.Wrap(err, "cannot connect to backend") } - var ( - con console.Console - stdout io.Writer - ) - - stdout = os.Stdout + con := console.Current() if opts.Tty { - con = console.Current() if err := con.SetRaw(); err != nil { return err } @@ -58,9 +50,7 @@ func runExec(ctx context.Context, opts execOpts, name string, command string) er fmt.Println("Unable to close the console") } }() - - stdout = con } - return c.ContainerService().Exec(ctx, name, command, os.Stdin, stdout) + return c.ContainerService().Exec(ctx, name, command, con, con) } diff --git a/cli/cmd/serve.go b/cli/cmd/serve.go index 6058ac17..0ab492c6 100644 --- a/cli/cmd/serve.go +++ b/cli/cmd/serve.go @@ -9,6 +9,7 @@ import ( containersv1 "github.com/docker/api/protos/containers/v1" contextsv1 "github.com/docker/api/protos/contexts/v1" + streamsv1 "github.com/docker/api/protos/streams/v1" "github.com/docker/api/server" "github.com/docker/api/server/proxy" ) @@ -44,10 +45,11 @@ func runServe(ctx context.Context, opts serveOpts) error { // nolint errcheck defer listener.Close() - p := proxy.NewContainerAPI() + p := proxy.New() contextsService := server.NewContexts() containersv1.RegisterContainersServer(s, p) + streamsv1.RegisterStreamingServer(s, p) contextsv1.RegisterContextsServer(s, contextsService) go func() { diff --git a/go.mod b/go.mod index ccd3114e..d5e031ad 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/buger/goterm v0.0.0-20200322175922-2f3e71b85129 github.com/compose-spec/compose-go v0.0.0-20200423124427-63dcf8c22cae github.com/containerd/console v1.0.0 - github.com/containerd/containerd v1.3.4 // indirect + github.com/containerd/containerd v1.3.4 github.com/containerd/continuity v0.0.0-20200413184840-d3ef23f19fbb // indirect github.com/docker/cli v0.0.0-20200528204125-dd360c7c0de8 github.com/docker/distribution v2.7.1+incompatible // indirect diff --git a/moby/backend.go b/moby/backend.go index e73b4837..5f4a4d93 100644 --- a/moby/backend.go +++ b/moby/backend.go @@ -136,18 +136,21 @@ func (ms *mobyService) Exec(ctx context.Context, name string, command string, re cec, err := ms.apiClient.ContainerExecCreate(ctx, name, types.ExecConfig{ Cmd: []string{command}, Tty: true, - AttachStderr: true, AttachStdin: true, AttachStdout: true, + AttachStderr: true, }) if err != nil { return err } - resp, err := ms.apiClient.ContainerExecAttach(ctx, cec.ID, types.ExecStartCheck{}) + resp, err := ms.apiClient.ContainerExecAttach(ctx, cec.ID, types.ExecStartCheck{ + Tty: true, + }) if err != nil { return err } defer resp.Close() + readChannel := make(chan error, 10) writeChannel := make(chan error, 10) diff --git a/protos/containers/v1/containers.pb.go b/protos/containers/v1/containers.pb.go index ba04eea4..d938c884 100644 --- a/protos/containers/v1/containers.pb.go +++ b/protos/containers/v1/containers.pb.go @@ -253,359 +253,6 @@ func (x *Container) GetPorts() []*Port { return nil } -type CreateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Args []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"` - Env []string `protobuf:"bytes,3,rep,name=env,proto3" json:"env,omitempty"` - Tty bool `protobuf:"varint,4,opt,name=tty,proto3" json:"tty,omitempty"` - Image string `protobuf:"bytes,5,opt,name=image,proto3" json:"image,omitempty"` - Hostname string `protobuf:"bytes,6,opt,name=hostname,proto3" json:"hostname,omitempty"` - Networks []string `protobuf:"bytes,7,rep,name=networks,proto3" json:"networks,omitempty"` - Snapshotter string `protobuf:"bytes,8,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"` - Logger string `protobuf:"bytes,9,opt,name=logger,proto3" json:"logger,omitempty"` - Profile string `protobuf:"bytes,10,opt,name=profile,proto3" json:"profile,omitempty"` - RestartStatus string `protobuf:"bytes,11,opt,name=restart_status,json=restartStatus,proto3" json:"restart_status,omitempty"` - Mounts []*Mount `protobuf:"bytes,12,rep,name=mounts,proto3" json:"mounts,omitempty"` - WorkingDir string `protobuf:"bytes,13,opt,name=working_dir,json=workingDir,proto3" json:"working_dir,omitempty"` - Labels map[string]string `protobuf:"bytes,14,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *CreateRequest) Reset() { - *x = CreateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRequest) ProtoMessage() {} - -func (x *CreateRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead. -func (*CreateRequest) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{2} -} - -func (x *CreateRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *CreateRequest) GetArgs() []string { - if x != nil { - return x.Args - } - return nil -} - -func (x *CreateRequest) GetEnv() []string { - if x != nil { - return x.Env - } - return nil -} - -func (x *CreateRequest) GetTty() bool { - if x != nil { - return x.Tty - } - return false -} - -func (x *CreateRequest) GetImage() string { - if x != nil { - return x.Image - } - return "" -} - -func (x *CreateRequest) GetHostname() string { - if x != nil { - return x.Hostname - } - return "" -} - -func (x *CreateRequest) GetNetworks() []string { - if x != nil { - return x.Networks - } - return nil -} - -func (x *CreateRequest) GetSnapshotter() string { - if x != nil { - return x.Snapshotter - } - return "" -} - -func (x *CreateRequest) GetLogger() string { - if x != nil { - return x.Logger - } - return "" -} - -func (x *CreateRequest) GetProfile() string { - if x != nil { - return x.Profile - } - return "" -} - -func (x *CreateRequest) GetRestartStatus() string { - if x != nil { - return x.RestartStatus - } - return "" -} - -func (x *CreateRequest) GetMounts() []*Mount { - if x != nil { - return x.Mounts - } - return nil -} - -func (x *CreateRequest) GetWorkingDir() string { - if x != nil { - return x.WorkingDir - } - return "" -} - -func (x *CreateRequest) GetLabels() map[string]string { - if x != nil { - return x.Labels - } - return nil -} - -type Mount struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` - Destination string `protobuf:"bytes,3,opt,name=destination,proto3" json:"destination,omitempty"` - Options []string `protobuf:"bytes,4,rep,name=options,proto3" json:"options,omitempty"` -} - -func (x *Mount) Reset() { - *x = Mount{} - if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Mount) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Mount) ProtoMessage() {} - -func (x *Mount) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Mount.ProtoReflect.Descriptor instead. -func (*Mount) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{3} -} - -func (x *Mount) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *Mount) GetSource() string { - if x != nil { - return x.Source - } - return "" -} - -func (x *Mount) GetDestination() string { - if x != nil { - return x.Destination - } - return "" -} - -func (x *Mount) GetOptions() []string { - if x != nil { - return x.Options - } - return nil -} - -type CreateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *CreateResponse) Reset() { - *x = CreateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateResponse) ProtoMessage() {} - -func (x *CreateResponse) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead. -func (*CreateResponse) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{4} -} - -type UpdateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` -} - -func (x *UpdateRequest) Reset() { - *x = UpdateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateRequest) ProtoMessage() {} - -func (x *UpdateRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead. -func (*UpdateRequest) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{5} -} - -func (x *UpdateRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *UpdateRequest) GetImage() string { - if x != nil { - return x.Image - } - return "" -} - -type UpdateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateResponse) Reset() { - *x = UpdateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateResponse) ProtoMessage() {} - -func (x *UpdateResponse) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead. -func (*UpdateResponse) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{6} -} - type DeleteRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -618,7 +265,7 @@ type DeleteRequest struct { func (x *DeleteRequest) Reset() { *x = DeleteRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[7] + mi := &file_protos_containers_v1_containers_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -631,7 +278,7 @@ func (x *DeleteRequest) String() string { func (*DeleteRequest) ProtoMessage() {} func (x *DeleteRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[7] + mi := &file_protos_containers_v1_containers_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -644,7 +291,7 @@ func (x *DeleteRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead. func (*DeleteRequest) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{7} + return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{2} } func (x *DeleteRequest) GetId() string { @@ -670,7 +317,7 @@ type DeleteResponse struct { func (x *DeleteResponse) Reset() { *x = DeleteResponse{} if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[8] + mi := &file_protos_containers_v1_containers_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -683,7 +330,7 @@ func (x *DeleteResponse) String() string { func (*DeleteResponse) ProtoMessage() {} func (x *DeleteResponse) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[8] + mi := &file_protos_containers_v1_containers_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -696,100 +343,7 @@ func (x *DeleteResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead. func (*DeleteResponse) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{8} -} - -type StartRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - StreamId string `protobuf:"bytes,2,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` -} - -func (x *StartRequest) Reset() { - *x = StartRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StartRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartRequest) ProtoMessage() {} - -func (x *StartRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StartRequest.ProtoReflect.Descriptor instead. -func (*StartRequest) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{9} -} - -func (x *StartRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *StartRequest) GetStreamId() string { - if x != nil { - return x.StreamId - } - return "" -} - -type StartResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *StartResponse) Reset() { - *x = StartResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StartResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StartResponse) ProtoMessage() {} - -func (x *StartResponse) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StartResponse.ProtoReflect.Descriptor instead. -func (*StartResponse) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{10} + return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{3} } type StopRequest struct { @@ -804,7 +358,7 @@ type StopRequest struct { func (x *StopRequest) Reset() { *x = StopRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[11] + mi := &file_protos_containers_v1_containers_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -817,7 +371,7 @@ func (x *StopRequest) String() string { func (*StopRequest) ProtoMessage() {} func (x *StopRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[11] + mi := &file_protos_containers_v1_containers_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -830,7 +384,7 @@ func (x *StopRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StopRequest.ProtoReflect.Descriptor instead. func (*StopRequest) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{11} + return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{4} } func (x *StopRequest) GetId() string { @@ -856,7 +410,7 @@ type StopResponse struct { func (x *StopResponse) Reset() { *x = StopResponse{} if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[12] + mi := &file_protos_containers_v1_containers_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -869,7 +423,7 @@ func (x *StopResponse) String() string { func (*StopResponse) ProtoMessage() {} func (x *StopResponse) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[12] + mi := &file_protos_containers_v1_containers_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -882,7 +436,124 @@ func (x *StopResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StopResponse.ProtoReflect.Descriptor instead. func (*StopResponse) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{12} + return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{5} +} + +type RunRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Image string `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` + Ports []*Port `protobuf:"bytes,3,rep,name=ports,proto3" json:"ports,omitempty"` + Labels map[string]string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Volumes []string `protobuf:"bytes,5,rep,name=volumes,proto3" json:"volumes,omitempty"` +} + +func (x *RunRequest) Reset() { + *x = RunRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_containers_v1_containers_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RunRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RunRequest) ProtoMessage() {} + +func (x *RunRequest) ProtoReflect() protoreflect.Message { + mi := &file_protos_containers_v1_containers_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RunRequest.ProtoReflect.Descriptor instead. +func (*RunRequest) Descriptor() ([]byte, []int) { + return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{6} +} + +func (x *RunRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *RunRequest) GetImage() string { + if x != nil { + return x.Image + } + return "" +} + +func (x *RunRequest) GetPorts() []*Port { + if x != nil { + return x.Ports + } + return nil +} + +func (x *RunRequest) GetLabels() map[string]string { + if x != nil { + return x.Labels + } + return nil +} + +func (x *RunRequest) GetVolumes() []string { + if x != nil { + return x.Volumes + } + return nil +} + +type RunResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RunResponse) Reset() { + *x = RunResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_containers_v1_containers_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RunResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RunResponse) ProtoMessage() {} + +func (x *RunResponse) ProtoReflect() protoreflect.Message { + mi := &file_protos_containers_v1_containers_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RunResponse.ProtoReflect.Descriptor instead. +func (*RunResponse) Descriptor() ([]byte, []int) { + return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{7} } type ExecRequest struct { @@ -890,18 +561,18 @@ type ExecRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - StreamId string `protobuf:"bytes,2,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` - Args []string `protobuf:"bytes,3,rep,name=args,proto3" json:"args,omitempty"` - Env []string `protobuf:"bytes,4,rep,name=env,proto3" json:"env,omitempty"` - Tty bool `protobuf:"varint,5,opt,name=tty,proto3" json:"tty,omitempty"` - WorkingDir string `protobuf:"bytes,6,opt,name=working_dir,json=workingDir,proto3" json:"working_dir,omitempty"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Command string `protobuf:"bytes,2,opt,name=command,proto3" json:"command,omitempty"` + StreamId string `protobuf:"bytes,3,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` + Args []string `protobuf:"bytes,4,rep,name=args,proto3" json:"args,omitempty"` + Env []string `protobuf:"bytes,5,rep,name=env,proto3" json:"env,omitempty"` + Tty bool `protobuf:"varint,6,opt,name=tty,proto3" json:"tty,omitempty"` } func (x *ExecRequest) Reset() { *x = ExecRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[13] + mi := &file_protos_containers_v1_containers_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -914,7 +585,7 @@ func (x *ExecRequest) String() string { func (*ExecRequest) ProtoMessage() {} func (x *ExecRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[13] + mi := &file_protos_containers_v1_containers_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -927,7 +598,7 @@ func (x *ExecRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecRequest.ProtoReflect.Descriptor instead. func (*ExecRequest) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{13} + return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{8} } func (x *ExecRequest) GetId() string { @@ -937,6 +608,13 @@ func (x *ExecRequest) GetId() string { return "" } +func (x *ExecRequest) GetCommand() string { + if x != nil { + return x.Command + } + return "" +} + func (x *ExecRequest) GetStreamId() string { if x != nil { return x.StreamId @@ -965,23 +643,18 @@ func (x *ExecRequest) GetTty() bool { return false } -func (x *ExecRequest) GetWorkingDir() string { - if x != nil { - return x.WorkingDir - } - return "" -} - type ExecResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + Output []byte `protobuf:"bytes,1,opt,name=output,proto3" json:"output,omitempty"` } func (x *ExecResponse) Reset() { *x = ExecResponse{} if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[14] + mi := &file_protos_containers_v1_containers_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -994,7 +667,7 @@ func (x *ExecResponse) String() string { func (*ExecResponse) ProtoMessage() {} func (x *ExecResponse) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[14] + mi := &file_protos_containers_v1_containers_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1007,100 +680,14 @@ func (x *ExecResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecResponse.ProtoReflect.Descriptor instead. func (*ExecResponse) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{14} + return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{9} } -type KillRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Signal int64 `protobuf:"varint,2,opt,name=signal,proto3" json:"signal,omitempty"` -} - -func (x *KillRequest) Reset() { - *x = KillRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *KillRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KillRequest) ProtoMessage() {} - -func (x *KillRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use KillRequest.ProtoReflect.Descriptor instead. -func (*KillRequest) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{15} -} - -func (x *KillRequest) GetId() string { +func (x *ExecResponse) GetOutput() []byte { if x != nil { - return x.Id + return x.Output } - return "" -} - -func (x *KillRequest) GetSignal() int64 { - if x != nil { - return x.Signal - } - return 0 -} - -type KillResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *KillResponse) Reset() { - *x = KillResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *KillResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KillResponse) ProtoMessage() {} - -func (x *KillResponse) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use KillResponse.ProtoReflect.Descriptor instead. -func (*KillResponse) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{16} + return nil } type ListRequest struct { @@ -1114,7 +701,7 @@ type ListRequest struct { func (x *ListRequest) Reset() { *x = ListRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[17] + mi := &file_protos_containers_v1_containers_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1127,7 +714,7 @@ func (x *ListRequest) String() string { func (*ListRequest) ProtoMessage() {} func (x *ListRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[17] + mi := &file_protos_containers_v1_containers_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1140,7 +727,7 @@ func (x *ListRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListRequest.ProtoReflect.Descriptor instead. func (*ListRequest) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{17} + return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{10} } func (x *ListRequest) GetAll() bool { @@ -1161,7 +748,7 @@ type ListResponse struct { func (x *ListResponse) Reset() { *x = ListResponse{} if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[18] + mi := &file_protos_containers_v1_containers_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1174,7 +761,7 @@ func (x *ListResponse) String() string { func (*ListResponse) ProtoMessage() {} func (x *ListResponse) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[18] + mi := &file_protos_containers_v1_containers_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1187,7 +774,7 @@ func (x *ListResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListResponse.ProtoReflect.Descriptor instead. func (*ListResponse) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{18} + return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{11} } func (x *ListResponse) GetContainers() []*Container { @@ -1203,13 +790,13 @@ type LogsRequest struct { unknownFields protoimpl.UnknownFields ContainerId string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - Follow bool `protobuf:"varint,2,opt,name=follow,proto3" json:"follow,omitempty"` + Follow bool `protobuf:"varint,3,opt,name=follow,proto3" json:"follow,omitempty"` } func (x *LogsRequest) Reset() { *x = LogsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[19] + mi := &file_protos_containers_v1_containers_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1222,7 +809,7 @@ func (x *LogsRequest) String() string { func (*LogsRequest) ProtoMessage() {} func (x *LogsRequest) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[19] + mi := &file_protos_containers_v1_containers_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1235,7 +822,7 @@ func (x *LogsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LogsRequest.ProtoReflect.Descriptor instead. func (*LogsRequest) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{19} + return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{12} } func (x *LogsRequest) GetContainerId() string { @@ -1257,13 +844,13 @@ type LogsResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Logs []byte `protobuf:"bytes,1,opt,name=logs,proto3" json:"logs,omitempty"` + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` } func (x *LogsResponse) Reset() { *x = LogsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_protos_containers_v1_containers_proto_msgTypes[20] + mi := &file_protos_containers_v1_containers_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1276,7 +863,7 @@ func (x *LogsResponse) String() string { func (*LogsResponse) ProtoMessage() {} func (x *LogsResponse) ProtoReflect() protoreflect.Message { - mi := &file_protos_containers_v1_containers_proto_msgTypes[20] + mi := &file_protos_containers_v1_containers_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1289,12 +876,12 @@ func (x *LogsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use LogsResponse.ProtoReflect.Descriptor instead. func (*LogsResponse) Descriptor() ([]byte, []int) { - return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{20} + return file_protos_containers_v1_containers_proto_rawDescGZIP(), []int{13} } -func (x *LogsResponse) GetLogs() []byte { +func (x *LogsResponse) GetValue() []byte { if x != nil { - return x.Logs + return x.Value } return nil } @@ -1337,164 +924,107 @@ var file_protos_containers_v1_containers_proto_rawDesc = []byte{ 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x72, 0x74, 0x52, 0x05, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x22, - 0x98, 0x04, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x79, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x74, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, - 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, - 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x6e, - 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x6e, 0x61, 0x70, 0x73, - 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x67, - 0x67, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x6f, 0x67, 0x67, 0x65, - 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x72, - 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x42, 0x0a, 0x06, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x06, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, - 0x67, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x77, 0x6f, 0x72, - 0x6b, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x72, 0x12, 0x56, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, - 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, - 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, - 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x6f, 0x0a, 0x05, 0x4d, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x10, 0x0a, 0x0e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x0a, - 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, - 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, - 0x6d, 0x61, 0x67, 0x65, 0x22, 0x10, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x35, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x10, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x0a, 0x0b, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x10, 0x0a, - 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x3b, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x22, 0x0f, 0x0a, 0x0d, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x0a, - 0x0b, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, - 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x74, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x0b, 0x45, 0x78, 0x65, 0x63, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x74, 0x79, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x74, 0x74, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x77, - 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x44, 0x69, 0x72, 0x22, 0x0e, 0x0a, 0x0c, - 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x0a, 0x0b, - 0x4b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x6c, 0x22, 0x0e, 0x0a, 0x0c, 0x4b, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x1f, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x03, 0x61, 0x6c, 0x6c, 0x22, 0x5e, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, - 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x73, 0x22, 0x48, 0x0a, 0x0b, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x22, 0x22, - 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x6c, 0x6f, - 0x67, 0x73, 0x32, 0xf8, 0x07, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x73, 0x12, 0x6b, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, - 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, - 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x71, - 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, - 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, + 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x9d, 0x02, 0x0a, 0x0a, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x3f, 0x0a, 0x05, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, + 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x72, 0x74, + 0x52, 0x05, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x53, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, + 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x18, 0x0a, 0x07, + 0x76, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x76, + 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0x0d, 0x0a, 0x0b, 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x8c, 0x01, 0x0a, 0x0b, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, + 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x65, + 0x6e, 0x76, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x10, 0x0a, + 0x03, 0x74, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x74, 0x74, 0x79, 0x22, + 0x26, 0x0a, 0x0c, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x22, 0x1f, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x22, 0x5e, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x6e, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x31, 0x2e, 0x63, 0x6f, 0x6d, - 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, - 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x6b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x52, 0x0a, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x22, 0x48, 0x0a, 0x0b, 0x4c, 0x6f, 0x67, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, + 0x6c, 0x6c, 0x6f, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x66, 0x6f, 0x6c, 0x6c, + 0x6f, 0x77, 0x22, 0x24, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x32, 0x9f, 0x05, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x12, 0x6b, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x04, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x30, 0x2e, 0x63, + 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, + 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x68, 0x0a, 0x03, 0x52, 0x75, 0x6e, 0x12, 0x2f, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, + 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x52, + 0x75, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, - 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, - 0x0a, 0x04, 0x4b, 0x69, 0x6c, 0x6c, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, - 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x69, 0x6c, - 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, - 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4b, - 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x71, 0x0a, 0x06, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, + 0x52, 0x75, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x04, 0x45, + 0x78, 0x65, 0x63, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, + 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6d, 0x0a, 0x04, 0x4c, 0x6f, 0x67, 0x73, + 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x71, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, - 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x71, - 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x32, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, - 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, - 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x6b, 0x0a, 0x04, 0x45, 0x78, 0x65, 0x63, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, - 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, - 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6d, - 0x0a, 0x04, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x30, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, - 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x64, - 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, - 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, - 0x6f, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x42, 0x2f, 0x5a, - 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x6f, 0x63, 0x6b, - 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2f, 0x5a, 0x2d, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -1509,56 +1039,43 @@ func file_protos_containers_v1_containers_proto_rawDescGZIP() []byte { return file_protos_containers_v1_containers_proto_rawDescData } -var file_protos_containers_v1_containers_proto_msgTypes = make([]protoimpl.MessageInfo, 22) +var file_protos_containers_v1_containers_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_protos_containers_v1_containers_proto_goTypes = []interface{}{ (*Port)(nil), // 0: com.docker.api.protos.containers.v1.Port (*Container)(nil), // 1: com.docker.api.protos.containers.v1.Container - (*CreateRequest)(nil), // 2: com.docker.api.protos.containers.v1.CreateRequest - (*Mount)(nil), // 3: com.docker.api.protos.containers.v1.Mount - (*CreateResponse)(nil), // 4: com.docker.api.protos.containers.v1.CreateResponse - (*UpdateRequest)(nil), // 5: com.docker.api.protos.containers.v1.UpdateRequest - (*UpdateResponse)(nil), // 6: com.docker.api.protos.containers.v1.UpdateResponse - (*DeleteRequest)(nil), // 7: com.docker.api.protos.containers.v1.DeleteRequest - (*DeleteResponse)(nil), // 8: com.docker.api.protos.containers.v1.DeleteResponse - (*StartRequest)(nil), // 9: com.docker.api.protos.containers.v1.StartRequest - (*StartResponse)(nil), // 10: com.docker.api.protos.containers.v1.StartResponse - (*StopRequest)(nil), // 11: com.docker.api.protos.containers.v1.StopRequest - (*StopResponse)(nil), // 12: com.docker.api.protos.containers.v1.StopResponse - (*ExecRequest)(nil), // 13: com.docker.api.protos.containers.v1.ExecRequest - (*ExecResponse)(nil), // 14: com.docker.api.protos.containers.v1.ExecResponse - (*KillRequest)(nil), // 15: com.docker.api.protos.containers.v1.KillRequest - (*KillResponse)(nil), // 16: com.docker.api.protos.containers.v1.KillResponse - (*ListRequest)(nil), // 17: com.docker.api.protos.containers.v1.ListRequest - (*ListResponse)(nil), // 18: com.docker.api.protos.containers.v1.ListResponse - (*LogsRequest)(nil), // 19: com.docker.api.protos.containers.v1.LogsRequest - (*LogsResponse)(nil), // 20: com.docker.api.protos.containers.v1.LogsResponse - nil, // 21: com.docker.api.protos.containers.v1.CreateRequest.LabelsEntry + (*DeleteRequest)(nil), // 2: com.docker.api.protos.containers.v1.DeleteRequest + (*DeleteResponse)(nil), // 3: com.docker.api.protos.containers.v1.DeleteResponse + (*StopRequest)(nil), // 4: com.docker.api.protos.containers.v1.StopRequest + (*StopResponse)(nil), // 5: com.docker.api.protos.containers.v1.StopResponse + (*RunRequest)(nil), // 6: com.docker.api.protos.containers.v1.RunRequest + (*RunResponse)(nil), // 7: com.docker.api.protos.containers.v1.RunResponse + (*ExecRequest)(nil), // 8: com.docker.api.protos.containers.v1.ExecRequest + (*ExecResponse)(nil), // 9: com.docker.api.protos.containers.v1.ExecResponse + (*ListRequest)(nil), // 10: com.docker.api.protos.containers.v1.ListRequest + (*ListResponse)(nil), // 11: com.docker.api.protos.containers.v1.ListResponse + (*LogsRequest)(nil), // 12: com.docker.api.protos.containers.v1.LogsRequest + (*LogsResponse)(nil), // 13: com.docker.api.protos.containers.v1.LogsResponse + nil, // 14: com.docker.api.protos.containers.v1.RunRequest.LabelsEntry } var file_protos_containers_v1_containers_proto_depIdxs = []int32{ 0, // 0: com.docker.api.protos.containers.v1.Container.ports:type_name -> com.docker.api.protos.containers.v1.Port - 3, // 1: com.docker.api.protos.containers.v1.CreateRequest.mounts:type_name -> com.docker.api.protos.containers.v1.Mount - 21, // 2: com.docker.api.protos.containers.v1.CreateRequest.labels:type_name -> com.docker.api.protos.containers.v1.CreateRequest.LabelsEntry + 0, // 1: com.docker.api.protos.containers.v1.RunRequest.ports:type_name -> com.docker.api.protos.containers.v1.Port + 14, // 2: com.docker.api.protos.containers.v1.RunRequest.labels:type_name -> com.docker.api.protos.containers.v1.RunRequest.LabelsEntry 1, // 3: com.docker.api.protos.containers.v1.ListResponse.containers:type_name -> com.docker.api.protos.containers.v1.Container - 17, // 4: com.docker.api.protos.containers.v1.Containers.List:input_type -> com.docker.api.protos.containers.v1.ListRequest - 2, // 5: com.docker.api.protos.containers.v1.Containers.Create:input_type -> com.docker.api.protos.containers.v1.CreateRequest - 9, // 6: com.docker.api.protos.containers.v1.Containers.Start:input_type -> com.docker.api.protos.containers.v1.StartRequest - 11, // 7: com.docker.api.protos.containers.v1.Containers.Stop:input_type -> com.docker.api.protos.containers.v1.StopRequest - 15, // 8: com.docker.api.protos.containers.v1.Containers.Kill:input_type -> com.docker.api.protos.containers.v1.KillRequest - 7, // 9: com.docker.api.protos.containers.v1.Containers.Delete:input_type -> com.docker.api.protos.containers.v1.DeleteRequest - 5, // 10: com.docker.api.protos.containers.v1.Containers.Update:input_type -> com.docker.api.protos.containers.v1.UpdateRequest - 13, // 11: com.docker.api.protos.containers.v1.Containers.Exec:input_type -> com.docker.api.protos.containers.v1.ExecRequest - 19, // 12: com.docker.api.protos.containers.v1.Containers.Logs:input_type -> com.docker.api.protos.containers.v1.LogsRequest - 18, // 13: com.docker.api.protos.containers.v1.Containers.List:output_type -> com.docker.api.protos.containers.v1.ListResponse - 4, // 14: com.docker.api.protos.containers.v1.Containers.Create:output_type -> com.docker.api.protos.containers.v1.CreateResponse - 10, // 15: com.docker.api.protos.containers.v1.Containers.Start:output_type -> com.docker.api.protos.containers.v1.StartResponse - 12, // 16: com.docker.api.protos.containers.v1.Containers.Stop:output_type -> com.docker.api.protos.containers.v1.StopResponse - 16, // 17: com.docker.api.protos.containers.v1.Containers.Kill:output_type -> com.docker.api.protos.containers.v1.KillResponse - 8, // 18: com.docker.api.protos.containers.v1.Containers.Delete:output_type -> com.docker.api.protos.containers.v1.DeleteResponse - 6, // 19: com.docker.api.protos.containers.v1.Containers.Update:output_type -> com.docker.api.protos.containers.v1.UpdateResponse - 14, // 20: com.docker.api.protos.containers.v1.Containers.Exec:output_type -> com.docker.api.protos.containers.v1.ExecResponse - 20, // 21: com.docker.api.protos.containers.v1.Containers.Logs:output_type -> com.docker.api.protos.containers.v1.LogsResponse - 13, // [13:22] is the sub-list for method output_type - 4, // [4:13] is the sub-list for method input_type + 10, // 4: com.docker.api.protos.containers.v1.Containers.List:input_type -> com.docker.api.protos.containers.v1.ListRequest + 4, // 5: com.docker.api.protos.containers.v1.Containers.Stop:input_type -> com.docker.api.protos.containers.v1.StopRequest + 6, // 6: com.docker.api.protos.containers.v1.Containers.Run:input_type -> com.docker.api.protos.containers.v1.RunRequest + 8, // 7: com.docker.api.protos.containers.v1.Containers.Exec:input_type -> com.docker.api.protos.containers.v1.ExecRequest + 12, // 8: com.docker.api.protos.containers.v1.Containers.Logs:input_type -> com.docker.api.protos.containers.v1.LogsRequest + 2, // 9: com.docker.api.protos.containers.v1.Containers.Delete:input_type -> com.docker.api.protos.containers.v1.DeleteRequest + 11, // 10: com.docker.api.protos.containers.v1.Containers.List:output_type -> com.docker.api.protos.containers.v1.ListResponse + 5, // 11: com.docker.api.protos.containers.v1.Containers.Stop:output_type -> com.docker.api.protos.containers.v1.StopResponse + 7, // 12: com.docker.api.protos.containers.v1.Containers.Run:output_type -> com.docker.api.protos.containers.v1.RunResponse + 9, // 13: com.docker.api.protos.containers.v1.Containers.Exec:output_type -> com.docker.api.protos.containers.v1.ExecResponse + 13, // 14: com.docker.api.protos.containers.v1.Containers.Logs:output_type -> com.docker.api.protos.containers.v1.LogsResponse + 3, // 15: com.docker.api.protos.containers.v1.Containers.Delete:output_type -> com.docker.api.protos.containers.v1.DeleteResponse + 10, // [10:16] is the sub-list for method output_type + 4, // [4:10] is the sub-list for method input_type 4, // [4:4] is the sub-list for extension type_name 4, // [4:4] is the sub-list for extension extendee 0, // [0:4] is the sub-list for field type_name @@ -1595,66 +1112,6 @@ func file_protos_containers_v1_containers_proto_init() { } } file_protos_containers_v1_containers_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_protos_containers_v1_containers_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Mount); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_protos_containers_v1_containers_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_protos_containers_v1_containers_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_protos_containers_v1_containers_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_protos_containers_v1_containers_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteRequest); i { case 0: return &v.state @@ -1666,7 +1123,7 @@ func file_protos_containers_v1_containers_proto_init() { return nil } } - file_protos_containers_v1_containers_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_protos_containers_v1_containers_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteResponse); i { case 0: return &v.state @@ -1678,31 +1135,7 @@ func file_protos_containers_v1_containers_proto_init() { return nil } } - file_protos_containers_v1_containers_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_protos_containers_v1_containers_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_protos_containers_v1_containers_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_protos_containers_v1_containers_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StopRequest); i { case 0: return &v.state @@ -1714,7 +1147,7 @@ func file_protos_containers_v1_containers_proto_init() { return nil } } - file_protos_containers_v1_containers_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_protos_containers_v1_containers_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StopResponse); i { case 0: return &v.state @@ -1726,7 +1159,31 @@ func file_protos_containers_v1_containers_proto_init() { return nil } } - file_protos_containers_v1_containers_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_protos_containers_v1_containers_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RunRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protos_containers_v1_containers_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RunResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protos_containers_v1_containers_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecRequest); i { case 0: return &v.state @@ -1738,7 +1195,7 @@ func file_protos_containers_v1_containers_proto_init() { return nil } } - file_protos_containers_v1_containers_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_protos_containers_v1_containers_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecResponse); i { case 0: return &v.state @@ -1750,31 +1207,7 @@ func file_protos_containers_v1_containers_proto_init() { return nil } } - file_protos_containers_v1_containers_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KillRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_protos_containers_v1_containers_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KillResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_protos_containers_v1_containers_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_protos_containers_v1_containers_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListRequest); i { case 0: return &v.state @@ -1786,7 +1219,7 @@ func file_protos_containers_v1_containers_proto_init() { return nil } } - file_protos_containers_v1_containers_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_protos_containers_v1_containers_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListResponse); i { case 0: return &v.state @@ -1798,7 +1231,7 @@ func file_protos_containers_v1_containers_proto_init() { return nil } } - file_protos_containers_v1_containers_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_protos_containers_v1_containers_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LogsRequest); i { case 0: return &v.state @@ -1810,7 +1243,7 @@ func file_protos_containers_v1_containers_proto_init() { return nil } } - file_protos_containers_v1_containers_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_protos_containers_v1_containers_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LogsResponse); i { case 0: return &v.state @@ -1829,7 +1262,7 @@ func file_protos_containers_v1_containers_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_protos_containers_v1_containers_proto_rawDesc, NumEnums: 0, - NumMessages: 22, + NumMessages: 15, NumExtensions: 0, NumServices: 1, }, @@ -1856,14 +1289,11 @@ const _ = grpc.SupportPackageIsVersion6 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type ContainersClient interface { List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) - Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) - Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error) Stop(ctx context.Context, in *StopRequest, opts ...grpc.CallOption) (*StopResponse, error) - Kill(ctx context.Context, in *KillRequest, opts ...grpc.CallOption) (*KillResponse, error) - Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) - Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) + Run(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (*RunResponse, error) Exec(ctx context.Context, in *ExecRequest, opts ...grpc.CallOption) (*ExecResponse, error) Logs(ctx context.Context, in *LogsRequest, opts ...grpc.CallOption) (Containers_LogsClient, error) + Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) } type containersClient struct { @@ -1883,24 +1313,6 @@ func (c *containersClient) List(ctx context.Context, in *ListRequest, opts ...gr return out, nil } -func (c *containersClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) { - out := new(CreateResponse) - err := c.cc.Invoke(ctx, "/com.docker.api.protos.containers.v1.Containers/Create", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *containersClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error) { - out := new(StartResponse) - err := c.cc.Invoke(ctx, "/com.docker.api.protos.containers.v1.Containers/Start", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *containersClient) Stop(ctx context.Context, in *StopRequest, opts ...grpc.CallOption) (*StopResponse, error) { out := new(StopResponse) err := c.cc.Invoke(ctx, "/com.docker.api.protos.containers.v1.Containers/Stop", in, out, opts...) @@ -1910,27 +1322,9 @@ func (c *containersClient) Stop(ctx context.Context, in *StopRequest, opts ...gr return out, nil } -func (c *containersClient) Kill(ctx context.Context, in *KillRequest, opts ...grpc.CallOption) (*KillResponse, error) { - out := new(KillResponse) - err := c.cc.Invoke(ctx, "/com.docker.api.protos.containers.v1.Containers/Kill", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *containersClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { - out := new(DeleteResponse) - err := c.cc.Invoke(ctx, "/com.docker.api.protos.containers.v1.Containers/Delete", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *containersClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) { - out := new(UpdateResponse) - err := c.cc.Invoke(ctx, "/com.docker.api.protos.containers.v1.Containers/Update", in, out, opts...) +func (c *containersClient) Run(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (*RunResponse, error) { + out := new(RunResponse) + err := c.cc.Invoke(ctx, "/com.docker.api.protos.containers.v1.Containers/Run", in, out, opts...) if err != nil { return nil, err } @@ -1978,17 +1372,23 @@ func (x *containersLogsClient) Recv() (*LogsResponse, error) { return m, nil } +func (c *containersClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { + out := new(DeleteResponse) + err := c.cc.Invoke(ctx, "/com.docker.api.protos.containers.v1.Containers/Delete", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ContainersServer is the server API for Containers service. type ContainersServer interface { List(context.Context, *ListRequest) (*ListResponse, error) - Create(context.Context, *CreateRequest) (*CreateResponse, error) - Start(context.Context, *StartRequest) (*StartResponse, error) Stop(context.Context, *StopRequest) (*StopResponse, error) - Kill(context.Context, *KillRequest) (*KillResponse, error) - Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) - Update(context.Context, *UpdateRequest) (*UpdateResponse, error) + Run(context.Context, *RunRequest) (*RunResponse, error) Exec(context.Context, *ExecRequest) (*ExecResponse, error) Logs(*LogsRequest, Containers_LogsServer) error + Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) } // UnimplementedContainersServer can be embedded to have forward compatible implementations. @@ -1998,23 +1398,11 @@ type UnimplementedContainersServer struct { func (*UnimplementedContainersServer) List(context.Context, *ListRequest) (*ListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method List not implemented") } -func (*UnimplementedContainersServer) Create(context.Context, *CreateRequest) (*CreateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Create not implemented") -} -func (*UnimplementedContainersServer) Start(context.Context, *StartRequest) (*StartResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Start not implemented") -} func (*UnimplementedContainersServer) Stop(context.Context, *StopRequest) (*StopResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Stop not implemented") } -func (*UnimplementedContainersServer) Kill(context.Context, *KillRequest) (*KillResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Kill not implemented") -} -func (*UnimplementedContainersServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") -} -func (*UnimplementedContainersServer) Update(context.Context, *UpdateRequest) (*UpdateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Update not implemented") +func (*UnimplementedContainersServer) Run(context.Context, *RunRequest) (*RunResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Run not implemented") } func (*UnimplementedContainersServer) Exec(context.Context, *ExecRequest) (*ExecResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Exec not implemented") @@ -2022,6 +1410,9 @@ func (*UnimplementedContainersServer) Exec(context.Context, *ExecRequest) (*Exec func (*UnimplementedContainersServer) Logs(*LogsRequest, Containers_LogsServer) error { return status.Errorf(codes.Unimplemented, "method Logs not implemented") } +func (*UnimplementedContainersServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented") +} func RegisterContainersServer(s *grpc.Server, srv ContainersServer) { s.RegisterService(&_Containers_serviceDesc, srv) @@ -2045,42 +1436,6 @@ func _Containers_List_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } -func _Containers_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContainersServer).Create(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/com.docker.api.protos.containers.v1.Containers/Create", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContainersServer).Create(ctx, req.(*CreateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Containers_Start_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(StartRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContainersServer).Start(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/com.docker.api.protos.containers.v1.Containers/Start", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContainersServer).Start(ctx, req.(*StartRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Containers_Stop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(StopRequest) if err := dec(in); err != nil { @@ -2099,56 +1454,20 @@ func _Containers_Stop_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } -func _Containers_Kill_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(KillRequest) +func _Containers_Run_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RunRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ContainersServer).Kill(ctx, in) + return srv.(ContainersServer).Run(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/com.docker.api.protos.containers.v1.Containers/Kill", + FullMethod: "/com.docker.api.protos.containers.v1.Containers/Run", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContainersServer).Kill(ctx, req.(*KillRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Containers_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContainersServer).Delete(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/com.docker.api.protos.containers.v1.Containers/Delete", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContainersServer).Delete(ctx, req.(*DeleteRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Containers_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContainersServer).Update(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/com.docker.api.protos.containers.v1.Containers/Update", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContainersServer).Update(ctx, req.(*UpdateRequest)) + return srv.(ContainersServer).Run(ctx, req.(*RunRequest)) } return interceptor(ctx, in, info, handler) } @@ -2192,6 +1511,24 @@ func (x *containersLogsServer) Send(m *LogsResponse) error { return x.ServerStream.SendMsg(m) } +func _Containers_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ContainersServer).Delete(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/com.docker.api.protos.containers.v1.Containers/Delete", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ContainersServer).Delete(ctx, req.(*DeleteRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Containers_serviceDesc = grpc.ServiceDesc{ ServiceName: "com.docker.api.protos.containers.v1.Containers", HandlerType: (*ContainersServer)(nil), @@ -2200,34 +1537,22 @@ var _Containers_serviceDesc = grpc.ServiceDesc{ MethodName: "List", Handler: _Containers_List_Handler, }, - { - MethodName: "Create", - Handler: _Containers_Create_Handler, - }, - { - MethodName: "Start", - Handler: _Containers_Start_Handler, - }, { MethodName: "Stop", Handler: _Containers_Stop_Handler, }, { - MethodName: "Kill", - Handler: _Containers_Kill_Handler, - }, - { - MethodName: "Delete", - Handler: _Containers_Delete_Handler, - }, - { - MethodName: "Update", - Handler: _Containers_Update_Handler, + MethodName: "Run", + Handler: _Containers_Run_Handler, }, { MethodName: "Exec", Handler: _Containers_Exec_Handler, }, + { + MethodName: "Delete", + Handler: _Containers_Delete_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/protos/containers/v1/containers.proto b/protos/containers/v1/containers.proto index 1f2435ce..ab5a4ccf 100644 --- a/protos/containers/v1/containers.proto +++ b/protos/containers/v1/containers.proto @@ -33,14 +33,11 @@ option go_package = "github.com/docker/api/protos/containers/v1;v1"; service Containers { rpc List(ListRequest) returns (ListResponse); - rpc Create(CreateRequest) returns (CreateResponse); - rpc Start(StartRequest) returns (StartResponse); rpc Stop(StopRequest) returns (StopResponse); - rpc Kill(KillRequest) returns (KillResponse); - rpc Delete(DeleteRequest) returns (DeleteResponse); - rpc Update(UpdateRequest) returns (UpdateResponse); + rpc Run(RunRequest) returns (RunResponse); rpc Exec(ExecRequest) returns (ExecResponse); rpc Logs(LogsRequest) returns (stream LogsResponse); + rpc Delete(DeleteRequest) returns (DeleteResponse); } message Port { @@ -64,43 +61,6 @@ message Container { repeated Port ports = 11; } -message CreateRequest { - string id = 1; - repeated string args = 2; - repeated string env = 3; - bool tty = 4; - string image = 5; - string hostname = 6; - repeated string networks = 7; - string snapshotter = 8; - string logger = 9; - string profile = 10; - string restart_status = 11; - repeated Mount mounts = 12; - string working_dir = 13; - map labels = 14; -} - -message Mount { - string type = 1; - string source = 2; - string destination = 3; - repeated string options = 4; -} - -message CreateResponse { - -} - -message UpdateRequest { - string id = 1; - string image = 2; -} - -message UpdateResponse { - -} - message DeleteRequest { string id = 1; bool force = 2; @@ -109,15 +69,6 @@ message DeleteRequest { message DeleteResponse { } -message StartRequest { - string id = 1; - string stream_id = 2; -} - -message StartResponse { - -} - message StopRequest { string id = 1; uint32 timeout = 2; @@ -126,26 +77,28 @@ message StopRequest { message StopResponse { } +message RunRequest { + string id = 1; + string image = 2; + repeated Port ports = 3; + map labels = 4; + repeated string volumes = 5; +} + +message RunResponse { +} message ExecRequest { string id = 1; - string stream_id = 2; - repeated string args = 3; - repeated string env = 4; - bool tty = 5; - string working_dir = 6; + string command = 2; + string stream_id = 3; + repeated string args = 4; + repeated string env = 5; + bool tty = 6; } message ExecResponse { - -} - -message KillRequest { - string id = 1; - int64 signal = 2; -} - -message KillResponse { + bytes output = 1; } message ListRequest { @@ -158,9 +111,9 @@ message ListResponse { message LogsRequest { string container_id = 1; - bool follow = 2; + bool follow = 3; } message LogsResponse { - bytes logs = 1; + bytes value = 1; } diff --git a/protos/streams/v1/streams.pb.go b/protos/streams/v1/streams.pb.go new file mode 100644 index 00000000..bd4c37b7 --- /dev/null +++ b/protos/streams/v1/streams.pb.go @@ -0,0 +1,480 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.22.0 +// protoc v3.11.2 +// source: protos/streams/v1/streams.proto + +package v1 + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + any "github.com/golang/protobuf/ptypes/any" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type IOStream int32 + +const ( + IOStream_STDIN IOStream = 0 + IOStream_STDOUT IOStream = 1 + IOStream_STDERR IOStream = 2 +) + +// Enum value maps for IOStream. +var ( + IOStream_name = map[int32]string{ + 0: "STDIN", + 1: "STDOUT", + 2: "STDERR", + } + IOStream_value = map[string]int32{ + "STDIN": 0, + "STDOUT": 1, + "STDERR": 2, + } +) + +func (x IOStream) Enum() *IOStream { + p := new(IOStream) + *p = x + return p +} + +func (x IOStream) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (IOStream) Descriptor() protoreflect.EnumDescriptor { + return file_protos_streams_v1_streams_proto_enumTypes[0].Descriptor() +} + +func (IOStream) Type() protoreflect.EnumType { + return &file_protos_streams_v1_streams_proto_enumTypes[0] +} + +func (x IOStream) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use IOStream.Descriptor instead. +func (IOStream) EnumDescriptor() ([]byte, []int) { + return file_protos_streams_v1_streams_proto_rawDescGZIP(), []int{0} +} + +type BytesMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Type IOStream `protobuf:"varint,1,opt,name=type,proto3,enum=com.docker.api.protos.streams.v1.IOStream" json:"type,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *BytesMessage) Reset() { + *x = BytesMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_streams_v1_streams_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BytesMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BytesMessage) ProtoMessage() {} + +func (x *BytesMessage) ProtoReflect() protoreflect.Message { + mi := &file_protos_streams_v1_streams_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BytesMessage.ProtoReflect.Descriptor instead. +func (*BytesMessage) Descriptor() ([]byte, []int) { + return file_protos_streams_v1_streams_proto_rawDescGZIP(), []int{0} +} + +func (x *BytesMessage) GetType() IOStream { + if x != nil { + return x.Type + } + return IOStream_STDIN +} + +func (x *BytesMessage) GetValue() []byte { + if x != nil { + return x.Value + } + return nil +} + +type ResizeMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Width uint32 `protobuf:"varint,1,opt,name=width,proto3" json:"width,omitempty"` + Height uint32 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` +} + +func (x *ResizeMessage) Reset() { + *x = ResizeMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_streams_v1_streams_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ResizeMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ResizeMessage) ProtoMessage() {} + +func (x *ResizeMessage) ProtoReflect() protoreflect.Message { + mi := &file_protos_streams_v1_streams_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ResizeMessage.ProtoReflect.Descriptor instead. +func (*ResizeMessage) Descriptor() ([]byte, []int) { + return file_protos_streams_v1_streams_proto_rawDescGZIP(), []int{1} +} + +func (x *ResizeMessage) GetWidth() uint32 { + if x != nil { + return x.Width + } + return 0 +} + +func (x *ResizeMessage) GetHeight() uint32 { + if x != nil { + return x.Height + } + return 0 +} + +type ExitMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Status uint32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` +} + +func (x *ExitMessage) Reset() { + *x = ExitMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_protos_streams_v1_streams_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExitMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExitMessage) ProtoMessage() {} + +func (x *ExitMessage) ProtoReflect() protoreflect.Message { + mi := &file_protos_streams_v1_streams_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExitMessage.ProtoReflect.Descriptor instead. +func (*ExitMessage) Descriptor() ([]byte, []int) { + return file_protos_streams_v1_streams_proto_rawDescGZIP(), []int{2} +} + +func (x *ExitMessage) GetStatus() uint32 { + if x != nil { + return x.Status + } + return 0 +} + +var File_protos_streams_v1_streams_proto protoreflect.FileDescriptor + +var file_protos_streams_v1_streams_proto_rawDesc = []byte{ + 0x0a, 0x1f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, + 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x20, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, + 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x64, + 0x0a, 0x0c, 0x42, 0x79, 0x74, 0x65, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3e, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x63, + 0x6f, 0x6d, 0x2e, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x49, 0x4f, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3d, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, + 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x22, 0x25, 0x0a, 0x0b, 0x45, 0x78, 0x69, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2a, 0x2d, 0x0a, 0x08, 0x49, 0x4f, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x54, 0x44, 0x49, 0x4e, 0x10, + 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x44, 0x4f, 0x55, 0x54, 0x10, 0x01, 0x12, 0x0a, 0x0a, + 0x06, 0x53, 0x54, 0x44, 0x45, 0x52, 0x52, 0x10, 0x02, 0x32, 0x48, 0x0a, 0x09, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x3b, 0x0a, 0x09, 0x4e, 0x65, 0x77, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x12, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x1a, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x28, + 0x01, 0x30, 0x01, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x64, 0x6f, 0x63, 0x6b, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x76, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_protos_streams_v1_streams_proto_rawDescOnce sync.Once + file_protos_streams_v1_streams_proto_rawDescData = file_protos_streams_v1_streams_proto_rawDesc +) + +func file_protos_streams_v1_streams_proto_rawDescGZIP() []byte { + file_protos_streams_v1_streams_proto_rawDescOnce.Do(func() { + file_protos_streams_v1_streams_proto_rawDescData = protoimpl.X.CompressGZIP(file_protos_streams_v1_streams_proto_rawDescData) + }) + return file_protos_streams_v1_streams_proto_rawDescData +} + +var file_protos_streams_v1_streams_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_protos_streams_v1_streams_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_protos_streams_v1_streams_proto_goTypes = []interface{}{ + (IOStream)(0), // 0: com.docker.api.protos.streams.v1.IOStream + (*BytesMessage)(nil), // 1: com.docker.api.protos.streams.v1.BytesMessage + (*ResizeMessage)(nil), // 2: com.docker.api.protos.streams.v1.ResizeMessage + (*ExitMessage)(nil), // 3: com.docker.api.protos.streams.v1.ExitMessage + (*any.Any)(nil), // 4: google.protobuf.Any +} +var file_protos_streams_v1_streams_proto_depIdxs = []int32{ + 0, // 0: com.docker.api.protos.streams.v1.BytesMessage.type:type_name -> com.docker.api.protos.streams.v1.IOStream + 4, // 1: com.docker.api.protos.streams.v1.Streaming.NewStream:input_type -> google.protobuf.Any + 4, // 2: com.docker.api.protos.streams.v1.Streaming.NewStream:output_type -> google.protobuf.Any + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_protos_streams_v1_streams_proto_init() } +func file_protos_streams_v1_streams_proto_init() { + if File_protos_streams_v1_streams_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_protos_streams_v1_streams_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BytesMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protos_streams_v1_streams_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResizeMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protos_streams_v1_streams_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExitMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_protos_streams_v1_streams_proto_rawDesc, + NumEnums: 1, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_protos_streams_v1_streams_proto_goTypes, + DependencyIndexes: file_protos_streams_v1_streams_proto_depIdxs, + EnumInfos: file_protos_streams_v1_streams_proto_enumTypes, + MessageInfos: file_protos_streams_v1_streams_proto_msgTypes, + }.Build() + File_protos_streams_v1_streams_proto = out.File + file_protos_streams_v1_streams_proto_rawDesc = nil + file_protos_streams_v1_streams_proto_goTypes = nil + file_protos_streams_v1_streams_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// 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.SupportPackageIsVersion6 + +// StreamingClient is the client API for Streaming service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type StreamingClient interface { + NewStream(ctx context.Context, opts ...grpc.CallOption) (Streaming_NewStreamClient, error) +} + +type streamingClient struct { + cc grpc.ClientConnInterface +} + +func NewStreamingClient(cc grpc.ClientConnInterface) StreamingClient { + return &streamingClient{cc} +} + +func (c *streamingClient) NewStream(ctx context.Context, opts ...grpc.CallOption) (Streaming_NewStreamClient, error) { + stream, err := c.cc.NewStream(ctx, &_Streaming_serviceDesc.Streams[0], "/com.docker.api.protos.streams.v1.Streaming/NewStream", opts...) + if err != nil { + return nil, err + } + x := &streamingNewStreamClient{stream} + return x, nil +} + +type Streaming_NewStreamClient interface { + Send(*any.Any) error + Recv() (*any.Any, error) + grpc.ClientStream +} + +type streamingNewStreamClient struct { + grpc.ClientStream +} + +func (x *streamingNewStreamClient) Send(m *any.Any) error { + return x.ClientStream.SendMsg(m) +} + +func (x *streamingNewStreamClient) Recv() (*any.Any, error) { + m := new(any.Any) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// StreamingServer is the server API for Streaming service. +type StreamingServer interface { + NewStream(Streaming_NewStreamServer) error +} + +// UnimplementedStreamingServer can be embedded to have forward compatible implementations. +type UnimplementedStreamingServer struct { +} + +func (*UnimplementedStreamingServer) NewStream(Streaming_NewStreamServer) error { + return status.Errorf(codes.Unimplemented, "method NewStream not implemented") +} + +func RegisterStreamingServer(s *grpc.Server, srv StreamingServer) { + s.RegisterService(&_Streaming_serviceDesc, srv) +} + +func _Streaming_NewStream_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(StreamingServer).NewStream(&streamingNewStreamServer{stream}) +} + +type Streaming_NewStreamServer interface { + Send(*any.Any) error + Recv() (*any.Any, error) + grpc.ServerStream +} + +type streamingNewStreamServer struct { + grpc.ServerStream +} + +func (x *streamingNewStreamServer) Send(m *any.Any) error { + return x.ServerStream.SendMsg(m) +} + +func (x *streamingNewStreamServer) Recv() (*any.Any, error) { + m := new(any.Any) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _Streaming_serviceDesc = grpc.ServiceDesc{ + ServiceName: "com.docker.api.protos.streams.v1.Streaming", + HandlerType: (*StreamingServer)(nil), + Methods: []grpc.MethodDesc{}, + Streams: []grpc.StreamDesc{ + { + StreamName: "NewStream", + Handler: _Streaming_NewStream_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "protos/streams/v1/streams.proto", +} diff --git a/protos/streams/v1/streams.proto b/protos/streams/v1/streams.proto new file mode 100644 index 00000000..b0a9b323 --- /dev/null +++ b/protos/streams/v1/streams.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; + +package com.docker.api.protos.streams.v1; + +import "google/protobuf/any.proto"; + +option go_package = "github.com/docker/api/protos/streams/v1;v1"; + +service Streaming { + rpc NewStream(stream google.protobuf.Any) returns (stream google.protobuf.Any); +} + +enum IOStream { + STDIN = 0; + STDOUT = 1; + STDERR = 2; +} + +message BytesMessage { + IOStream type = 1; + bytes value = 2; +} + +message ResizeMessage { + uint32 width = 1; + uint32 height = 2; +} + +message ExitMessage { + uint32 status = 1; +} diff --git a/server/proxy/containers.go b/server/proxy/containers.go index 5d34bf1e..9509e504 100644 --- a/server/proxy/containers.go +++ b/server/proxy/containers.go @@ -2,23 +2,16 @@ package proxy import ( "context" + "errors" "github.com/docker/api/containers" - v1 "github.com/docker/api/protos/containers/v1" + containersv1 "github.com/docker/api/protos/containers/v1" ) -// NewContainerAPI creates a proxy container server -func NewContainerAPI() v1.ContainersServer { - return &proxyContainerAPI{} -} - -type proxyContainerAPI struct { -} - -func portsToGrpc(ports []containers.Port) []*v1.Port { - var result []*v1.Port +func portsToGrpc(ports []containers.Port) []*containersv1.Port { + var result []*containersv1.Port for _, port := range ports { - result = append(result, &v1.Port{ + result = append(result, &containersv1.Port{ ContainerPort: port.ContainerPort, HostPort: port.HostPort, HostIp: port.HostIP, @@ -29,19 +22,19 @@ func portsToGrpc(ports []containers.Port) []*v1.Port { return result } -func (p *proxyContainerAPI) List(ctx context.Context, request *v1.ListRequest) (*v1.ListResponse, error) { +func (p *proxy) List(ctx context.Context, request *containersv1.ListRequest) (*containersv1.ListResponse, error) { client := Client(ctx) c, err := client.ContainerService().List(ctx, request.GetAll()) if err != nil { - return &v1.ListResponse{}, err + return &containersv1.ListResponse{}, err } - response := &v1.ListResponse{ - Containers: []*v1.Container{}, + response := &containersv1.ListResponse{ + Containers: []*containersv1.Container{}, } for _, container := range c { - response.Containers = append(response.Containers, &v1.Container{ + response.Containers = append(response.Containers, &containersv1.Container{ Id: container.ID, Image: container.Image, Command: container.Command, @@ -59,55 +52,62 @@ func (p *proxyContainerAPI) List(ctx context.Context, request *v1.ListRequest) ( return response, nil } -func (p *proxyContainerAPI) Create(ctx context.Context, request *v1.CreateRequest) (*v1.CreateResponse, error) { - client := Client(ctx) - - err := client.ContainerService().Run(ctx, containers.ContainerConfig{ - ID: request.Id, - Image: request.Image, - }) - - return &v1.CreateResponse{}, err -} - -func (p *proxyContainerAPI) Start(_ context.Context, request *v1.StartRequest) (*v1.StartResponse, error) { - panic("not implemented") // TODO: Implement -} - -func (p *proxyContainerAPI) Stop(ctx context.Context, request *v1.StopRequest) (*v1.StopResponse, error) { +func (p *proxy) Stop(ctx context.Context, request *containersv1.StopRequest) (*containersv1.StopResponse, error) { c := Client(ctx) timeoutValue := request.GetTimeout() - return &v1.StopResponse{}, c.ContainerService().Stop(ctx, request.Id, &timeoutValue) + return &containersv1.StopResponse{}, c.ContainerService().Stop(ctx, request.Id, &timeoutValue) } -func (p *proxyContainerAPI) Kill(ctx context.Context, request *v1.KillRequest) (*v1.KillResponse, error) { - c := Client(ctx) - return &v1.KillResponse{}, c.ContainerService().Delete(ctx, request.Id, false) -} - -func (p *proxyContainerAPI) Delete(ctx context.Context, request *v1.DeleteRequest) (*v1.DeleteResponse, error) { - err := Client(ctx).ContainerService().Delete(ctx, request.Id, request.Force) - if err != nil { - return &v1.DeleteResponse{}, err +func (p *proxy) Run(ctx context.Context, request *containersv1.RunRequest) (*containersv1.RunResponse, error) { + ports := []containers.Port{} + for _, p := range request.GetPorts() { + ports = append(ports, containers.Port{ + ContainerPort: p.ContainerPort, + HostIP: p.HostIp, + HostPort: p.HostPort, + Protocol: p.Protocol, + }) } - return &v1.DeleteResponse{}, nil + err := Client(ctx).ContainerService().Run(ctx, containers.ContainerConfig{ + ID: request.GetId(), + Image: request.GetImage(), + Labels: request.GetLabels(), + Ports: ports, + Volumes: request.GetVolumes(), + }) + + return &containersv1.RunResponse{}, err } -func (p *proxyContainerAPI) Update(_ context.Context, _ *v1.UpdateRequest) (*v1.UpdateResponse, error) { - panic("not implemented") // TODO: Implement +func (p *proxy) Delete(ctx context.Context, request *containersv1.DeleteRequest) (*containersv1.DeleteResponse, error) { + err := Client(ctx).ContainerService().Delete(ctx, request.Id, request.Force) + if err != nil { + return &containersv1.DeleteResponse{}, err + } + + return &containersv1.DeleteResponse{}, nil } -func (p *proxyContainerAPI) Exec(_ context.Context, _ *v1.ExecRequest) (*v1.ExecResponse, error) { - panic("not implemented") // TODO: Implement +func (p *proxy) Exec(ctx context.Context, request *containersv1.ExecRequest) (*containersv1.ExecResponse, error) { + p.mu.Lock() + stream, ok := p.streams[request.StreamId] + p.mu.Unlock() + if !ok { + return &containersv1.ExecResponse{}, errors.New("unknown stream id") + } + + err := Client(ctx).ContainerService().Exec(ctx, request.GetId(), request.GetCommand(), &reader{stream}, &writer{stream}) + + return &containersv1.ExecResponse{}, err } -func (p *proxyContainerAPI) Logs(request *v1.LogsRequest, stream v1.Containers_LogsServer) error { +func (p *proxy) Logs(request *containersv1.LogsRequest, stream containersv1.Containers_LogsServer) error { ctx := stream.Context() c := Client(ctx) return c.ContainerService().Logs(ctx, request.GetContainerId(), containers.LogsRequest{ Follow: request.Follow, - Writer: &streamWriter{stream}, + Writer: &logStream{stream}, }) } diff --git a/server/proxy/logstream.go b/server/proxy/logstream.go new file mode 100644 index 00000000..95e63f35 --- /dev/null +++ b/server/proxy/logstream.go @@ -0,0 +1,25 @@ +package proxy + +import ( + "io" + + "google.golang.org/grpc" + + containersv1 "github.com/docker/api/protos/containers/v1" +) + +type logStream struct { + stream grpc.ServerStream +} + +func newStreamWriter(stream grpc.ServerStream) io.Writer { + return &logStream{ + stream: stream, + } +} + +func (w *logStream) Write(p []byte) (n int, err error) { + return len(p), w.stream.SendMsg(&containersv1.LogsResponse{ + Value: p, + }) +} diff --git a/server/proxy/streamwriter_test.go b/server/proxy/logstream_test.go similarity index 84% rename from server/proxy/streamwriter_test.go rename to server/proxy/logstream_test.go index b2c8cd16..fa045a00 100644 --- a/server/proxy/streamwriter_test.go +++ b/server/proxy/logstream_test.go @@ -11,7 +11,7 @@ import ( ) type logServer struct { - logs []byte + logs interface{} } func (ls *logServer) Send(response *v1.LogsResponse) error { @@ -34,8 +34,7 @@ func (ls *logServer) Context() context.Context { } func (ls *logServer) SendMsg(m interface{}) error { - s, _ := m.(*v1.LogsResponse) - ls.logs = s.Logs + ls.logs = m return nil } @@ -43,14 +42,17 @@ func (ls *logServer) RecvMsg(m interface{}) error { return nil } -func TestStreamWriter(t *testing.T) { +func TestLogStreamWriter(t *testing.T) { ls := &logServer{} sw := newStreamWriter(ls) in := []byte{104, 101, 108, 108, 111} + expected := &v1.LogsResponse{ + Value: in, + } l, err := sw.Write(in) assert.Nil(t, err) assert.Equal(t, len(in), l) - assert.Equal(t, in, ls.logs) + assert.Equal(t, expected, ls.logs) } diff --git a/server/proxy/proxy.go b/server/proxy/proxy.go index 7f160e45..809a36a3 100644 --- a/server/proxy/proxy.go +++ b/server/proxy/proxy.go @@ -2,8 +2,11 @@ package proxy import ( "context" + "sync" "github.com/docker/api/client" + containersv1 "github.com/docker/api/protos/containers/v1" + streamsv1 "github.com/docker/api/protos/streams/v1" ) type clientKey struct{} @@ -18,3 +21,22 @@ func Client(ctx context.Context) *client.Client { c, _ := ctx.Value(clientKey{}).(*client.Client) return c } + +// Proxy implements the gRPC server and forwards the actions +// to the right backend +type Proxy interface { + containersv1.ContainersServer + streamsv1.StreamingServer +} + +type proxy struct { + mu sync.Mutex + streams map[string]*Stream +} + +// New creates a new proxy server +func New() Proxy { + return &proxy{ + streams: map[string]*Stream{}, + } +} diff --git a/server/proxy/streams.go b/server/proxy/streams.go new file mode 100644 index 00000000..60acb9c6 --- /dev/null +++ b/server/proxy/streams.go @@ -0,0 +1,118 @@ +package proxy + +import ( + "sync" + + "github.com/containerd/containerd/log" + "github.com/golang/protobuf/ptypes" + "github.com/google/uuid" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + + streamsv1 "github.com/docker/api/protos/streams/v1" +) + +// Stream is a bidirectional stream for container IO +type Stream struct { + streamsv1.Streaming_NewStreamServer + + errm sync.Mutex + errChan chan<- error +} + +// CloseWithError sends the result of an action to the errChan or nil +// if no erros +func (s *Stream) CloseWithError(err error) error { + s.errm.Lock() + defer s.errm.Unlock() + + if s.errChan != nil { + if err != nil { + s.errChan <- err + } + close(s.errChan) + s.errChan = nil + } + return nil +} + +func (p *proxy) NewStream(stream streamsv1.Streaming_NewStreamServer) error { + var ( + ctx = stream.Context() + id = uuid.New().String() + ) + md := metadata.New(map[string]string{ + "id": id, + }) + + // return the id of the stream to the client + if err := stream.SendHeader(md); err != nil { + return err + } + + errc := make(chan error) + + p.mu.Lock() + p.streams[id] = &Stream{ + Streaming_NewStreamServer: stream, + errChan: errc, + } + p.mu.Unlock() + + defer func() { + p.mu.Lock() + delete(p.streams, id) + p.mu.Unlock() + }() + + select { + case err := <-errc: + return err + case <-ctx.Done(): + log.G(ctx).Debug("client context canceled") + return ctx.Err() + } +} + +// io.Reader that forwards everything to the stream +type reader struct { + stream *Stream +} + +func (r reader) Read(p []byte) (int, error) { + a, err := r.stream.Recv() + if err != nil { + return 0, err + } + + var m streamsv1.BytesMessage + err = ptypes.UnmarshalAny(a, &m) + if err != nil { + return 0, err + } + + return copy(p, m.Value), nil +} + +// io.Writer that writes +type writer struct { + stream grpc.ServerStream +} + +func (w *writer) Write(p []byte) (n int, err error) { + if len(p) == 0 { + return 0, nil + } + + message := streamsv1.BytesMessage{ + Type: streamsv1.IOStream_STDOUT, + Value: p, + } + + m, err := ptypes.MarshalAny(&message) + if err != nil { + return 0, err + } + + return len(message.Value), w.stream.SendMsg(m) +} diff --git a/server/proxy/streams_test.go b/server/proxy/streams_test.go new file mode 100644 index 00000000..2b5b2212 --- /dev/null +++ b/server/proxy/streams_test.go @@ -0,0 +1,119 @@ +package proxy + +import ( + "context" + "errors" + "testing" + + "google.golang.org/grpc/metadata" + + "github.com/golang/protobuf/ptypes" + "github.com/golang/protobuf/ptypes/any" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + streamsv1 "github.com/docker/api/protos/streams/v1" +) + +type byteStream struct { + recvResult *any.Any + recvErr error + + sendResult interface{} +} + +func (bs *byteStream) SetHeader(metadata.MD) error { + return nil +} + +func (bs *byteStream) SendHeader(metadata.MD) error { + return nil +} + +func (bs *byteStream) SetTrailer(metadata.MD) { +} + +func (bs *byteStream) Context() context.Context { + return nil +} + +func (bs *byteStream) SendMsg(m interface{}) error { + bs.sendResult = m + return nil +} + +func (bs *byteStream) Send(*any.Any) error { + return nil +} + +func (bs *byteStream) Recv() (*any.Any, error) { + return bs.recvResult, bs.recvErr +} + +func (bs *byteStream) RecvMsg(m interface{}) error { + return nil +} + +func getReader(t *testing.T, in []byte, errResult error) reader { + message := streamsv1.BytesMessage{ + Type: streamsv1.IOStream_STDOUT, + Value: in, + } + m, err := ptypes.MarshalAny(&message) + require.Nil(t, err) + + return reader{ + stream: &Stream{ + Streaming_NewStreamServer: &byteStream{ + recvResult: m, + recvErr: errResult, + }, + }, + } +} + +func getAny(t *testing.T, data []byte) *any.Any { + in := []byte{104, 101, 108, 108, 111} + value, err := ptypes.MarshalAny(&streamsv1.BytesMessage{ + Type: streamsv1.IOStream_STDOUT, + Value: in, + }) + require.Nil(t, err) + return value +} + +func TestStreamReader(t *testing.T) { + in := []byte{104, 101, 108, 108, 111} + r := getReader(t, in, nil) + buffer := make([]byte, 5) + + n, err := r.Read(buffer) + + assert.Nil(t, err) + assert.Equal(t, 5, n) + assert.Equal(t, in, buffer) +} + +func TestStreamReaderError(t *testing.T) { + errResult := errors.New("err") + r := getReader(t, nil, errResult) + var buffer []byte + + n, err := r.Read(buffer) + + assert.Equal(t, 0, n) + assert.Equal(t, err, errResult) +} + +func TestStreamWriter(t *testing.T) { + in := []byte{104, 101, 108, 108, 111} + expected := getAny(t, in) + + bs := byteStream{} + w := writer{stream: &bs} + + n, err := w.Write(in) + assert.Nil(t, err) + assert.Equal(t, len(in), n) + assert.Equal(t, expected, bs.sendResult) +} From 71087c68beded72363e5845f9b03a8751a9ab6dc Mon Sep 17 00:00:00 2001 From: Djordje Lukic Date: Fri, 5 Jun 2020 16:29:08 +0200 Subject: [PATCH 2/2] Add exec.ts for an example of exec over gRPC --- server/proxy/streams_test.go | 3 +- server/proxy/streamwriter.go | 23 --------- tests/node-client/build.sh | 8 +++- tests/node-client/exec.ts | 85 ++++++++++++++++++++++++++++++++++ tests/node-client/package.json | 3 +- tests/node-client/types.d.ts | 1 + tests/node-client/yarn.lock | 5 ++ 7 files changed, 100 insertions(+), 28 deletions(-) delete mode 100644 server/proxy/streamwriter.go create mode 100644 tests/node-client/exec.ts create mode 100644 tests/node-client/types.d.ts diff --git a/server/proxy/streams_test.go b/server/proxy/streams_test.go index 2b5b2212..90c6ae5d 100644 --- a/server/proxy/streams_test.go +++ b/server/proxy/streams_test.go @@ -72,8 +72,7 @@ func getReader(t *testing.T, in []byte, errResult error) reader { } } -func getAny(t *testing.T, data []byte) *any.Any { - in := []byte{104, 101, 108, 108, 111} +func getAny(t *testing.T, in []byte) *any.Any { value, err := ptypes.MarshalAny(&streamsv1.BytesMessage{ Type: streamsv1.IOStream_STDOUT, Value: in, diff --git a/server/proxy/streamwriter.go b/server/proxy/streamwriter.go deleted file mode 100644 index 8cd9718c..00000000 --- a/server/proxy/streamwriter.go +++ /dev/null @@ -1,23 +0,0 @@ -package proxy - -import ( - "io" - - v1 "github.com/docker/api/protos/containers/v1" -) - -type streamWriter struct { - stream v1.Containers_LogsServer -} - -func newStreamWriter(stream v1.Containers_LogsServer) io.Writer { - return &streamWriter{ - stream: stream, - } -} - -func (w *streamWriter) Write(p []byte) (n int, err error) { - return len(p), w.stream.SendMsg(&v1.LogsResponse{ - Logs: p, - }) -} diff --git a/tests/node-client/build.sh b/tests/node-client/build.sh index 44b87408..66e80a56 100755 --- a/tests/node-client/build.sh +++ b/tests/node-client/build.sh @@ -3,8 +3,10 @@ node_modules/.bin/grpc_tools_node_protoc \ --grpc_out=generate_package_definition:./grpc \ -I ../../protos/contexts/v1 \ -I ../../protos/containers/v1 \ + -I ../../protos/streams/v1 \ ../../protos/contexts/v1/*.proto \ - ../../protos/containers/v1/*.proto + ../../protos/containers/v1/*.proto \ + ../../protos/streams/v1/*.proto # generate d.ts codes protoc \ @@ -12,5 +14,7 @@ protoc \ --ts_out=generate_package_definition:./grpc \ -I ../../protos/contexts/v1 \ -I ../../protos/containers/v1 \ + -I ../../protos/streams/v1 \ ../../protos/contexts/v1/*.proto \ - ../../protos/containers/v1/*.proto + ../../protos/containers/v1/*.proto \ + ../../protos/streams/v1/*.proto diff --git a/tests/node-client/exec.ts b/tests/node-client/exec.ts new file mode 100644 index 00000000..9e657f48 --- /dev/null +++ b/tests/node-client/exec.ts @@ -0,0 +1,85 @@ +import * as grpc from "@grpc/grpc-js"; +import * as readline from "readline"; +import * as google_protobuf_any_pb from "google-protobuf/google/protobuf/any_pb.js"; + +import * as continersPb from "./grpc/containers_grpc_pb"; +import { IContainersClient } from "./grpc/containers_grpc_pb"; +import { ExecRequest, ExecResponse, LogsRequest } from "./grpc/containers_pb"; + +import * as streamsPb from "./grpc/streams_grpc_pb"; +import { IStreamingClient } from "./grpc/streams_grpc_pb"; +import { BytesMessage } from "./grpc/streams_pb"; + +let address = process.argv[3] || "unix:///tmp/backend.sock"; + +const ContainersServiceClient = grpc.makeClientConstructor( + continersPb["com.docker.api.protos.containers.v1.Containers"], + "ContainersClient" +); + +const client = (new ContainersServiceClient( + address, + grpc.credentials.createInsecure() +) as unknown) as IContainersClient; + +const StreamsServiceClient = grpc.makeClientConstructor( + streamsPb["com.docker.api.protos.streams.v1.Streaming"], + "StreamsClient" +); + +let streamClient = (new StreamsServiceClient( + address, + grpc.credentials.createInsecure() +) as unknown) as IStreamingClient; + +let backend = process.argv[2] || "moby"; +let containerId = process.argv[3]; +const meta = new grpc.Metadata(); +meta.set("CONTEXT_KEY", backend); + +// Get the stream +const stream = streamClient.newStream(); + +stream.on("metadata", (m: grpc.Metadata) => { + let req = new ExecRequest(); + req.setCommand("/bin/bash"); + req.setStreamId(m.get("id")[0] as string); + req.setId(containerId); + req.setTty(true); + + client.exec(req, meta, (err: any, _: ExecResponse) => { + if (err != null) { + console.error(err); + return; + } + process.exit(); + }); +}); + +readline.emitKeypressEvents(process.stdin); +process.stdin.setRawMode(true); + +process.stdin.on("keypress", (str, key) => { + const mess = new BytesMessage(); + const a = new Uint8Array(key.sequence.length); + for (let i = 0; i <= key.sequence.length; i++) { + a[i] = key.sequence.charCodeAt(i); + } + + mess.setValue(a); + + const any = new google_protobuf_any_pb.Any(); + any.pack( + mess.serializeBinary(), + "type.googleapis.com/com.docker.api.protos.streams.v1.BytesMessage" + ); + stream.write(any); +}); + +stream.on("data", (chunk: any) => { + const m = chunk.unpack( + BytesMessage.deserializeBinary, + "com.docker.api.protos.streams.v1.BytesMessage" + ) as BytesMessage; + process.stdout.write(m.getValue()); +}); diff --git a/tests/node-client/package.json b/tests/node-client/package.json index 91f01166..0da3f59d 100644 --- a/tests/node-client/package.json +++ b/tests/node-client/package.json @@ -6,12 +6,13 @@ "scripts": { "start": "ts-node index.ts", "prestart": "./build.sh" - }, + }, "dependencies": { "@grpc/grpc-js": "^1.0.3", "grpc": "^1.24.2", "grpc-tools": "^1.8.1", "grpc_tools_node_protoc_ts": "^3.0.0", + "readline": "^1.3.0", "ts-node": "^8.9.1", "typescript": "^3.8.3" } diff --git a/tests/node-client/types.d.ts b/tests/node-client/types.d.ts new file mode 100644 index 00000000..bcf05fe0 --- /dev/null +++ b/tests/node-client/types.d.ts @@ -0,0 +1 @@ +declare module "google-protobuf/google/protobuf/any_pb.js"; diff --git a/tests/node-client/yarn.lock b/tests/node-client/yarn.lock index 467f9935..5f0ba9a4 100644 --- a/tests/node-client/yarn.lock +++ b/tests/node-client/yarn.lock @@ -1653,6 +1653,11 @@ readable-stream@^2.0.6, readable-stream@~2.3.6: string_decoder "~1.1.1" util-deprecate "~1.0.1" +readline@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/readline/-/readline-1.3.0.tgz#c580d77ef2cfc8752b132498060dc9793a7ac01c" + integrity sha1-xYDXfvLPyHUrEySYBg3JeTp6wBw= + regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c"