1- // Copyright 2021 Google LLC
1+ // Copyright 2022 Google LLC
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
@@ -20,7 +20,6 @@ import "google/api/annotations.proto";
2020import "google/api/client.proto" ;
2121import "google/api/field_behavior.proto" ;
2222import "google/longrunning/operations.proto" ;
23- import "google/protobuf/duration.proto" ;
2423import "google/protobuf/empty.proto" ;
2524import "google/protobuf/field_mask.proto" ;
2625import "google/storagetransfer/v1/transfer_types.proto" ;
@@ -38,19 +37,17 @@ option ruby_package = "Google::Cloud::StorageTransfer::V1";
3837// source external to Google to a Cloud Storage bucket.
3938service StorageTransferService {
4039 option (google.api.default_host ) = "storagetransfer.googleapis.com" ;
41- option (google.api.oauth_scopes ) =
42- "https://www.googleapis.com/auth/cloud-platform" ;
40+ option (google.api.oauth_scopes ) = "https://www.googleapis.com/auth/cloud-platform" ;
4341
4442 // Returns the Google service account that is used by Storage Transfer
4543 // Service to access buckets in the project where transfers
4644 // run or in other projects. Each Google service account is associated
47- // with one Google Cloud Platform Console project. Users
45+ // with one Google Cloud project. Users
4846 // should add this service account to the Google Cloud Storage bucket
4947 // ACLs to grant access to Storage Transfer Service. This service
5048 // account is created and owned by Storage Transfer Service and can
5149 // only be used by Storage Transfer Service.
52- rpc GetGoogleServiceAccount (GetGoogleServiceAccountRequest )
53- returns (GoogleServiceAccount ) {
50+ rpc GetGoogleServiceAccount (GetGoogleServiceAccountRequest ) returns (GoogleServiceAccount ) {
5451 option (google.api.http ) = {
5552 get : "/v1/googleServiceAccounts/{project_id}"
5653 };
@@ -67,8 +64,8 @@ service StorageTransferService {
6764 // Updates a transfer job. Updating a job's transfer spec does not affect
6865 // transfer operations that are running already.
6966 //
70- // **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status]
71- // field can be modified using this RPC (for example, to set a job's status to
67+ // **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status] field can be modified
68+ // using this RPC (for example, to set a job's status to
7269 // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED],
7370 // [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or
7471 // [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]).
@@ -87,25 +84,22 @@ service StorageTransferService {
8784 }
8885
8986 // Lists transfer jobs.
90- rpc ListTransferJobs (ListTransferJobsRequest )
91- returns (ListTransferJobsResponse ) {
87+ rpc ListTransferJobs (ListTransferJobsRequest ) returns (ListTransferJobsResponse ) {
9288 option (google.api.http ) = {
9389 get : "/v1/transferJobs"
9490 };
9591 }
9692
9793 // Pauses a transfer operation.
98- rpc PauseTransferOperation (PauseTransferOperationRequest )
99- returns (google.protobuf.Empty ) {
94+ rpc PauseTransferOperation (PauseTransferOperationRequest ) returns (google.protobuf.Empty ) {
10095 option (google.api.http ) = {
10196 post : "/v1/{name=transferOperations/**}:pause"
10297 body : "*"
10398 };
10499 }
105100
106101 // Resumes a transfer operation that is paused.
107- rpc ResumeTransferOperation (ResumeTransferOperationRequest )
108- returns (google.protobuf.Empty ) {
102+ rpc ResumeTransferOperation (ResumeTransferOperationRequest ) returns (google.protobuf.Empty ) {
109103 option (google.api.http ) = {
110104 post : "/v1/{name=transferOperations/**}:resume"
111105 body : "*"
@@ -114,9 +108,8 @@ service StorageTransferService {
114108
115109 // Attempts to start a new TransferOperation for the current TransferJob. A
116110 // TransferJob has a maximum of one active TransferOperation. If this method
117- // is called while a TransferOperation is active, an error wil be returned.
118- rpc RunTransferJob (RunTransferJobRequest )
119- returns (google.longrunning.Operation ) {
111+ // is called while a TransferOperation is active, an error will be returned.
112+ rpc RunTransferJob (RunTransferJobRequest ) returns (google.longrunning.Operation ) {
120113 option (google.api.http ) = {
121114 post : "/v1/{job_name=transferJobs/**}:run"
122115 body : "*"
@@ -126,12 +119,54 @@ service StorageTransferService {
126119 metadata_type : "TransferOperation"
127120 };
128121 }
122+
123+ // Creates an agent pool resource.
124+ rpc CreateAgentPool (CreateAgentPoolRequest ) returns (AgentPool ) {
125+ option (google.api.http ) = {
126+ post : "/v1/projects/{project_id=*}/agentPools"
127+ body : "agent_pool"
128+ };
129+ option (google.api.method_signature ) = "project_id,agent_pool,agent_pool_id" ;
130+ }
131+
132+ // Updates an existing agent pool resource.
133+ rpc UpdateAgentPool (UpdateAgentPoolRequest ) returns (AgentPool ) {
134+ option (google.api.http ) = {
135+ patch : "/v1/{agent_pool.name=projects/*/agentPools/*}"
136+ body : "agent_pool"
137+ };
138+ option (google.api.method_signature ) = "agent_pool,update_mask" ;
139+ }
140+
141+ // Gets an agent pool.
142+ rpc GetAgentPool (GetAgentPoolRequest ) returns (AgentPool ) {
143+ option (google.api.http ) = {
144+ get : "/v1/{name=projects/*/agentPools/*}"
145+ };
146+ option (google.api.method_signature ) = "name" ;
147+ }
148+
149+ // Lists agent pools.
150+ rpc ListAgentPools (ListAgentPoolsRequest ) returns (ListAgentPoolsResponse ) {
151+ option (google.api.http ) = {
152+ get : "/v1/projects/{project_id=*}/agentPools"
153+ };
154+ option (google.api.method_signature ) = "project_id" ;
155+ }
156+
157+ // Deletes an agent pool.
158+ rpc DeleteAgentPool (DeleteAgentPoolRequest ) returns (google.protobuf.Empty ) {
159+ option (google.api.http ) = {
160+ delete : "/v1/{name=projects/*/agentPools/*}"
161+ };
162+ option (google.api.method_signature ) = "name" ;
163+ }
129164}
130165
131166// Request passed to GetGoogleServiceAccount.
132167message GetGoogleServiceAccountRequest {
133- // Required. The ID of the Google Cloud Platform Console project that the
134- // Google service account is associated with.
168+ // Required. The ID of the Google Cloud project that the Google service
169+ // account is associated with.
135170 string project_id = 1 [(google.api.field_behavior ) = REQUIRED ];
136171}
137172
@@ -146,20 +181,19 @@ message UpdateTransferJobRequest {
146181 // Required. The name of job to update.
147182 string job_name = 1 [(google.api.field_behavior ) = REQUIRED ];
148183
149- // Required. The ID of the Google Cloud Platform Console project that owns the
184+ // Required. The ID of the Google Cloud project that owns the
150185 // job.
151186 string project_id = 2 [(google.api.field_behavior ) = REQUIRED ];
152187
153- // Required. The job to update. `transferJob` is expected to specify only
154- // four fields:
155- // [description][google.storagetransfer.v1.TransferJob.description],
188+ // Required. The job to update. `transferJob` is expected to specify one or more of
189+ // five fields: [description][google.storagetransfer.v1.TransferJob.description],
156190 // [transfer_spec][google.storagetransfer.v1.TransferJob.transfer_spec],
157191 // [notification_config][google.storagetransfer.v1.TransferJob.notification_config],
158- // and [status ][google.storagetransfer.v1.TransferJob.status]. An
159- // `UpdateTransferJobRequest` that specifies other fields are rejected with
160- // the error [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. Updating a
161- // job status to
162- // [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED] requires
192+ // [logging_config ][google.storagetransfer.v1.TransferJob.logging_config], and
193+ // [status][google.storagetransfer.v1.TransferJob.status]. An `UpdateTransferJobRequest` that specifies
194+ // other fields are rejected with the error
195+ // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. Updating a job status
196+ // to [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED] requires
163197 // `storagetransfer.jobs.delete` permissions.
164198 TransferJob transfer_job = 3 [(google.api.field_behavior ) = REQUIRED ];
165199
@@ -168,21 +202,20 @@ message UpdateTransferJobRequest {
168202 // [description][google.storagetransfer.v1.TransferJob.description],
169203 // [transfer_spec][google.storagetransfer.v1.TransferJob.transfer_spec],
170204 // [notification_config][google.storagetransfer.v1.TransferJob.notification_config],
171- // and [status ][google.storagetransfer.v1.TransferJob.status]. To update the
172- // `transfer_spec` of the job, a complete transfer specification must be
173- // provided. An incomplete specification missing any required fields is
174- // rejected with the error
205+ // [logging_config ][google.storagetransfer.v1.TransferJob.logging_config], and
206+ // [status][google.storagetransfer.v1.TransferJob.status]. To update the `transfer_spec` of the job, a
207+ // complete transfer specification must be provided. An incomplete
208+ // specification missing any required fields is rejected with the error
175209 // [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
176210 google.protobuf.FieldMask update_transfer_job_field_mask = 4 ;
177211}
178212
179213// Request passed to GetTransferJob.
180214message GetTransferJobRequest {
181- // Required.
182- // The job to get.
215+ // Required. The job to get.
183216 string job_name = 1 [(google.api.field_behavior ) = REQUIRED ];
184217
185- // Required. The ID of the Google Cloud Platform Console project that owns the
218+ // Required. The ID of the Google Cloud project that owns the
186219 // job.
187220 string project_id = 2 [(google.api.field_behavior ) = REQUIRED ];
188221}
@@ -237,7 +270,100 @@ message RunTransferJobRequest {
237270 // Required. The name of the transfer job.
238271 string job_name = 1 [(google.api.field_behavior ) = REQUIRED ];
239272
240- // Required. The ID of the Google Cloud Platform Console project that owns the
241- // transfer job.
273+ // Required. The ID of the Google Cloud project that owns the transfer
274+ // job.
242275 string project_id = 2 [(google.api.field_behavior ) = REQUIRED ];
243276}
277+
278+ // Specifies the request passed to CreateAgentPool.
279+ message CreateAgentPoolRequest {
280+ // Required. The ID of the Google Cloud project that owns the
281+ // agent pool.
282+ string project_id = 1 [(google.api.field_behavior ) = REQUIRED ];
283+
284+ // Required. The agent pool to create.
285+ AgentPool agent_pool = 2 [(google.api.field_behavior ) = REQUIRED ];
286+
287+ // Required. The ID of the agent pool to create.
288+ //
289+ // The `agent_pool_id` must meet the following requirements:
290+ //
291+ // * Length of 128 characters or less.
292+ // * Not start with the string `goog`.
293+ // * Start with a lowercase ASCII character, followed by:
294+ // * Zero or more: lowercase Latin alphabet characters, numerals,
295+ // hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`).
296+ // * One or more numerals or lowercase ASCII characters.
297+ //
298+ // As expressed by the regular expression:
299+ // `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`.
300+ string agent_pool_id = 3 [(google.api.field_behavior ) = REQUIRED ];
301+ }
302+
303+ // Specifies the request passed to UpdateAgentPool.
304+ message UpdateAgentPoolRequest {
305+ // Required. The agent pool to update. `agent_pool` is expected to specify following
306+ // fields:
307+ //
308+ // * [name][google.storagetransfer.v1.AgentPool.name]
309+ //
310+ // * [display_name][google.storagetransfer.v1.AgentPool.display_name]
311+ //
312+ // * [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit]
313+ // An `UpdateAgentPoolRequest` with any other fields is rejected
314+ // with the error [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
315+ AgentPool agent_pool = 1 [(google.api.field_behavior ) = REQUIRED ];
316+
317+ // The [field mask]
318+ // (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf)
319+ // of the fields in `agentPool` to update in this request.
320+ // The following `agentPool` fields can be updated:
321+ //
322+ // * [display_name][google.storagetransfer.v1.AgentPool.display_name]
323+ //
324+ // * [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit]
325+ google.protobuf.FieldMask update_mask = 2 ;
326+ }
327+
328+ // Specifies the request passed to GetAgentPool.
329+ message GetAgentPoolRequest {
330+ // Required. The name of the agent pool to get.
331+ string name = 1 [(google.api.field_behavior ) = REQUIRED ];
332+ }
333+
334+ // Specifies the request passed to DeleteAgentPool.
335+ message DeleteAgentPoolRequest {
336+ // Required. The name of the agent pool to delete.
337+ string name = 1 [(google.api.field_behavior ) = REQUIRED ];
338+ }
339+
340+ // The request passed to ListAgentPools.
341+ message ListAgentPoolsRequest {
342+ // Required. The ID of the Google Cloud project that owns the job.
343+ string project_id = 1 [(google.api.field_behavior ) = REQUIRED ];
344+
345+ // An optional list of query parameters specified as JSON text in the
346+ // form of:
347+ //
348+ // `{"agentPoolNames":["agentpool1","agentpool2",...]}`
349+ //
350+ // Since `agentPoolNames` support multiple values, its values must be
351+ // specified with array notation. When the filter is either empty or not
352+ // provided, the list returns all agent pools for the project.
353+ string filter = 2 ;
354+
355+ // The list page size. The max allowed value is `256`.
356+ int32 page_size = 3 ;
357+
358+ // The list page token.
359+ string page_token = 4 ;
360+ }
361+
362+ // Response from ListAgentPools.
363+ message ListAgentPoolsResponse {
364+ // A list of agent pools.
365+ repeated AgentPool agent_pools = 1 ;
366+
367+ // The list next page token.
368+ string next_page_token = 2 ;
369+ }
0 commit comments