containers.proto 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. //
  2. // Copyright 2020 Docker Compose CLI authors
  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/compose-cli/cli/server/protos/containers/v1;v1";
  15. service Containers {
  16. rpc List(ListRequest) returns (ListResponse);
  17. rpc Start(StartRequest) returns (StartResponse);
  18. rpc Stop(StopRequest) returns (StopResponse);
  19. rpc Kill(KillRequest) returns (KillResponse);
  20. rpc Run(RunRequest) returns (RunResponse);
  21. rpc Exec(ExecRequest) returns (ExecResponse);
  22. rpc Logs(LogsRequest) returns (stream LogsResponse);
  23. rpc Delete(DeleteRequest) returns (DeleteResponse);
  24. rpc Inspect(InspectRequest) returns (InspectResponse);
  25. }
  26. message Port {
  27. uint32 host_port = 1;
  28. uint32 container_port = 2;
  29. string protocol = 3;
  30. string host_ip = 4;
  31. }
  32. message Container {
  33. string id = 1;
  34. string image = 2;
  35. string status = 3;
  36. string command = 4;
  37. uint64 cpu_time = 5;
  38. uint64 memory_usage = 6;
  39. uint64 pids_current = 8;
  40. uint64 pids_limit = 9;
  41. repeated string labels = 10;
  42. repeated Port ports = 11;
  43. string platform = 13;
  44. HostConfig host_config = 15;
  45. Healthcheck healthcheck = 16;
  46. }
  47. message HostConfig {
  48. uint64 memory_reservation = 1;
  49. uint64 memory_limit = 2;
  50. uint64 cpu_reservation = 3;
  51. uint64 cpu_limit = 4;
  52. string restart_policy = 5;
  53. bool auto_remove = 6;
  54. }
  55. message Healthcheck {
  56. bool disable = 1;
  57. repeated string test = 2;
  58. int64 interval = 3;
  59. }
  60. message InspectRequest {
  61. string id = 1;
  62. }
  63. message InspectResponse {
  64. Container container = 1;
  65. }
  66. message DeleteRequest {
  67. string id = 1;
  68. bool force = 2;
  69. }
  70. message DeleteResponse {
  71. }
  72. message StartRequest {
  73. string id = 1;
  74. }
  75. message StartResponse {
  76. }
  77. message StopRequest {
  78. string id = 1;
  79. uint32 timeout = 2;
  80. }
  81. message StopResponse {
  82. }
  83. message KillRequest {
  84. string id = 1;
  85. string signal = 2;
  86. }
  87. message KillResponse {
  88. }
  89. message RunRequest {
  90. string id = 1;
  91. string image = 2;
  92. repeated Port ports = 3;
  93. map<string, string> labels = 4;
  94. repeated string volumes = 5;
  95. uint64 memory_limit = 6;
  96. uint64 cpu_limit = 7;
  97. string restart_policy_condition = 8;
  98. repeated string command = 9;
  99. repeated string environment = 10;
  100. bool auto_remove = 11;
  101. Healthcheck healthcheck = 12;
  102. string platform = 13;
  103. }
  104. message RunResponse {
  105. }
  106. message ExecRequest {
  107. string id = 1;
  108. string command = 2;
  109. string stream_id = 3;
  110. repeated string args = 4;
  111. repeated string env = 5;
  112. bool tty = 6;
  113. }
  114. message ExecResponse {
  115. bytes output = 1;
  116. }
  117. message ListRequest {
  118. bool all = 1;
  119. }
  120. message ListResponse {
  121. repeated Container containers = 1;
  122. }
  123. message LogsRequest {
  124. string container_id = 1;
  125. bool follow = 3;
  126. }
  127. message LogsResponse {
  128. bytes value = 1;
  129. }