TransferSpec

Configuration for running a transfer.

JSON representation
{
  "object_conditions": {
    object (ObjectConditions)
  },
  "transfer_options": {
    object (TransferOptions)
  },

  // Union field data_source can be only one of the following:
  "gcs_data_source": {
    object (GcsData)
  },
  "aws_s3_data_source": {
    object (AwsS3Data)
  },
  "http_data_source": {
    object (HttpData)
  }
  // End of list of possible types for union field data_source.
  "gcs_data_sink": {
    object (GcsData)
  }
}
Fields
object_conditions

object (ObjectConditions)

Only objects that satisfy these object conditions are included in the set of data source and data sink objects. Object conditions based on objects' lastModificationTime do not exclude objects in a data sink.

transfer_options

object (TransferOptions)

If the option deleteObjectsUniqueInSink is true, object conditions based on objects' lastModificationTime are ignored and do not exclude objects in a data source or a data sink.

Union field data_source. Required. The read source of the data. data_source can be only one of the following:
gcs_data_source

object (GcsData)

A Cloud Storage data source.

aws_s3_data_source

object (AwsS3Data)

An AWS S3 data source.

http_data_source

object (HttpData)

An HTTP URL data source.

gcs_data_sink

object (GcsData)

A Cloud Storage data sink.

GcsData

In a GcsData resource, an object's name is the Cloud Storage object's name and its lastModificationTime refers to the object's updated time, which changes when the content or the metadata of the object is updated.

JSON representation
{
  "bucket_name": string
}
Fields
bucket_name

string

Required. Cloud Storage bucket name (see Bucket Name Requirements).

AwsS3Data

An AwsS3Data resource can be a data source, but not a data sink. In an AwsS3Data resource, an object's name is the S3 object's key name.

JSON representation
{
  "bucket_name": string,
  "aws_access_key": {
    object (AwsAccessKey)
  }
}
Fields
bucket_name

string

Required. S3 Bucket name (see Creating a bucket).

aws_access_key

object (AwsAccessKey)

Required. AWS access key used to sign the API requests to the AWS S3 bucket. Permissions on the bucket must be granted to the access ID of the AWS access key.

AwsAccessKey

AWS access key (see AWS Security Credentials).

JSON representation
{
  "access_key_id": string,
  "secret_access_key": string
}
Fields
access_key_id

string

Required. AWS access key ID.

secret_access_key

string

Required. AWS secret access key. This field is not returned in RPC responses.

HttpData

An HttpData resource specifies a list of objects on the web to be transferred over HTTP. The information of the objects to be transferred is contained in a file referenced by a URL. The first line in the file must be "TsvHttpData-1.0", which specifies the format of the file. Subsequent lines specify the information of the list of objects, one object per list entry. Each entry has the following tab-delimited fields:

  • HTTP URL - The location of the object.

  • Length - The size of the object in bytes.

  • MD5 - The base64-encoded MD5 hash of the object.

For an example of a valid TSV file, see Transferring data from URLs.

When transferring data based on a URL list, keep the following in mind:

  • When an object located at http(s)://hostname:port/<URL-path> is transferred to a data sink, the name of the object at the data sink is <hostname>/<URL-path>.

  • If the specified size of an object does not match the actual size of the object fetched, the object will not be transferred.

  • If the specified MD5 does not match the MD5 computed from the transferred bytes, the object transfer will fail. For more information, see Generating MD5 hashes

  • Ensure that each URL you specify is publicly accessible. For example, in Cloud Storage you can share an object publicly and get a link to it.

  • Storage Transfer Service obeys robots.txt rules and requires the source HTTP server to support Range requests and to return a Content-Length header in each response.

  • ObjectConditions have no effect when filtering objects to transfer.

JSON representation
{
  "list_url": string
}
Fields
list_url

string

Required. The URL that points to the file that stores the object list entries. This file must allow public access. Currently, only URLs with HTTP and HTTPS schemes are supported.

ObjectConditions

Conditions that determine which objects will be transferred. Applies only to S3 and Cloud Storage objects.

JSON representation
{
  "min_time_elapsed_since_last_modification": string,
  "max_time_elapsed_since_last_modification": string,
  "include_prefixes": [
    string
  ],
  "exclude_prefixes": [
    string
  ]
}
Fields
min_time_elapsed_since_last_modification

string (Duration format)

If specified, only objects with a lastModificationTime before NOW - minTimeElapsedSinceLastModification and objects that don't have a lastModificationTime are transferred.

Note that, for each TransferOperation started by this TransferJob, NOW refers to the start_time of the 'TransferOperation. Also, lastModificationTimerefers to the time of the last change to the object's content or metadata - specifically, this would be theupdated property of Cloud Storage objects and theLastModified` field of S3 objects.

A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

max_time_elapsed_since_last_modification

string (Duration format)

If specified, only objects with a lastModificationTime on or after NOW - maxTimeElapsedSinceLastModification and objects that don't have a lastModificationTime are transferred.

Note that, for each TransferOperation started by this TransferJob, NOW refers to the start_time of the 'TransferOperation. Also, lastModificationTimerefers to the time of the last change to the object's content or metadata - specifically, this would be theupdated property of Cloud Storage objects and theLastModified` field of S3 objects.

A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

include_prefixes[]

string

If includePrefixes is specified, objects that satisfy the object conditions must have names that start with one of the includePrefixes and that do not start with any of the excludePrefixes. If includePrefixes is not specified, all objects except those that have names starting with one of the excludePrefixes must satisfy the object conditions.

Requirements:

  • Each include-prefix and exclude-prefix can contain any sequence of Unicode characters, of max length 1024 bytes when UTF8-encoded, and must not contain Carriage Return or Line Feed characters. Wildcard matching and regular expression matching are not supported.

  • Each include-prefix and exclude-prefix must omit the leading slash. For example, to include the requests.gz object in a transfer from s3://my-aws-bucket/logs/y=2015/requests.gz, specify the include prefix as logs/y=2015/requests.gz.

  • None of the include-prefix or the exclude-prefix values can be empty, if specified.

  • Each include-prefix must include a distinct portion of the object namespace, i.e., no include-prefix may be a prefix of another include-prefix.

  • Each exclude-prefix must exclude a distinct portion of the object namespace, i.e., no exclude-prefix may be a prefix of another exclude-prefix.

  • If includePrefixes is specified, then each exclude-prefix must start with the value of a path explicitly included by includePrefixes.

The max size of includePrefixes is 1000.

exclude_prefixes[]

string

excludePrefixes must follow the requirements described for includePrefixes.

The max size of excludePrefixes is 1000.

TransferOptions

TransferOptions uses three boolean parameters to define the actions to be performed on objects in a transfer.

JSON representation
{
  "overwrite_objects_already_existing_in_sink": boolean,
  "delete_objects_unique_in_sink": boolean,
  "delete_objects_from_source_after_transfer": boolean
}
Fields
overwrite_objects_already_existing_in_sink

boolean

Whether overwriting objects that already exist in the sink is allowed.

delete_objects_unique_in_sink

boolean

Whether objects that exist only in the sink should be deleted. Note that this option and deleteObjectsFromSourceAfterTransfer are mutually exclusive.

delete_objects_from_source_after_transfer

boolean

Whether objects should be deleted from the source after they are transferred to the sink. Note that this option and deleteObjectsUniqueInSink are mutually exclusive.

Cette page vous a-t-elle été utile ? Évaluez-la :

Envoyer des commentaires concernant…

Cloud Storage Transfer Service