/vendor/src/github.com/docker/swarmkit/api/control.proto

https://gitlab.com/vectorci/docker-1 · Protocol Buffers · 295 lines · 224 code · 55 blank · 16 comment · 0 complexity · cff7bde86409cbc04818319bf436b398 MD5 · raw file

  1. syntax = "proto3";
  2. package docker.swarmkit.v1;
  3. import "specs.proto";
  4. import "objects.proto";
  5. import "types.proto";
  6. import "gogoproto/gogo.proto";
  7. import "plugin/plugin.proto";
  8. // Control defines the RPC methods for controlling a cluster.
  9. service Control {
  10. rpc GetNode(GetNodeRequest) returns (GetNodeResponse) {
  11. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  12. };
  13. rpc ListNodes(ListNodesRequest) returns (ListNodesResponse) {
  14. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  15. };
  16. rpc UpdateNode(UpdateNodeRequest) returns (UpdateNodeResponse) {
  17. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  18. };
  19. rpc RemoveNode(RemoveNodeRequest) returns (RemoveNodeResponse) {
  20. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  21. };
  22. rpc GetTask(GetTaskRequest) returns (GetTaskResponse) {
  23. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  24. };
  25. rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) {
  26. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  27. };
  28. rpc RemoveTask(RemoveTaskRequest) returns (RemoveTaskResponse) {
  29. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  30. };
  31. rpc GetService(GetServiceRequest) returns (GetServiceResponse) {
  32. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  33. };
  34. rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {
  35. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  36. };
  37. rpc CreateService(CreateServiceRequest) returns (CreateServiceResponse) {
  38. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  39. };
  40. rpc UpdateService(UpdateServiceRequest) returns (UpdateServiceResponse) {
  41. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  42. };
  43. rpc RemoveService(RemoveServiceRequest) returns (RemoveServiceResponse) {
  44. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  45. };
  46. rpc GetNetwork(GetNetworkRequest) returns (GetNetworkResponse) {
  47. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  48. };
  49. rpc ListNetworks(ListNetworksRequest) returns (ListNetworksResponse) {
  50. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  51. };
  52. rpc CreateNetwork(CreateNetworkRequest) returns (CreateNetworkResponse) {
  53. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  54. };
  55. rpc RemoveNetwork(RemoveNetworkRequest) returns (RemoveNetworkResponse) {
  56. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  57. };
  58. rpc GetCluster(GetClusterRequest) returns (GetClusterResponse) {
  59. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  60. };
  61. rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) {
  62. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  63. };
  64. rpc UpdateCluster(UpdateClusterRequest) returns (UpdateClusterResponse) {
  65. option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
  66. };
  67. }
  68. message GetNodeRequest {
  69. string node_id = 1 [(gogoproto.customname) = "NodeID"];
  70. }
  71. message GetNodeResponse {
  72. Node node = 1;
  73. }
  74. message ListNodesRequest {
  75. message Filters {
  76. repeated string names = 1;
  77. repeated string id_prefixes = 2 [(gogoproto.customname) = "IDPrefixes"];
  78. map<string, string> labels = 3;
  79. repeated NodeSpec.Membership memberships = 4;
  80. repeated NodeRole roles = 5;
  81. // NamePrefixes matches all objects with the given prefixes
  82. repeated string name_prefixes = 6;
  83. }
  84. Filters filters = 1;
  85. }
  86. message ListNodesResponse {
  87. repeated Node nodes = 1;
  88. }
  89. // UpdateNodeRequest requests an update to the specified node. This may be used
  90. // to request a new availability for a node, such as PAUSE. Invalid updates
  91. // will be denied and cause an error.
  92. message UpdateNodeRequest {
  93. string node_id = 1 [(gogoproto.customname) = "NodeID"];
  94. Version node_version = 2;
  95. NodeSpec spec = 3;
  96. }
  97. message UpdateNodeResponse {
  98. Node node = 1;
  99. }
  100. // RemoveNodeRequest requests to delete the specified node from store.
  101. message RemoveNodeRequest {
  102. string node_id = 1 [(gogoproto.customname) = "NodeID"];
  103. bool force = 2;
  104. }
  105. message RemoveNodeResponse {
  106. }
  107. message GetTaskRequest {
  108. string task_id = 1 [(gogoproto.customname) = "TaskID"];
  109. }
  110. message GetTaskResponse {
  111. Task task = 1;
  112. }
  113. message RemoveTaskRequest {
  114. string task_id = 1 [(gogoproto.customname) = "TaskID"];
  115. }
  116. message RemoveTaskResponse {
  117. }
  118. message ListTasksRequest {
  119. message Filters {
  120. repeated string names = 1;
  121. repeated string id_prefixes = 2 [(gogoproto.customname) = "IDPrefixes"];
  122. map<string, string> labels = 3;
  123. repeated string service_ids = 4 [(gogoproto.customname) = "ServiceIDs"];
  124. repeated string node_ids = 5 [(gogoproto.customname) = "NodeIDs"];
  125. repeated docker.swarmkit.v1.TaskState desired_states = 6;
  126. // NamePrefixes matches all objects with the given prefixes
  127. repeated string name_prefixes = 7;
  128. }
  129. Filters filters = 1;
  130. }
  131. message ListTasksResponse {
  132. repeated Task tasks = 1;
  133. }
  134. message CreateServiceRequest {
  135. ServiceSpec spec = 1;
  136. }
  137. message CreateServiceResponse {
  138. Service service = 1;
  139. }
  140. message GetServiceRequest {
  141. string service_id = 1 [(gogoproto.customname) = "ServiceID"];
  142. }
  143. message GetServiceResponse {
  144. Service service = 1;
  145. }
  146. message UpdateServiceRequest {
  147. string service_id = 1 [(gogoproto.customname) = "ServiceID"];
  148. Version service_version = 2;
  149. ServiceSpec spec = 3;
  150. }
  151. message UpdateServiceResponse {
  152. Service service = 1;
  153. }
  154. message RemoveServiceRequest {
  155. string service_id = 1 [(gogoproto.customname) = "ServiceID"];
  156. }
  157. message RemoveServiceResponse {
  158. }
  159. message ListServicesRequest {
  160. message Filters {
  161. repeated string names = 1;
  162. repeated string id_prefixes = 2 [(gogoproto.customname) = "IDPrefixes"];
  163. map<string, string> labels = 3;
  164. // NamePrefixes matches all objects with the given prefixes
  165. repeated string name_prefixes = 4;
  166. }
  167. Filters filters = 1;
  168. }
  169. message ListServicesResponse {
  170. repeated Service services = 1;
  171. }
  172. message CreateNetworkRequest {
  173. NetworkSpec spec = 1;
  174. }
  175. message CreateNetworkResponse {
  176. Network network = 1;
  177. }
  178. message GetNetworkRequest {
  179. string name = 1;
  180. string network_id = 2 [(gogoproto.customname) = "NetworkID"];
  181. }
  182. message GetNetworkResponse {
  183. Network network = 1;
  184. }
  185. message RemoveNetworkRequest {
  186. string name = 1;
  187. string network_id = 2 [(gogoproto.customname) = "NetworkID"];
  188. }
  189. message RemoveNetworkResponse {}
  190. message ListNetworksRequest {
  191. message Filters {
  192. repeated string names = 1;
  193. repeated string id_prefixes = 2 [(gogoproto.customname) = "IDPrefixes"];
  194. map<string, string> labels = 3;
  195. // NamePrefixes matches all objects with the given prefixes
  196. repeated string name_prefixes = 4;
  197. }
  198. Filters filters = 1;
  199. }
  200. message ListNetworksResponse {
  201. repeated Network networks = 1;
  202. }
  203. message GetClusterRequest {
  204. string cluster_id = 1 [(gogoproto.customname) = "ClusterID"];
  205. }
  206. message GetClusterResponse {
  207. Cluster cluster = 1;
  208. }
  209. message ListClustersRequest {
  210. message Filters {
  211. repeated string names = 1;
  212. repeated string id_prefixes = 2 [(gogoproto.customname) = "IDPrefixes"];
  213. map<string, string> labels = 3;
  214. // NamePrefixes matches all objects with the given prefixes
  215. repeated string name_prefixes = 4;
  216. }
  217. Filters filters = 1;
  218. }
  219. message ListClustersResponse {
  220. repeated Cluster clusters = 1;
  221. }
  222. message JoinTokenRotation {
  223. // RotateWorkerToken tells UpdateCluster to rotate the worker secret.
  224. bool rotate_worker_token = 1;
  225. // RotateManagerSecret tells UpdateCluster to rotate the manager secret.
  226. bool rotate_manager_token = 2;
  227. }
  228. message UpdateClusterRequest {
  229. // ClusterID is the cluster ID to update.
  230. string cluster_id = 1 [(gogoproto.customname) = "ClusterID"];
  231. // ClusterVersion is the version of the cluster being updated.
  232. Version cluster_version = 2;
  233. // Spec is the new spec to apply to the cluster.
  234. ClusterSpec spec = 3;
  235. // Rotation contains flags for join token rotation
  236. JoinTokenRotation rotation = 4 [(gogoproto.nullable) = false];
  237. }
  238. message UpdateClusterResponse {
  239. Cluster cluster = 1;
  240. }