Skip to content

Commit 67495ab

Browse files
Google APIscopybara-github
authored andcommitted
feat: support cross-bucket replication
PiperOrigin-RevId: 707205525
1 parent 5546362 commit 67495ab

2 files changed

Lines changed: 78 additions & 33 deletions

File tree

google/storagetransfer/v1/transfer.proto

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import "google/protobuf/empty.proto";
2424
import "google/protobuf/field_mask.proto";
2525
import "google/storagetransfer/v1/transfer_types.proto";
2626

27-
option cc_enable_arenas = true;
2827
option csharp_namespace = "Google.Cloud.StorageTransfer.V1";
2928
option go_package = "cloud.google.com/go/storagetransfer/apiv1/storagetransferpb;storagetransferpb";
3029
option java_outer_classname = "TransferProto";
@@ -254,17 +253,32 @@ message DeleteTransferJobRequest {
254253
// be specified when listing transfer jobs.
255254
message ListTransferJobsRequest {
256255
// Required. A list of query parameters specified as JSON text in the form of:
257-
// `{"projectId":"my_project_id",
258-
// "jobNames":["jobid1","jobid2",...],
259-
// "jobStatuses":["status1","status2",...]}`
260256
//
261-
// Since `jobNames` and `jobStatuses` support multiple values, their values
262-
// must be specified with array notation. `projectId` is required.
263-
// `jobNames` and `jobStatuses` are optional. The valid values for
264-
// `jobStatuses` are case-insensitive:
265-
// [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED],
266-
// [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED], and
267-
// [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED].
257+
// ```
258+
// {
259+
// "projectId":"my_project_id",
260+
// "jobNames":["jobid1","jobid2",...],
261+
// "jobStatuses":["status1","status2",...],
262+
// "dataBackend":"QUERY_REPLICATION_CONFIGS",
263+
// "sourceBucket":"source-bucket-name",
264+
// "sinkBucket":"sink-bucket-name",
265+
// }
266+
// ```
267+
//
268+
// The JSON formatting in the example is for display only; provide the
269+
// query parameters without spaces or line breaks.
270+
//
271+
// * `projectId` is required.
272+
// * Since `jobNames` and `jobStatuses` support multiple values, their values
273+
// must be specified with array notation. `jobNames` and `jobStatuses` are
274+
// optional. Valid values are case-insensitive:
275+
// * [ENABLED][google.storagetransfer.v1.TransferJob.Status.ENABLED]
276+
// * [DISABLED][google.storagetransfer.v1.TransferJob.Status.DISABLED]
277+
// * [DELETED][google.storagetransfer.v1.TransferJob.Status.DELETED]
278+
// * Specify `"dataBackend":"QUERY_REPLICATION_CONFIGS"` to return a list of
279+
// cross-bucket replication jobs.
280+
// * Limit the results to jobs from a particular bucket with `sourceBucket`
281+
// and/or to a particular bucket with `sinkBucket`.
268282
string filter = 1 [(google.api.field_behavior) = REQUIRED];
269283

270284
// The list page size. The max allowed value is 256.

google/storagetransfer/v1/transfer_types.proto

Lines changed: 53 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import "google/rpc/code.proto";
2424
import "google/type/date.proto";
2525
import "google/type/timeofday.proto";
2626

27-
option cc_enable_arenas = true;
2827
option csharp_namespace = "Google.Cloud.StorageTransfer.V1";
2928
option go_package = "cloud.google.com/go/storagetransfer/apiv1/storagetransferpb;storagetransferpb";
3029
option java_outer_classname = "TransferTypes";
@@ -352,43 +351,43 @@ message AzureBlobStorageData {
352351
string credentials_secret = 7 [(google.api.field_behavior) = OPTIONAL];
353352
}
354353

355-
// An HttpData resource specifies a list of objects on the web to be transferred
356-
// over HTTP. The information of the objects to be transferred is contained in
357-
// a file referenced by a URL. The first line in the file must be
358-
// `"TsvHttpData-1.0"`, which specifies the format of the file. Subsequent
359-
// lines specify the information of the list of objects, one object per list
360-
// entry. Each entry has the following tab-delimited fields:
354+
// An HttpData resource specifies a list of objects on the web to be
355+
// transferred over HTTP. The information of the objects to be transferred is
356+
// contained in a file referenced by a URL. The first line in the file must be
357+
// `"TsvHttpData-1.0"`, which specifies the format of the file. Subsequent
358+
// lines specify the information of the list of objects, one object per list
359+
// entry. Each entry has the following tab-delimited fields:
361360
//
362-
// * **HTTP URL** — The location of the object.
361+
// * **HTTP URL** — The location of the object.
363362
//
364-
// * **Length** — The size of the object in bytes.
363+
// * **Length** — The size of the object in bytes.
365364
//
366-
// * **MD5** — The base64-encoded MD5 hash of the object.
365+
// * **MD5** — The base64-encoded MD5 hash of the object.
367366
//
368-
// For an example of a valid TSV file, see
369-
// [Transferring data from
370-
// URLs](https://cloud.google.com/storage-transfer/docs/create-url-list).
367+
// For an example of a valid TSV file, see
368+
// [Transferring data from
369+
// URLs](https://cloud.google.com/storage-transfer/docs/create-url-list).
371370
//
372-
// When transferring data based on a URL list, keep the following in mind:
371+
// When transferring data based on a URL list, keep the following in mind:
373372
//
374373
// * When an object located at `http(s)://hostname:port/<URL-path>` is
375-
// transferred to a data sink, the name of the object at the data sink is
374+
// transferred to a data sink, the name of the object at the data sink is
376375
// `<hostname>/<URL-path>`.
377376
//
378377
// * If the specified size of an object does not match the actual size of the
379-
// object fetched, the object is not transferred.
378+
// object fetched, the object is not transferred.
380379
//
381380
// * If the specified MD5 does not match the MD5 computed from the transferred
382-
// bytes, the object transfer fails.
381+
// bytes, the object transfer fails.
383382
//
384383
// * Ensure that each URL you specify is publicly accessible. For
385-
// example, in Cloud Storage you can
386-
// [share an object publicly]
387-
// (/storage/docs/cloud-console#_sharingdata) and get a link to it.
384+
// example, in Cloud Storage you can
385+
// [share an object publicly]
386+
// (/storage/docs/cloud-console#_sharingdata) and get a link to it.
388387
//
389388
// * Storage Transfer Service obeys `robots.txt` rules and requires the source
390-
// HTTP server to support `Range` requests and to return a `Content-Length`
391-
// header in each response.
389+
// HTTP server to support `Range` requests and to return a `Content-Length`
390+
// header in each response.
392391
//
393392
// * [ObjectConditions][google.storagetransfer.v1.ObjectConditions] have no
394393
// effect when filtering objects to transfer.
@@ -686,6 +685,35 @@ message TransferSpec {
686685
string sink_agent_pool_name = 18;
687686
}
688687

688+
// Specifies the configuration for a cross-bucket replication job. Cross-bucket
689+
// replication copies new or updated objects from a source Cloud Storage bucket
690+
// to a destination Cloud Storage bucket. Existing objects in the source bucket
691+
// are not copied by a new cross-bucket replication job.
692+
message ReplicationSpec {
693+
// The data source to be replicated.
694+
oneof data_source {
695+
// The Cloud Storage bucket from which to replicate objects.
696+
GcsData gcs_data_source = 1;
697+
}
698+
699+
// The destination for replicated objects.
700+
oneof data_sink {
701+
// The Cloud Storage bucket to which to replicate objects.
702+
GcsData gcs_data_sink = 2;
703+
}
704+
705+
// Object conditions that determine which objects are transferred. For
706+
// replication jobs, only `include_prefixes` and `exclude_prefixes` are
707+
// supported.
708+
ObjectConditions object_conditions = 3;
709+
710+
// Specifies the metadata options to be applied during replication.
711+
// Delete options are not supported. If a delete option is specified, the
712+
// request fails with an [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]
713+
// error.
714+
TransferOptions transfer_options = 4;
715+
}
716+
689717
// Specifies the metadata options for running a transfer.
690718
message MetadataOptions {
691719
// Whether symlinks should be skipped or preserved during a transfer job.
@@ -1033,6 +1061,9 @@ message TransferJob {
10331061
// Transfer specification.
10341062
TransferSpec transfer_spec = 4;
10351063

1064+
// Replication specification.
1065+
ReplicationSpec replication_spec = 17;
1066+
10361067
// Notification configuration.
10371068
NotificationConfig notification_config = 11;
10381069

0 commit comments

Comments
 (0)