github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/swarmkit/api/control.proto (about)

     1  syntax = "proto3";
     2  
     3  package docker.swarmkit.v1;
     4  
     5  import "github.com/docker/swarmkit/api/specs.proto";
     6  import "github.com/docker/swarmkit/api/objects.proto";
     7  import "github.com/docker/swarmkit/api/types.proto";
     8  import "gogoproto/gogo.proto";
     9  import "google/protobuf/any.proto";
    10  import "github.com/docker/swarmkit/protobuf/plugin/plugin.proto";
    11  
    12  // Control defines the RPC methods for controlling a cluster.
    13  service Control {
    14  	rpc GetNode(GetNodeRequest) returns (GetNodeResponse) {
    15  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    16  	};
    17  	rpc ListNodes(ListNodesRequest) returns (ListNodesResponse) {
    18  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    19  	};
    20  	rpc UpdateNode(UpdateNodeRequest) returns (UpdateNodeResponse) {
    21  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    22  	};
    23  	rpc RemoveNode(RemoveNodeRequest) returns (RemoveNodeResponse) {
    24  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    25  	};
    26  
    27  	rpc GetTask(GetTaskRequest) returns (GetTaskResponse) {
    28  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    29  	};
    30  	rpc ListTasks(ListTasksRequest) returns (ListTasksResponse) {
    31  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    32  	};
    33  	rpc RemoveTask(RemoveTaskRequest) returns (RemoveTaskResponse) {
    34  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    35  	};
    36  
    37  	rpc GetService(GetServiceRequest) returns (GetServiceResponse) {
    38  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    39  	};
    40  	rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {
    41  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    42  	};
    43  	rpc CreateService(CreateServiceRequest) returns (CreateServiceResponse) {
    44  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    45  	};
    46  	rpc UpdateService(UpdateServiceRequest) returns (UpdateServiceResponse) {
    47  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    48  	};
    49  	rpc RemoveService(RemoveServiceRequest) returns (RemoveServiceResponse) {
    50  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    51  	};
    52  
    53  	// ListServiceStatuses returns a `ListServiceStatusesResponse` with the
    54  	// status of the requested services, formed by computing the number of
    55  	// running vs desired tasks. It is provided as a shortcut or helper method,
    56  	// which allows a client to avoid having to calculate this value by listing
    57  	// all Tasks. If any service requested does not exist, it will be returned
    58  	// but with empty status values.
    59  	rpc ListServiceStatuses(ListServiceStatusesRequest) returns (ListServiceStatusesResponse) {
    60  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    61  	};
    62  
    63  	rpc GetNetwork(GetNetworkRequest) returns (GetNetworkResponse) {
    64  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    65  	};
    66  	rpc ListNetworks(ListNetworksRequest) returns (ListNetworksResponse) {
    67  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    68  	};
    69  	rpc CreateNetwork(CreateNetworkRequest) returns (CreateNetworkResponse) {
    70  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    71  	};
    72  	rpc RemoveNetwork(RemoveNetworkRequest) returns (RemoveNetworkResponse) {
    73  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    74  	};
    75  
    76  	rpc GetCluster(GetClusterRequest) returns (GetClusterResponse) {
    77  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    78  	};
    79  	rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) {
    80  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    81  	};
    82  	rpc UpdateCluster(UpdateClusterRequest) returns (UpdateClusterResponse) {
    83  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    84  	};
    85  
    86  	// --- secret APIs ---
    87  
    88  	// GetSecret returns a `GetSecretResponse` with a `Secret` with the same
    89  	// id as `GetSecretRequest.SecretID`
    90  	// - Returns `NotFound` if the Secret with the given id is not found.
    91  	// - Returns `InvalidArgument` if the `GetSecretRequest.SecretID` is empty.
    92  	// - Returns an error if getting fails.
    93  	rpc GetSecret(GetSecretRequest) returns (GetSecretResponse) {
    94  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
    95  	}
    96  
    97  	// UpdateSecret returns a `UpdateSecretResponse` with a `Secret` with the same
    98  	// id as `GetSecretRequest.SecretID`
    99  	// - Returns `NotFound` if the Secret with the given id is not found.
   100  	// - Returns `InvalidArgument` if the `GetSecretRequest.SecretID` is empty.
   101  	// - Returns an error if updating fails.
   102  	rpc UpdateSecret(UpdateSecretRequest) returns (UpdateSecretResponse) {
   103  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
   104  	};
   105  
   106  	// ListSecrets returns a `ListSecretResponse` with a list of all non-internal `Secret`s being
   107  	// managed, or all secrets matching any name in `ListSecretsRequest.Names`, any
   108  	// name prefix in `ListSecretsRequest.NamePrefixes`, any id in
   109  	// `ListSecretsRequest.SecretIDs`, or any id prefix in `ListSecretsRequest.IDPrefixes`.
   110  	// - Returns an error if listing fails.
   111  	rpc ListSecrets(ListSecretsRequest) returns (ListSecretsResponse) {
   112  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
   113  	}
   114  	// CreateSecret creates and return a `CreateSecretResponse` with a `Secret` based
   115  	// on the provided `CreateSecretRequest.SecretSpec`.
   116  	// - Returns `InvalidArgument` if the `CreateSecretRequest.SecretSpec` is malformed,
   117  	//   or if the secret data is too long or contains invalid characters.
   118  	// - Returns an error if the creation fails.
   119  	rpc CreateSecret(CreateSecretRequest) returns (CreateSecretResponse) {
   120  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
   121  	}
   122  
   123  	// RemoveSecret removes the secret referenced by `RemoveSecretRequest.ID`.
   124  	// - Returns `InvalidArgument` if `RemoveSecretRequest.ID` is empty.
   125  	// - Returns `NotFound` if the a secret named `RemoveSecretRequest.ID` is not found.
   126  	// - Returns an error if the deletion fails.
   127  	rpc RemoveSecret(RemoveSecretRequest) returns (RemoveSecretResponse) {
   128  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
   129  	}
   130  
   131  	// --- config APIs ---
   132  
   133  	// GetConfig returns a `GetConfigResponse` with a `Config` with the same
   134  	// id as `GetConfigRequest.ConfigID`
   135  	// - Returns `NotFound` if the Config with the given id is not found.
   136  	// - Returns `InvalidArgument` if the `GetConfigRequest.ConfigID` is empty.
   137  	// - Returns an error if getting fails.
   138  	rpc GetConfig(GetConfigRequest) returns (GetConfigResponse) {
   139  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
   140  	}
   141  
   142  	// UpdateConfig returns a `UpdateConfigResponse` with a `Config` with the same
   143  	// id as `GetConfigRequest.ConfigID`
   144  	// - Returns `NotFound` if the Config with the given id is not found.
   145  	// - Returns `InvalidArgument` if the `GetConfigRequest.ConfigID` is empty.
   146  	// - Returns an error if updating fails.
   147  	rpc UpdateConfig(UpdateConfigRequest) returns (UpdateConfigResponse) {
   148  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
   149  	};
   150  
   151  	// ListConfigs returns a `ListConfigResponse` with a list of `Config`s being
   152  	// managed, or all configs matching any name in `ListConfigsRequest.Names`, any
   153  	// name prefix in `ListConfigsRequest.NamePrefixes`, any id in
   154  	// `ListConfigsRequest.ConfigIDs`, or any id prefix in `ListConfigsRequest.IDPrefixes`.
   155  	// - Returns an error if listing fails.
   156  	rpc ListConfigs(ListConfigsRequest) returns (ListConfigsResponse) {
   157  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
   158  	}
   159  	// CreateConfig creates and return a `CreateConfigResponse` with a `Config` based
   160  	// on the provided `CreateConfigRequest.ConfigSpec`.
   161  	// - Returns `InvalidArgument` if the `CreateConfigRequest.ConfigSpec` is malformed,
   162  	//   or if the config data is too long or contains invalid characters.
   163  	// - Returns an error if the creation fails.
   164  	rpc CreateConfig(CreateConfigRequest) returns (CreateConfigResponse) {
   165  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
   166  	}
   167  
   168  	// RemoveConfig removes the config referenced by `RemoveConfigRequest.ID`.
   169  	// - Returns `InvalidArgument` if `RemoveConfigRequest.ID` is empty.
   170  	// - Returns `NotFound` if the a config named `RemoveConfigRequest.ID` is not found.
   171  	// - Returns an error if the deletion fails.
   172  	rpc RemoveConfig(RemoveConfigRequest) returns (RemoveConfigResponse) {
   173  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
   174  	}
   175  
   176  	// --- extension APIs ---
   177  
   178  	// GetExtension returns a `GetExtensionResponse` with a `Extension` with the same
   179  	// id as `GetExtensionRequest.ExtensionId`
   180  	// - Returns `NotFound` if the Extension with the given id is not found.
   181  	// - Returns `InvalidArgument` if the `GetExtensionRequest.ExtensionId` is empty.
   182  	// - Returns an error if the get fails.
   183  	rpc GetExtension(GetExtensionRequest) returns (GetExtensionResponse) {
   184  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
   185  	}
   186  
   187  	// CreateExtension creates an `Extension` based on the provided `CreateExtensionRequest.Extension`
   188  	// and returns a `CreateExtensionResponse`.
   189  	// - Returns `InvalidArgument` if the `CreateExtensionRequest.Extension` is malformed,
   190  	//   or fails validation.
   191  	// - Returns an error if the creation fails.
   192  	rpc CreateExtension(CreateExtensionRequest) returns (CreateExtensionResponse) {
   193  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
   194  	}
   195  
   196  	// RemoveExtension removes the extension referenced by `RemoveExtensionRequest.ID`.
   197  	// - Returns `InvalidArgument` if `RemoveExtensionRequest.ExtensionId` is empty.
   198  	// - Returns `NotFound` if the an extension named `RemoveExtensionRequest.ExtensionId` is not found.
   199  	// - Returns an error if the deletion fails.
   200  	rpc RemoveExtension(RemoveExtensionRequest) returns (RemoveExtensionResponse) {
   201  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
   202  	}
   203  
   204  	// --- resource APIs ---
   205  
   206  	// GetResource returns a `GetResourceResponse` with a `Resource` with the same
   207  	// id as `GetResourceRequest.Resource`
   208  	// - Returns `NotFound` if the Resource with the given id is not found.
   209  	// - Returns `InvalidArgument` if the `GetResourceRequest.Resource` is empty.
   210  	// - Returns an error if getting fails.
   211  	rpc GetResource(GetResourceRequest) returns (GetResourceResponse) {
   212  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
   213  	}
   214  
   215  	// UpdateResource updates the resource with the given `UpdateResourceRequest.Resource.Id` using the given `UpdateResourceRequest.Resource` and returns a `UpdateResourceResponse`.
   216  	// - Returns `NotFound` if the Resource with the given `UpdateResourceRequest.Resource.Id` is not found.
   217  	// - Returns `InvalidArgument` if the UpdateResourceRequest.Resource.Id` is empty.
   218  	// - Returns an error if updating fails.
   219  	rpc UpdateResource(UpdateResourceRequest) returns (UpdateResourceResponse) {
   220  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
   221  	}
   222  
   223  	// ListResources returns a `ListResourcesResponse` with a list of `Resource`s stored in the raft store,
   224  	// or all resources matching any name in `ListConfigsRequest.Names`, any
   225  	// name prefix in `ListResourcesRequest.NamePrefixes`, any id in
   226  	// `ListResourcesRequest.ResourceIDs`, or any id prefix in `ListResourcesRequest.IDPrefixes`,
   227  	// extension name equal to `ListResourcesRequest.Extension`.
   228  	// - Returns an error if listing fails.
   229  	rpc ListResources(ListResourcesRequest) returns (ListResourcesResponse) {
   230  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
   231  	}
   232  
   233  	// CreateResource returns a `CreateResourceResponse` after creating a `Resource` based
   234  	// on the provided `CreateResourceRequest.Resource`.
   235  	// - Returns `InvalidArgument` if the `CreateResourceRequest.Resource` is malformed,
   236  	//   or if the config data is too long or contains invalid characters.
   237  	// - Returns an error if the creation fails.
   238  	rpc CreateResource(CreateResourceRequest) returns (CreateResourceResponse) {
   239  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
   240  	}
   241  
   242  	// RemoveResource removes the `Resource` referenced by `RemoveResourceRequest.ResourceID`.
   243  	// - Returns `InvalidArgument` if `RemoveResourceRequest.ResourceID` is empty.
   244  	// - Returns `NotFound` if the a resource named `RemoveResourceRequest.ResourceID` is not found.
   245  	// - Returns an error if the deletion fails.
   246  	rpc RemoveResource(RemoveResourceRequest) returns (RemoveResourceResponse) {
   247  		option (docker.protobuf.plugin.tls_authorization) = { roles: "swarm-manager" };
   248  	}
   249  }
   250  
   251  message GetNodeRequest {
   252  	string node_id = 1;
   253  }
   254  
   255  message GetNodeResponse {
   256  	Node node = 1;
   257  }
   258  
   259  message ListNodesRequest {
   260  	message Filters {
   261  		repeated string names = 1;
   262  		repeated string id_prefixes = 2;
   263  		// Labels refers to engine labels, which are labels set by the user on the
   264  		// node and reported back to the managers
   265  		map<string, string> labels = 3;
   266  		// NodeLabels are labels set on the node object on the managers.
   267  		map<string, string> node_labels = 7;
   268  		repeated NodeSpec.Membership memberships = 4 [packed=false];
   269  		repeated NodeRole roles = 5 [packed=false];
   270  		// NamePrefixes matches all objects with the given prefixes
   271  		repeated string name_prefixes = 6;
   272  	}
   273  
   274  	Filters filters = 1;
   275  }
   276  
   277  message ListNodesResponse {
   278  	repeated Node nodes = 1;
   279  }
   280  
   281  // UpdateNodeRequest requests an update to the specified node. This may be used
   282  // to request a new availability for a node, such as PAUSE. Invalid updates
   283  // will be denied and cause an error.
   284  message UpdateNodeRequest {
   285  	string node_id = 1;
   286  	Version node_version = 2;
   287  	NodeSpec spec = 3;
   288  }
   289  
   290  message UpdateNodeResponse {
   291  	Node node = 1;
   292  }
   293  
   294  // RemoveNodeRequest requests to delete the specified node from store.
   295  message RemoveNodeRequest {
   296  	string node_id = 1;
   297  	bool force = 2;
   298  }
   299  
   300  message RemoveNodeResponse {
   301  }
   302  
   303  message GetTaskRequest {
   304  	string task_id = 1;
   305  }
   306  
   307  message GetTaskResponse {
   308  	Task task = 1;
   309  }
   310  
   311  message RemoveTaskRequest {
   312  	string task_id = 1;
   313  }
   314  
   315  message RemoveTaskResponse {
   316  }
   317  
   318  message ListTasksRequest {
   319  	message Filters {
   320  		repeated string names = 1;
   321  		repeated string id_prefixes = 2;
   322  		map<string, string> labels = 3;
   323  		repeated string service_ids = 4;
   324  		repeated string node_ids = 5;
   325  		repeated docker.swarmkit.v1.TaskState desired_states = 6 [packed=false];
   326  		// NamePrefixes matches all objects with the given prefixes
   327  		repeated string name_prefixes = 7;
   328  		repeated string runtimes = 9;
   329  
   330  		// UpToDate matches tasks that are consistent with the current
   331  		// service definition.
   332  		// Note: this is intended for internal status reporting rather
   333  		// than being exposed to users. It may be removed in the future.
   334  		bool up_to_date = 8;
   335  	}
   336  
   337  	Filters filters = 1;
   338  }
   339  
   340  message ListTasksResponse {
   341  	repeated Task tasks = 1;
   342  }
   343  
   344  message CreateServiceRequest {
   345  	ServiceSpec spec = 1;
   346  }
   347  
   348  message CreateServiceResponse {
   349  	Service service = 1;
   350  }
   351  
   352  message GetServiceRequest {
   353  	string service_id = 1;
   354  	bool insert_defaults = 2;
   355  }
   356  
   357  message GetServiceResponse {
   358  	Service service = 1;
   359  }
   360  
   361  message UpdateServiceRequest {
   362  	string service_id = 1;
   363  	Version service_version = 2;
   364  	ServiceSpec spec = 3;
   365  
   366  	enum Rollback {
   367  		// This is not a rollback. The spec field of the request will
   368  		// be honored.
   369  		NONE = 0;
   370  
   371  		// Roll back the service - get spec from the service's
   372  		// previous_spec.
   373  		PREVIOUS = 1;
   374  	}
   375  
   376  	// Rollback may be set to PREVIOUS to request a rollback (the service's
   377  	// spec will be set to the value of its previous_spec field). In this
   378  	// case, the spec field of this request is ignored.
   379  	Rollback rollback = 4;
   380  }
   381  
   382  message UpdateServiceResponse {
   383  	Service service = 1;
   384  }
   385  
   386  message RemoveServiceRequest {
   387  	string service_id = 1;
   388  }
   389  
   390  message RemoveServiceResponse {
   391  }
   392  
   393  message ListServicesRequest {
   394  	message Filters {
   395  		repeated string names = 1;
   396  		repeated string id_prefixes = 2;
   397  		map<string, string> labels = 3;
   398  		// NamePrefixes matches all objects with the given prefixes
   399  		repeated string name_prefixes = 4;
   400  		repeated string runtimes = 5;
   401  	}
   402  
   403  	Filters filters = 1;
   404  }
   405  
   406  message ListServicesResponse {
   407  	repeated Service services = 1;
   408  }
   409  
   410  // ListServiceStatusesRequest is a request to get the aggregate status of a
   411  // service by computing the number of running vs desired tasks. It includes
   412  // only a service ID.
   413  message ListServiceStatusesRequest {
   414  	// Services is a list of service IDs to get statuses for.
   415  	repeated string services = 1;
   416  }
   417  
   418  // ListServiceStatusesResponse is a response containing the aggregate status of
   419  // a service, formed by computing the number of running vs desired tasks. The
   420  // values returned are only valid for the point in time at which the request is
   421  // made.
   422  message ListServiceStatusesResponse {
   423  	message ServiceStatus {
   424  		// ServiceID is the ID of the service this status describes
   425  		string service_id = 1;
   426  
   427  		// DesiredTasks is the number of tasks desired to be running according to the
   428  		// service definition at request time. It is a uint64 because that is what
   429  		// the replicas field on the service spec is
   430  		uint64 desired_tasks = 2;
   431  		
   432  		// RunningTasks is the number of tasks currently in the Running state at
   433  		// request time. This may be larger than desired tasks if, for example, a
   434  		// service has been scaled down.
   435  		uint64 running_tasks = 3;
   436  
   437  		// CompletedTasks is the number of tasks in state Completed, if this
   438  		// service is in mode ReplicatedJob or GlobalJob. This must be
   439  		// cross-referenced with the service type, because the default value of 0
   440  		// may mean that a service is not in a Job mode, or it may mean the Job has
   441  		// yet to complete any Tasks.
   442  		uint64 completed_tasks = 4;
   443  	}
   444  
   445  	repeated ServiceStatus statuses = 1;
   446  }
   447  
   448  message CreateNetworkRequest {
   449  	NetworkSpec spec = 1;
   450  }
   451  
   452  message CreateNetworkResponse {
   453  	Network network = 1;
   454  }
   455  
   456  message GetNetworkRequest {
   457  	string name = 1;
   458  	string network_id = 2;
   459  }
   460  
   461  message GetNetworkResponse {
   462  	Network network = 1;
   463  }
   464  
   465  message RemoveNetworkRequest {
   466  	string name = 1;
   467  	string network_id = 2;
   468  }
   469  
   470  message RemoveNetworkResponse {}
   471  
   472  message ListNetworksRequest {
   473  	message Filters {
   474  		repeated string names = 1;
   475  		repeated string id_prefixes = 2;
   476  		map<string, string> labels = 3;
   477  		// NamePrefixes matches all objects with the given prefixes
   478  		repeated string name_prefixes = 4;
   479  	}
   480  
   481  	Filters filters = 1;
   482  }
   483  
   484  message ListNetworksResponse {
   485  	repeated Network networks = 1;
   486  }
   487  
   488  message GetClusterRequest {
   489  	string cluster_id = 1;
   490  }
   491  
   492  message GetClusterResponse {
   493  	Cluster cluster = 1;
   494  }
   495  
   496  message ListClustersRequest {
   497  	message Filters {
   498  		repeated string names = 1;
   499  		repeated string id_prefixes = 2;
   500  		map<string, string> labels = 3;
   501  		// NamePrefixes matches all objects with the given prefixes
   502  		repeated string name_prefixes = 4;
   503  	}
   504  
   505  	Filters filters = 1;
   506  }
   507  
   508  message ListClustersResponse {
   509  	repeated Cluster clusters = 1;
   510  }
   511  
   512  // KeyRotation tells UpdateCluster what items to rotate
   513  message KeyRotation {
   514  	// WorkerJoinToken tells UpdateCluster to rotate the worker secret token.
   515  	bool worker_join_token = 1;
   516  
   517  	// ManagerJoinToken tells UpdateCluster to rotate the manager secret token.
   518  	bool manager_join_token = 2;
   519  
   520  	// ManagerUnlockKey tells UpdateCluster to rotate the manager unlock key
   521  	bool manager_unlock_key = 3;
   522  
   523  }
   524  
   525  message UpdateClusterRequest {
   526  	// ClusterID is the cluster ID to update.
   527  	string cluster_id = 1;
   528  
   529  	// ClusterVersion is the version of the cluster being updated.
   530  	Version cluster_version = 2;
   531  
   532  	// Spec is the new spec to apply to the cluster.
   533  	ClusterSpec spec = 3;
   534  
   535  	// Rotation contains flags for join token and unlock key rotation
   536  	KeyRotation rotation = 4 [(gogoproto.nullable) = false];
   537  }
   538  
   539  message UpdateClusterResponse {
   540  	Cluster cluster = 1;
   541  }
   542  
   543  // GetSecretRequest is the request to get a `Secret` object given a secret id.
   544  message GetSecretRequest {
   545  	string secret_id = 1;
   546  }
   547  
   548  // GetSecretResponse contains the Secret corresponding to the id in
   549  // `GetSecretRequest`, but the `Secret.Spec.Data` field in each `Secret`
   550  // object should be nil instead of actually containing the secret bytes.
   551  message GetSecretResponse {
   552  	Secret secret = 1;
   553  }
   554  
   555  message UpdateSecretRequest {
   556  	// SecretID is the secret ID to update.
   557  	string secret_id = 1;
   558  
   559  	// SecretVersion is the version of the secret being updated.
   560  	Version secret_version = 2;
   561  
   562  	// Spec is the new spec to apply to the Secret
   563  	// Only some fields are allowed to be updated.
   564  	SecretSpec spec = 3;
   565  }
   566  
   567  message UpdateSecretResponse {
   568  	Secret secret = 1;
   569  }
   570  
   571  // ListSecretRequest is the request to list all non-internal secrets in the secret store,
   572  // or all secrets filtered by (name or name prefix or id prefix) and labels.
   573  message ListSecretsRequest {
   574  	message Filters {
   575  		repeated string names = 1;
   576  		repeated string id_prefixes = 2;
   577  		map<string, string> labels = 3;
   578  		repeated string name_prefixes = 4;
   579  	}
   580  
   581  	Filters filters = 1;
   582  }
   583  
   584  // ListSecretResponse contains a list of all the secrets that match the name or
   585  // name prefix filters provided in `ListSecretRequest`.  The `Secret.Spec.Data`
   586  // field in each `Secret` object should be nil instead of actually containing
   587  // the secret bytes.
   588  message ListSecretsResponse {
   589  	repeated Secret secrets = 1;
   590  }
   591  
   592  // CreateSecretRequest specifies a new secret (it will not update an existing
   593  // secret) to create.
   594  message CreateSecretRequest {
   595  	SecretSpec spec = 1;
   596  }
   597  
   598  // CreateSecretResponse contains the newly created `Secret` corresponding to the
   599  // name in `CreateSecretRequest`.  The `Secret.Spec.Data` field should be nil instead
   600  // of actually containing the secret bytes.
   601  message CreateSecretResponse {
   602  	Secret secret = 1;
   603  }
   604  
   605  // RemoveSecretRequest contains the ID of the secret that should be removed.  This
   606  // removes all versions of the secret.
   607  message RemoveSecretRequest {
   608  	string secret_id = 1;
   609  }
   610  
   611  // RemoveSecretResponse is an empty object indicating the successful removal of
   612  // a secret.
   613  message RemoveSecretResponse {}
   614  
   615  // GetConfigRequest is the request to get a `Config` object given a config id.
   616  message GetConfigRequest {
   617  	string config_id = 1;
   618  }
   619  
   620  // GetConfigResponse contains the Config corresponding to the id in
   621  // `GetConfigRequest`.
   622  message GetConfigResponse {
   623  	Config config = 1;
   624  }
   625  
   626  message UpdateConfigRequest {
   627  	// ConfigID is the config ID to update.
   628  	string config_id = 1;
   629  
   630  	// ConfigVersion is the version of the config being updated.
   631  	Version config_version = 2;
   632  
   633  	// Spec is the new spec to apply to the Config
   634  	// Only some fields are allowed to be updated.
   635  	ConfigSpec spec = 3;
   636  }
   637  
   638  message UpdateConfigResponse {
   639  	Config config = 1;
   640  }
   641  
   642  // ListConfigRequest is the request to list all configs in the config store,
   643  // or all configs filtered by (name or name prefix or id prefix) and labels.
   644  message ListConfigsRequest {
   645  	message Filters {
   646  		repeated string names = 1;
   647  		repeated string id_prefixes = 2;
   648  		map<string, string> labels = 3;
   649  		repeated string name_prefixes = 4;
   650  	}
   651  
   652  	Filters filters = 1;
   653  }
   654  
   655  // ListConfigResponse contains a list of all the configs that match the name or
   656  // name prefix filters provided in `ListConfigRequest`.
   657  message ListConfigsResponse {
   658  	repeated Config configs = 1;
   659  }
   660  
   661  // CreateConfigRequest specifies a new config (it will not update an existing
   662  // config) to create.
   663  message CreateConfigRequest {
   664  	ConfigSpec spec = 1;
   665  }
   666  
   667  // CreateConfigResponse contains the newly created `Config` corresponding to the
   668  // name in `CreateConfigRequest`.
   669  message CreateConfigResponse {
   670  	Config config = 1;
   671  }
   672  
   673  // RemoveConfigRequest contains the ID of the config that should be removed.  This
   674  // removes all versions of the config.
   675  message RemoveConfigRequest {
   676  	string config_id = 1;
   677  }
   678  
   679  // RemoveConfigResponse is an empty object indicating the successful removal of
   680  // a config.
   681  message RemoveConfigResponse {}
   682  
   683  // CreateExtensionRequest creates a new extension as specified by the provided
   684  // parameters
   685  message CreateExtensionRequest {
   686  	Annotations annotations = 1;
   687  	string description = 2;
   688  }
   689  
   690  // CreateExtensionResponse contains the newly created `Extension` corresponding
   691  // to the parameters in the CreateExtensionRequest.
   692  message CreateExtensionResponse {
   693  	Extension extension = 1;
   694  }
   695  
   696  // RemoveExtensionRequest contains the ID of the extension that should be removed. This
   697  // removes all versions of the extension.
   698  message RemoveExtensionRequest {
   699  	string extension_id = 1;
   700  }
   701  
   702  // RemoveExtensionResponse is an empty object indicating the successful removal
   703  // of an extension.
   704  message RemoveExtensionResponse {
   705  }
   706  
   707  // GetResourceRequest is the request to get a Extension object given a extension id.
   708  message GetExtensionRequest {
   709  	string extension_id = 1;
   710  }
   711  
   712  // GetExtensionResponse contains the Extension corresponding to the id in
   713  // `GetExtensionRequest`.
   714  message GetExtensionResponse {
   715  	Extension extension = 1;
   716  }
   717  
   718  // CreateResourceRequest creates a new resource specified by the included
   719  // resource object. An existing resource will not be updated.
   720  message CreateResourceRequest {
   721  	Annotations annotations = 1;
   722  	string kind = 2;
   723  	google.protobuf.Any payload = 3;
   724  }
   725  
   726  // CreateResourceResponse contains the newly created `Resource` corresponding
   727  // to the resource in the CreateResourceRequest.
   728  message CreateResourceResponse {
   729  	Resource resource = 1;
   730  }
   731  
   732  // RemoveResourceRequest contains the ID of the resource that should be removed. This
   733  // removes all versions of the resource.
   734  message RemoveResourceRequest {
   735  	string resource_id = 1;
   736  }
   737  
   738  // RemoveResourceResponse is an empty object indicating the successful removal
   739  // of a resource.
   740  message RemoveResourceResponse {
   741  }
   742  
   743  // UpdateResourceRequest updates the resource specified by the given resource object.
   744  message UpdateResourceRequest {
   745  	string resource_id = 1;
   746  	Version resource_version = 2;
   747  	// Annotations describes the annotations to update. If the Annotations should
   748  	// be unchanged, then this field should be left empty. Note that the name of
   749  	// a Resource cannot be changed, only its labels.
   750  	Annotations annotations = 3;
   751  	// Payload describes the new payload of the resource. If the Payload should
   752  	// be unchanged, then this field should be left empty.
   753  	google.protobuf.Any payload = 4;
   754  }
   755  
   756  message UpdateResourceResponse {
   757  	Resource resource = 1;
   758  }
   759  
   760  // GetResourceRequest is the request to get a Resource object given a resource id.
   761  message GetResourceRequest {
   762  	string resource_id = 1;
   763  }
   764  
   765  // GetResourceResponse contains the Resource corresponding to the id in
   766  // `GetResourceRequest`.
   767  message GetResourceResponse {
   768  	Resource resource = 1;
   769  }
   770  
   771  // ListResourcesRequest is the request to list all resources in the raft store,
   772  // or all resources filtered by (name or name prefix or id prefix), labels and extension.
   773  message ListResourcesRequest {
   774  	message Filters {
   775  		repeated string names = 1;
   776  		repeated string id_prefixes = 2;
   777  		map<string, string> labels = 3;
   778  		repeated string name_prefixes = 4;
   779  		string kind = 5;
   780  	}
   781  
   782  	Filters filters = 1;
   783  }
   784  
   785  // ListResourcesResponse contains a list of all the resources that match the name or
   786  // name prefix filters provided in `ListResourcesRequest`.
   787  message ListResourcesResponse {
   788  	repeated Resource resources = 1;
   789  }