containers.proto 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. //
  2. // Copyright 2020 Docker, Inc.
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. // http://www.apache.org/licenses/LICENSE-2.0
  7. // Unless required by applicable law or agreed to in writing, software
  8. // distributed under the License is distributed on an "AS IS" BASIS,
  9. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. // See the License for the specific language governing permissions and
  11. // limitations under the License.
  12. syntax = "proto3";
  13. package com.docker.api.protos.containers.v1;
  14. option go_package = "github.com/docker/api/protos/containers/v1;v1";
  15. service Containers {
  16. rpc List(ListRequest) returns (ListResponse);
  17. rpc Stop(StopRequest) returns (StopResponse);
  18. rpc Run(RunRequest) returns (RunResponse);
  19. rpc Exec(ExecRequest) returns (ExecResponse);
  20. rpc Logs(LogsRequest) returns (stream LogsResponse);
  21. rpc Delete(DeleteRequest) returns (DeleteResponse);
  22. rpc Inspect(InspectRequest) returns (InspectResponse);
  23. }
  24. message Port {
  25. uint32 host_port = 1;
  26. uint32 container_port = 2;
  27. string protocol = 3;
  28. string host_ip = 4;
  29. }
  30. message Container {
  31. string id = 1;
  32. string image = 2;
  33. string status = 3;
  34. string command = 4;
  35. uint64 cpu_time = 5;
  36. uint64 memory_usage = 6;
  37. uint64 memory_limit = 7;
  38. uint64 pids_current = 8;
  39. uint64 pids_limit = 9;
  40. repeated string labels = 10;
  41. repeated Port ports = 11;
  42. uint64 cpu_limit = 12;
  43. }
  44. message InspectRequest {
  45. string id = 1;
  46. }
  47. message InspectResponse {
  48. Container container = 1;
  49. }
  50. message DeleteRequest {
  51. string id = 1;
  52. bool force = 2;
  53. }
  54. message DeleteResponse {
  55. }
  56. message StopRequest {
  57. string id = 1;
  58. uint32 timeout = 2;
  59. }
  60. message StopResponse {
  61. }
  62. message RunRequest {
  63. string id = 1;
  64. string image = 2;
  65. repeated Port ports = 3;
  66. map<string, string> labels = 4;
  67. repeated string volumes = 5;
  68. uint64 memory_limit = 6;
  69. uint64 cpu_limit = 7;
  70. }
  71. message RunResponse {
  72. }
  73. message ExecRequest {
  74. string id = 1;
  75. string command = 2;
  76. string stream_id = 3;
  77. repeated string args = 4;
  78. repeated string env = 5;
  79. bool tty = 6;
  80. }
  81. message ExecResponse {
  82. bytes output = 1;
  83. }
  84. message ListRequest {
  85. bool all = 1;
  86. }
  87. message ListResponse {
  88. repeated Container containers = 1;
  89. }
  90. message LogsRequest {
  91. string container_id = 1;
  92. bool follow = 3;
  93. }
  94. message LogsResponse {
  95. bytes value = 1;
  96. }