Skip to content

Commit bf69826

Browse files
Google APIscopybara-github
authored andcommitted
feat: add support for Agent Pools
feat: add support for transfers between file systems feat: add support for metadata preservation feat: add support for transferring a specific list of objects (manifest) feat: add support for Cloud Logging PiperOrigin-RevId: 439424192
1 parent 1079dd1 commit bf69826

5 files changed

Lines changed: 660 additions & 173 deletions

File tree

google/storagetransfer/v1/BUILD.bazel

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ proto_library(
2828
"//google/api:annotations_proto",
2929
"//google/api:client_proto",
3030
"//google/api:field_behavior_proto",
31+
"//google/api:resource_proto",
3132
"//google/longrunning:operations_proto",
3233
"//google/rpc:code_proto",
3334
"//google/type:date_proto",
3435
"//google/type:timeofday_proto",
35-
"@com_google_protobuf//:any_proto",
3636
"@com_google_protobuf//:duration_proto",
3737
"@com_google_protobuf//:empty_proto",
3838
"@com_google_protobuf//:field_mask_proto",
@@ -74,12 +74,15 @@ java_grpc_library(
7474
java_gapic_library(
7575
name = "storagetransfer_java_gapic",
7676
srcs = [":storagetransfer_proto_with_info"],
77+
gapic_yaml = None,
7778
grpc_service_config = "storagetransfer_grpc_service_config.json",
79+
service_yaml = "storagetransfer_v1.yaml",
7880
test_deps = [
7981
":storagetransfer_java_grpc",
8082
],
8183
deps = [
8284
":storagetransfer_java_proto",
85+
"//google/api:api_java_proto",
8386
],
8487
)
8588

@@ -139,7 +142,6 @@ go_gapic_library(
139142
"//google/longrunning:longrunning_go_proto",
140143
"@com_google_cloud_go//longrunning:go_default_library",
141144
"@com_google_cloud_go//longrunning/autogen:go_default_library",
142-
"@io_bazel_rules_go//proto/wkt:any_go_proto",
143145
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
144146
],
145147
)
@@ -176,9 +178,9 @@ py_gapic_library(
176178
srcs = [":storagetransfer_proto"],
177179
grpc_service_config = "storagetransfer_grpc_service_config.json",
178180
opt_args = [
179-
"warehouse-package-name=google-cloud-storage-transfer",
180-
"python-gapic-namespace=google.cloud",
181181
"python-gapic-name=storage_transfer",
182+
"python-gapic-namespace=google.cloud",
183+
"warehouse-package-name=google-cloud-storage-transfer",
182184
],
183185
)
184186

@@ -287,10 +289,10 @@ ruby_cloud_gapic_library(
287289
name = "storagetransfer_ruby_gapic",
288290
srcs = [":storagetransfer_proto_with_info"],
289291
extra_protoc_parameters = [
290-
"ruby-cloud-gem-name=google-cloud-storage_transfer-v1",
291-
"ruby-cloud-product-url=https://cloud.google.com/storage-transfer-service/",
292292
"ruby-cloud-api-id=storagetransfer.googleapis.com",
293293
"ruby-cloud-api-shortname=storagetransfer",
294+
"ruby-cloud-gem-name=google-cloud-storage_transfer-v1",
295+
"ruby-cloud-product-url=https://cloud.google.com/storage-transfer-service/",
294296
],
295297
grpc_service_config = "storagetransfer_grpc_service_config.json",
296298
ruby_cloud_description = "Storage Transfer Service allows you to quickly import online data into Cloud Storage. You can also set up a repeating schedule for transferring data, as well as transfer data within Cloud Storage, from one bucket to another.",

google/storagetransfer/v1/storagetransfer_grpc_service_config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"service": "google.storagetransfer.v1.StorageTransferService"
77
}
88
],
9-
"timeout": "60s"
9+
"timeout": "30s"
1010
}
1111
]
1212
}

google/storagetransfer/v1/storagetransfer_v1.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ apis:
77
- name: google.storagetransfer.v1.StorageTransferService
88

99
types:
10-
- name: google.storagetransfer.v1.RunTransferJobMetadata
11-
- name: google.storagetransfer.v1.RunTransferJobResponse
1210
- name: google.storagetransfer.v1.TransferOperation
1311

1412
documentation:
@@ -48,7 +46,7 @@ documentation:
4846
4947
- selector: google.longrunning.Operations.ListOperations
5048
description: |-
51-
Lists transfer operations. Operations are ordered by their creation
49+
Lists transfer operations. Operations are ordered by their creation
5250
time in reverse chronological order.
5351
5452
backend:

google/storagetransfer/v1/transfer.proto

Lines changed: 164 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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";
2020
import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
2222
import "google/longrunning/operations.proto";
23-
import "google/protobuf/duration.proto";
2423
import "google/protobuf/empty.proto";
2524
import "google/protobuf/field_mask.proto";
2625
import "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.
3938
service 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.
132167
message 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.
180214
message 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

Comments
 (0)