-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
transfer.proto
399 lines (348 loc) · 14.6 KB
/
transfer.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.storagetransfer.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/storagetransfer/v1/transfer_types.proto";
option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.StorageTransfer.V1";
option go_package = "cloud.google.com/go/storagetransfer/apiv1/storagetransferpb;storagetransferpb";
option java_outer_classname = "TransferProto";
option java_package = "com.google.storagetransfer.v1.proto";
option php_namespace = "Google\\Cloud\\StorageTransfer\\V1";
option ruby_package = "Google::Cloud::StorageTransfer::V1";
// Storage Transfer Service and its protos.
// Transfers data between between Google Cloud Storage buckets or from a data
// source external to Google to a Cloud Storage bucket.
service StorageTransferService {
option (google.api.default_host) = "storagetransfer.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";
// Returns the Google service account that is used by Storage Transfer
// Service to access buckets in the project where transfers
// run or in other projects. Each Google service account is associated
// with one Google Cloud project. Users
// should add this service account to the Google Cloud Storage bucket
// ACLs to grant access to Storage Transfer Service. This service
// account is created and owned by Storage Transfer Service and can
// only be used by Storage Transfer Service.
rpc GetGoogleServiceAccount(GetGoogleServiceAccountRequest)
returns (GoogleServiceAccount) {
option (google.api.http) = {
get: "/v1/googleServiceAccounts/{project_id}"
};
}
// Creates a transfer job that runs periodically.
rpc CreateTransferJob(CreateTransferJobRequest) returns (TransferJob) {
option (google.api.http) = {
post: "/v1/transferJobs"
body: "transfer_job"
};
}
// Updates a transfer job. Updating a job's transfer spec does not affect
// transfer operations that are running already.
//
// **Note:** The job's [status][google.storagetransfer.v1.TransferJob.status]
// field can be modified using this RPC (for example, to set a job's status to
// [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED],
// [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], or
// [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]).
rpc UpdateTransferJob(UpdateTransferJobRequest) returns (TransferJob) {
option (google.api.http) = {
patch: "/v1/{job_name=transferJobs/**}"
body: "*"
};
}
// Gets a transfer job.
rpc GetTransferJob(GetTransferJobRequest) returns (TransferJob) {
option (google.api.http) = {
get: "/v1/{job_name=transferJobs/**}"
};
}
// Lists transfer jobs.
rpc ListTransferJobs(ListTransferJobsRequest)
returns (ListTransferJobsResponse) {
option (google.api.http) = {
get: "/v1/transferJobs"
};
}
// Pauses a transfer operation.
rpc PauseTransferOperation(PauseTransferOperationRequest)
returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/{name=transferOperations/**}:pause"
body: "*"
};
}
// Resumes a transfer operation that is paused.
rpc ResumeTransferOperation(ResumeTransferOperationRequest)
returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/{name=transferOperations/**}:resume"
body: "*"
};
}
// Starts a new operation for the specified transfer job.
// A `TransferJob` has a maximum of one active `TransferOperation`. If this
// method is called while a `TransferOperation` is active, an error is
// returned.
rpc RunTransferJob(RunTransferJobRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{job_name=transferJobs/**}:run"
body: "*"
};
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "TransferOperation"
};
}
// Deletes a transfer job. Deleting a transfer job sets its status to
// [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED].
rpc DeleteTransferJob(DeleteTransferJobRequest)
returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/{job_name=transferJobs/**}"
};
}
// Creates an agent pool resource.
rpc CreateAgentPool(CreateAgentPoolRequest) returns (AgentPool) {
option (google.api.http) = {
post: "/v1/projects/{project_id=*}/agentPools"
body: "agent_pool"
};
option (google.api.method_signature) =
"project_id,agent_pool,agent_pool_id";
}
// Updates an existing agent pool resource.
rpc UpdateAgentPool(UpdateAgentPoolRequest) returns (AgentPool) {
option (google.api.http) = {
patch: "/v1/{agent_pool.name=projects/*/agentPools/*}"
body: "agent_pool"
};
option (google.api.method_signature) = "agent_pool,update_mask";
}
// Gets an agent pool.
rpc GetAgentPool(GetAgentPoolRequest) returns (AgentPool) {
option (google.api.http) = {
get: "/v1/{name=projects/*/agentPools/*}"
};
option (google.api.method_signature) = "name";
}
// Lists agent pools.
rpc ListAgentPools(ListAgentPoolsRequest) returns (ListAgentPoolsResponse) {
option (google.api.http) = {
get: "/v1/projects/{project_id=*}/agentPools"
};
option (google.api.method_signature) = "project_id";
}
// Deletes an agent pool.
rpc DeleteAgentPool(DeleteAgentPoolRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/agentPools/*}"
};
option (google.api.method_signature) = "name";
}
}
// Request passed to GetGoogleServiceAccount.
message GetGoogleServiceAccountRequest {
// Required. The ID of the Google Cloud project that the Google service
// account is associated with.
string project_id = 1 [(google.api.field_behavior) = REQUIRED];
}
// Request passed to CreateTransferJob.
message CreateTransferJobRequest {
// Required. The job to create.
TransferJob transfer_job = 1 [(google.api.field_behavior) = REQUIRED];
}
// Request passed to UpdateTransferJob.
message UpdateTransferJobRequest {
// Required. The name of job to update.
string job_name = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The ID of the Google Cloud project that owns the
// job.
string project_id = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The job to update. `transferJob` is expected to specify one or
// more of five fields:
// [description][google.storagetransfer.v1.TransferJob.description],
// [transfer_spec][google.storagetransfer.v1.TransferJob.transfer_spec],
// [notification_config][google.storagetransfer.v1.TransferJob.notification_config],
// [logging_config][google.storagetransfer.v1.TransferJob.logging_config], and
// [status][google.storagetransfer.v1.TransferJob.status]. An
// `UpdateTransferJobRequest` that specifies other fields are rejected with
// the error [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. Updating a
// job status to
// [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED] requires
// `storagetransfer.jobs.delete` permission.
TransferJob transfer_job = 3 [(google.api.field_behavior) = REQUIRED];
// The field mask of the fields in `transferJob` that are to be updated in
// this request. Fields in `transferJob` that can be updated are:
// [description][google.storagetransfer.v1.TransferJob.description],
// [transfer_spec][google.storagetransfer.v1.TransferJob.transfer_spec],
// [notification_config][google.storagetransfer.v1.TransferJob.notification_config],
// [logging_config][google.storagetransfer.v1.TransferJob.logging_config], and
// [status][google.storagetransfer.v1.TransferJob.status]. To update the
// `transfer_spec` of the job, a complete transfer specification must be
// provided. An incomplete specification missing any required fields is
// rejected with the error
// [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
google.protobuf.FieldMask update_transfer_job_field_mask = 4;
}
// Request passed to GetTransferJob.
message GetTransferJobRequest {
// Required. The job to get.
string job_name = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The ID of the Google Cloud project that owns the
// job.
string project_id = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request passed to DeleteTransferJob.
message DeleteTransferJobRequest {
// Required. The job to delete.
string job_name = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The ID of the Google Cloud project that owns the
// job.
string project_id = 2 [(google.api.field_behavior) = REQUIRED];
}
// `projectId`, `jobNames`, and `jobStatuses` are query parameters that can
// be specified when listing transfer jobs.
message ListTransferJobsRequest {
// Required. A list of query parameters specified as JSON text in the form of:
// `{"projectId":"my_project_id",
// "jobNames":["jobid1","jobid2",...],
// "jobStatuses":["status1","status2",...]}`
//
// Since `jobNames` and `jobStatuses` support multiple values, their values
// must be specified with array notation. `projectId` is required.
// `jobNames` and `jobStatuses` are optional. The valid values for
// `jobStatuses` are case-insensitive:
// [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED],
// [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], and
// [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED].
string filter = 1 [(google.api.field_behavior) = REQUIRED];
// The list page size. The max allowed value is 256.
int32 page_size = 4;
// The list page token.
string page_token = 5;
}
// Response from ListTransferJobs.
message ListTransferJobsResponse {
// A list of transfer jobs.
repeated TransferJob transfer_jobs = 1;
// The list next page token.
string next_page_token = 2;
}
// Request passed to PauseTransferOperation.
message PauseTransferOperationRequest {
// Required. The name of the transfer operation.
string name = 1 [(google.api.field_behavior) = REQUIRED];
}
// Request passed to ResumeTransferOperation.
message ResumeTransferOperationRequest {
// Required. The name of the transfer operation.
string name = 1 [(google.api.field_behavior) = REQUIRED];
}
// Request passed to RunTransferJob.
message RunTransferJobRequest {
// Required. The name of the transfer job.
string job_name = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The ID of the Google Cloud project that owns the transfer
// job.
string project_id = 2 [(google.api.field_behavior) = REQUIRED];
}
// Specifies the request passed to CreateAgentPool.
message CreateAgentPoolRequest {
// Required. The ID of the Google Cloud project that owns the
// agent pool.
string project_id = 1 [(google.api.field_behavior) = REQUIRED];
// Required. The agent pool to create.
AgentPool agent_pool = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The ID of the agent pool to create.
//
// The `agent_pool_id` must meet the following requirements:
//
// * Length of 128 characters or less.
// * Not start with the string `goog`.
// * Start with a lowercase ASCII character, followed by:
// * Zero or more: lowercase Latin alphabet characters, numerals,
// hyphens (`-`), periods (`.`), underscores (`_`), or tildes (`~`).
// * One or more numerals or lowercase ASCII characters.
//
// As expressed by the regular expression:
// `^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$`.
string agent_pool_id = 3 [(google.api.field_behavior) = REQUIRED];
}
// Specifies the request passed to UpdateAgentPool.
message UpdateAgentPoolRequest {
// Required. The agent pool to update. `agent_pool` is expected to specify
// following fields:
//
// * [name][google.storagetransfer.v1.AgentPool.name]
//
// * [display_name][google.storagetransfer.v1.AgentPool.display_name]
//
// * [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit]
// An `UpdateAgentPoolRequest` with any other fields is rejected
// with the error [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT].
AgentPool agent_pool = 1 [(google.api.field_behavior) = REQUIRED];
// The [field mask]
// (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf)
// of the fields in `agentPool` to update in this request.
// The following `agentPool` fields can be updated:
//
// * [display_name][google.storagetransfer.v1.AgentPool.display_name]
//
// * [bandwidth_limit][google.storagetransfer.v1.AgentPool.bandwidth_limit]
google.protobuf.FieldMask update_mask = 2;
}
// Specifies the request passed to GetAgentPool.
message GetAgentPoolRequest {
// Required. The name of the agent pool to get.
string name = 1 [(google.api.field_behavior) = REQUIRED];
}
// Specifies the request passed to DeleteAgentPool.
message DeleteAgentPoolRequest {
// Required. The name of the agent pool to delete.
string name = 1 [(google.api.field_behavior) = REQUIRED];
}
// The request passed to ListAgentPools.
message ListAgentPoolsRequest {
// Required. The ID of the Google Cloud project that owns the job.
string project_id = 1 [(google.api.field_behavior) = REQUIRED];
// An optional list of query parameters specified as JSON text in the
// form of:
//
// `{"agentPoolNames":["agentpool1","agentpool2",...]}`
//
// Since `agentPoolNames` support multiple values, its values must be
// specified with array notation. When the filter is either empty or not
// provided, the list returns all agent pools for the project.
string filter = 2;
// The list page size. The max allowed value is `256`.
int32 page_size = 3;
// The list page token.
string page_token = 4;
}
// Response from ListAgentPools.
message ListAgentPoolsResponse {
// A list of agent pools.
repeated AgentPool agent_pools = 1;
// The list next page token.
string next_page_token = 2;
}