123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554 |
- syntax = "proto3";
- package docker.swarmkit.v1;
- import "specs.proto";
- import "objects.proto";
- import "types.proto";
- import "gogoproto/gogo.proto";
- import "plugin/plugin.proto";
- // Control defines the RPC methods for controlling a cluster.
- service Control {
- rpc GetNode(GetNodeRequest) returns (GetNodeResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- rpc ListNodes(ListNodesRequest) returns (ListNodesResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- rpc UpdateNode(UpdateNodeRequest) returns (UpdateNodeResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- rpc RemoveNode(RemoveNodeRequest) returns (RemoveNodeResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- rpc GetTask(GetTaskRequest) returns (GetTaskResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- rpc RemoveTask(RemoveTaskRequest) returns (RemoveTaskResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- rpc GetService(GetServiceRequest) returns (GetServiceResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- rpc CreateService(CreateServiceRequest) returns (CreateServiceResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- rpc UpdateService(UpdateServiceRequest) returns (UpdateServiceResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- rpc RemoveService(RemoveServiceRequest) returns (RemoveServiceResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- rpc GetNetwork(GetNetworkRequest) returns (GetNetworkResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- rpc ListNetworks(ListNetworksRequest) returns (ListNetworksResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- rpc CreateNetwork(CreateNetworkRequest) returns (CreateNetworkResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- rpc RemoveNetwork(RemoveNetworkRequest) returns (RemoveNetworkResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- rpc GetCluster(GetClusterRequest) returns (GetClusterResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- rpc UpdateCluster(UpdateClusterRequest) returns (UpdateClusterResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- // --- secret APIs ---
- // GetSecret returns a `GetSecretResponse` with a `Secret` with the same
- // id as `GetSecretRequest.SecretID`
- // - Returns `NotFound` if the Secret with the given id is not found.
- // - Returns `InvalidArgument` if the `GetSecretRequest.SecretID` is empty.
- // - Returns an error if getting fails.
- rpc GetSecret(GetSecretRequest) returns (GetSecretResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- }
- // UpdateSecret returns a `UpdateSecretResponse` with a `Secret` with the same
- // id as `GetSecretRequest.SecretID`
- // - Returns `NotFound` if the Secret with the given id is not found.
- // - Returns `InvalidArgument` if the `GetSecretRequest.SecretID` is empty.
- // - Returns an error if updating fails.
- rpc UpdateSecret(UpdateSecretRequest) returns (UpdateSecretResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- // ListSecrets returns a `ListSecretResponse` with a list of all non-internal `Secret`s being
- // managed, or all secrets matching any name in `ListSecretsRequest.Names`, any
- // name prefix in `ListSecretsRequest.NamePrefixes`, any id in
- // `ListSecretsRequest.SecretIDs`, or any id prefix in `ListSecretsRequest.IDPrefixes`.
- // - Returns an error if listing fails.
- rpc ListSecrets(ListSecretsRequest) returns (ListSecretsResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- }
- // CreateSecret creates and return a `CreateSecretResponse` with a `Secret` based
- // on the provided `CreateSecretRequest.SecretSpec`.
- // - Returns `InvalidArgument` if the `CreateSecretRequest.SecretSpec` is malformed,
- // or if the secret data is too long or contains invalid characters.
- // - Returns an error if the creation fails.
- rpc CreateSecret(CreateSecretRequest) returns (CreateSecretResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- }
- // RemoveSecret removes the secret referenced by `RemoveSecretRequest.ID`.
- // - Returns `InvalidArgument` if `RemoveSecretRequest.ID` is empty.
- // - Returns `NotFound` if the a secret named `RemoveSecretRequest.ID` is not found.
- // - Returns an error if the deletion fails.
- rpc RemoveSecret(RemoveSecretRequest) returns (RemoveSecretResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- }
- // --- config APIs ---
- // GetConfig returns a `GetConfigResponse` with a `Config` with the same
- // id as `GetConfigRequest.ConfigID`
- // - Returns `NotFound` if the Config with the given id is not found.
- // - Returns `InvalidArgument` if the `GetConfigRequest.ConfigID` is empty.
- // - Returns an error if getting fails.
- rpc GetConfig(GetConfigRequest) returns (GetConfigResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- }
- // UpdateConfig returns a `UpdateConfigResponse` with a `Config` with the same
- // id as `GetConfigRequest.ConfigID`
- // - Returns `NotFound` if the Config with the given id is not found.
- // - Returns `InvalidArgument` if the `GetConfigRequest.ConfigID` is empty.
- // - Returns an error if updating fails.
- rpc UpdateConfig(UpdateConfigRequest) returns (UpdateConfigResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- };
- // ListConfigs returns a `ListConfigResponse` with a list of `Config`s being
- // managed, or all configs matching any name in `ListConfigsRequest.Names`, any
- // name prefix in `ListConfigsRequest.NamePrefixes`, any id in
- // `ListConfigsRequest.ConfigIDs`, or any id prefix in `ListConfigsRequest.IDPrefixes`.
- // - Returns an error if listing fails.
- rpc ListConfigs(ListConfigsRequest) returns (ListConfigsResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- }
- // CreateConfig creates and return a `CreateConfigResponse` with a `Config` based
- // on the provided `CreateConfigRequest.ConfigSpec`.
- // - Returns `InvalidArgument` if the `CreateConfigRequest.ConfigSpec` is malformed,
- // or if the config data is too long or contains invalid characters.
- // - Returns an error if the creation fails.
- rpc CreateConfig(CreateConfigRequest) returns (CreateConfigResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- }
- // RemoveConfig removes the config referenced by `RemoveConfigRequest.ID`.
- // - Returns `InvalidArgument` if `RemoveConfigRequest.ID` is empty.
- // - Returns `NotFound` if the a config named `RemoveConfigRequest.ID` is not found.
- // - Returns an error if the deletion fails.
- rpc RemoveConfig(RemoveConfigRequest) returns (RemoveConfigResponse) {
- option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
- }
- }
- message GetNodeRequest {
- string node_id = 1;
- }
- message GetNodeResponse {
- Node node = 1;
- }
- message ListNodesRequest {
- message Filters {
- repeated string names = 1;
- repeated string id_prefixes = 2;
- map<string, string> labels = 3;
- repeated NodeSpec.Membership memberships = 4 [packed=false];
- repeated NodeRole roles = 5 [packed=false];
- // NamePrefixes matches all objects with the given prefixes
- repeated string name_prefixes = 6;
- }
- Filters filters = 1;
- }
- message ListNodesResponse {
- repeated Node nodes = 1;
- }
- // UpdateNodeRequest requests an update to the specified node. This may be used
- // to request a new availability for a node, such as PAUSE. Invalid updates
- // will be denied and cause an error.
- message UpdateNodeRequest {
- string node_id = 1;
- Version node_version = 2;
- NodeSpec spec = 3;
- }
- message UpdateNodeResponse {
- Node node = 1;
- }
- // RemoveNodeRequest requests to delete the specified node from store.
- message RemoveNodeRequest {
- string node_id = 1;
- bool force = 2;
- }
- message RemoveNodeResponse {
- }
- message GetTaskRequest {
- string task_id = 1;
- }
- message GetTaskResponse {
- Task task = 1;
- }
- message RemoveTaskRequest {
- string task_id = 1;
- }
- message RemoveTaskResponse {
- }
- message ListTasksRequest {
- message Filters {
- repeated string names = 1;
- repeated string id_prefixes = 2;
- map<string, string> labels = 3;
- repeated string service_ids = 4;
- repeated string node_ids = 5;
- repeated docker.swarmkit.v1.TaskState desired_states = 6 [packed=false];
- // NamePrefixes matches all objects with the given prefixes
- repeated string name_prefixes = 7;
- repeated string runtimes = 9;
- // UpToDate matches tasks that are consistent with the current
- // service definition.
- // Note: this is intended for internal status reporting rather
- // than being exposed to users. It may be removed in the future.
- bool up_to_date = 8;
- }
- Filters filters = 1;
- }
- message ListTasksResponse {
- repeated Task tasks = 1;
- }
- message CreateServiceRequest {
- ServiceSpec spec = 1;
- }
- message CreateServiceResponse {
- Service service = 1;
- }
- message GetServiceRequest {
- string service_id = 1;
- bool insert_defaults = 2;
- }
- message GetServiceResponse {
- Service service = 1;
- }
- message UpdateServiceRequest {
- string service_id = 1;
- Version service_version = 2;
- ServiceSpec spec = 3;
- enum Rollback {
- // This is not a rollback. The spec field of the request will
- // be honored.
- NONE = 0;
- // Roll back the service - get spec from the service's
- // previous_spec.
- PREVIOUS = 1;
- }
- // Rollback may be set to PREVIOUS to request a rollback (the service's
- // spec will be set to the value of its previous_spec field). In this
- // case, the spec field of this request is ignored.
- Rollback rollback = 4;
- }
- message UpdateServiceResponse {
- Service service = 1;
- }
- message RemoveServiceRequest {
- string service_id = 1;
- }
- message RemoveServiceResponse {
- }
- message ListServicesRequest {
- message Filters {
- repeated string names = 1;
- repeated string id_prefixes = 2;
- map<string, string> labels = 3;
- // NamePrefixes matches all objects with the given prefixes
- repeated string name_prefixes = 4;
- repeated string runtimes = 5;
- }
- Filters filters = 1;
- }
- message ListServicesResponse {
- repeated Service services = 1;
- }
- message CreateNetworkRequest {
- NetworkSpec spec = 1;
- }
- message CreateNetworkResponse {
- Network network = 1;
- }
- message GetNetworkRequest {
- string name = 1;
- string network_id = 2;
- }
- message GetNetworkResponse {
- Network network = 1;
- }
- message RemoveNetworkRequest {
- string name = 1;
- string network_id = 2;
- }
- message RemoveNetworkResponse {}
- message ListNetworksRequest {
- message Filters {
- repeated string names = 1;
- repeated string id_prefixes = 2;
- map<string, string> labels = 3;
- // NamePrefixes matches all objects with the given prefixes
- repeated string name_prefixes = 4;
- }
- Filters filters = 1;
- }
- message ListNetworksResponse {
- repeated Network networks = 1;
- }
- message GetClusterRequest {
- string cluster_id = 1;
- }
- message GetClusterResponse {
- Cluster cluster = 1;
- }
- message ListClustersRequest {
- message Filters {
- repeated string names = 1;
- repeated string id_prefixes = 2;
- map<string, string> labels = 3;
- // NamePrefixes matches all objects with the given prefixes
- repeated string name_prefixes = 4;
- }
- Filters filters = 1;
- }
- message ListClustersResponse {
- repeated Cluster clusters = 1;
- }
- // KeyRotation tells UpdateCluster what items to rotate
- message KeyRotation {
- // WorkerJoinToken tells UpdateCluster to rotate the worker secret token.
- bool worker_join_token = 1;
- // ManagerJoinToken tells UpdateCluster to rotate the manager secret token.
- bool manager_join_token = 2;
- // ManagerUnlockKey tells UpdateCluster to rotate the manager unlock key
- bool manager_unlock_key = 3;
- }
- message UpdateClusterRequest {
- // ClusterID is the cluster ID to update.
- string cluster_id = 1;
- // ClusterVersion is the version of the cluster being updated.
- Version cluster_version = 2;
- // Spec is the new spec to apply to the cluster.
- ClusterSpec spec = 3;
- // Rotation contains flags for join token and unlock key rotation
- KeyRotation rotation = 4 [(gogoproto.nullable) = false];
- }
- message UpdateClusterResponse {
- Cluster cluster = 1;
- }
- // GetSecretRequest is the request to get a `Secret` object given a secret id.
- message GetSecretRequest {
- string secret_id = 1;
- }
- // GetSecretResponse contains the Secret corresponding to the id in
- // `GetSecretRequest`, but the `Secret.Spec.Data` field in each `Secret`
- // object should be nil instead of actually containing the secret bytes.
- message GetSecretResponse {
- Secret secret = 1;
- }
- message UpdateSecretRequest {
- // SecretID is the secret ID to update.
- string secret_id = 1;
- // SecretVersion is the version of the secret being updated.
- Version secret_version = 2;
- // Spec is the new spec to apply to the Secret
- // Only some fields are allowed to be updated.
- SecretSpec spec = 3;
- }
- message UpdateSecretResponse {
- Secret secret = 1;
- }
- // ListSecretRequest is the request to list all non-internal secrets in the secret store,
- // or all secrets filtered by (name or name prefix or id prefix) and labels.
- message ListSecretsRequest {
- message Filters {
- repeated string names = 1;
- repeated string id_prefixes = 2;
- map<string, string> labels = 3;
- repeated string name_prefixes = 4;
- }
- Filters filters = 1;
- }
- // ListSecretResponse contains a list of all the secrets that match the name or
- // name prefix filters provided in `ListSecretRequest`. The `Secret.Spec.Data`
- // field in each `Secret` object should be nil instead of actually containing
- // the secret bytes.
- message ListSecretsResponse {
- repeated Secret secrets = 1;
- }
- // CreateSecretRequest specifies a new secret (it will not update an existing
- // secret) to create.
- message CreateSecretRequest {
- SecretSpec spec = 1;
- }
- // CreateSecretResponse contains the newly created `Secret` corresponding to the
- // name in `CreateSecretRequest`. The `Secret.Spec.Data` field should be nil instead
- // of actually containing the secret bytes.
- message CreateSecretResponse {
- Secret secret = 1;
- }
- // RemoveSecretRequest contains the ID of the secret that should be removed. This
- // removes all versions of the secret.
- message RemoveSecretRequest {
- string secret_id = 1;
- }
- // RemoveSecretResponse is an empty object indicating the successful removal of
- // a secret.
- message RemoveSecretResponse {}
- // GetConfigRequest is the request to get a `Config` object given a config id.
- message GetConfigRequest {
- string config_id = 1;
- }
- // GetConfigResponse contains the Config corresponding to the id in
- // `GetConfigRequest`.
- message GetConfigResponse {
- Config config = 1;
- }
- message UpdateConfigRequest {
- // ConfigID is the config ID to update.
- string config_id = 1;
- // ConfigVersion is the version of the config being updated.
- Version config_version = 2;
- // Spec is the new spec to apply to the Config
- // Only some fields are allowed to be updated.
- ConfigSpec spec = 3;
- }
- message UpdateConfigResponse {
- Config config = 1;
- }
- // ListConfigRequest is the request to list all configs in the config store,
- // or all configs filtered by (name or name prefix or id prefix) and labels.
- message ListConfigsRequest {
- message Filters {
- repeated string names = 1;
- repeated string id_prefixes = 2;
- map<string, string> labels = 3;
- repeated string name_prefixes = 4;
- }
- Filters filters = 1;
- }
- // ListConfigResponse contains a list of all the configs that match the name or
- // name prefix filters provided in `ListConfigRequest`.
- message ListConfigsResponse {
- repeated Config configs = 1;
- }
- // CreateConfigRequest specifies a new config (it will not update an existing
- // config) to create.
- message CreateConfigRequest {
- ConfigSpec spec = 1;
- }
- // CreateConfigResponse contains the newly created `Config` corresponding to the
- // name in `CreateConfigRequest`.
- message CreateConfigResponse {
- Config config = 1;
- }
- // RemoveConfigRequest contains the ID of the config that should be removed. This
- // removes all versions of the config.
- message RemoveConfigRequest {
- string config_id = 1;
- }
- // RemoveConfigResponse is an empty object indicating the successful removal of
- // a config.
- message RemoveConfigResponse {}
|