objects

POST /b/{destinationBucket}/o/{destinationObject}/compose

Changed on

Concatenates a list of existing objects into a new object in the same bucket.

Request

  • Base URL
    https://storage.googleapis.com/storage/v1
  • Auth
    • OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/cloud-platform
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/cloud-platform
    • or OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/devstorage.full_control
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/devstorage.full_control
    • or OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/devstorage.read_write
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/devstorage.read_write

Path parameters

destinationBucket, string required

Name of the bucket containing the source objects. The destination object is stored in this bucket.

destinationObject, string required

Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.

Query parameters

alt, 'json' | 'media'

Data format for the response.

fields, string

Selector specifying which fields to include in a partial response.

key, string

API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

oauth_token, string

OAuth 2.0 token for the current user.

prettyPrint, boolean

Returns response with indentations and line breaks.

quotaUser, string

An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

uploadType, string

Upload protocol for media (e.g. "media", "multipart", "resumable").

userIp, string

Deprecated. Please use quotaUser instead.

destinationPredefinedAcl, 'authenticatedRead' | 'bucketOwnerFullControl' | 'bucketOwnerRead' | 'private' | 'projectPrivate' | 'publicRead'

Apply a predefined set of access controls to the destination object.

dropContextGroups, string[]

Specifies which object context groups to drop from the source object(s) during a compose operation. The accepted value is 'custom'. Destination contexts behave as follows:

  • When request body contexts are provided, they override all source contexts.
  • When no request body contexts are provided, source contexts are preserved unless 'dropContextGroups' contains 'custom', in which case all contexts are dropped.
ifGenerationMatch, string int64

Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.

ifMetagenerationMatch, string int64

Makes the operation conditional on whether the object's current metageneration matches the given value.

kmsKeyName, string

Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.

userProject, string

The project to be billed for this request. Required for Requester Pays buckets.

Request body

ComposeRequest required

A Compose request.

deleteSourceObjects, boolean

If true, the source objects will be deleted.

destination, Object

An object.

kind, string

The kind of item this is.

sourceObjects, object[]

The list of source objects that will be concatenated into a single object.

Response

Successful response

Object required

An object.

acl, ObjectAccessControl[]

Access controls on the object.

bucket, string

The name of the bucket containing this object.

cacheControl, string

Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.

componentCount, integer

Number of underlying components that make up this object. Components are accumulated by compose operations.

contentDisposition, string

Content-Disposition of the object data.

contentEncoding, string

Content-Encoding of the object data.

contentLanguage, string

Content-Language of the object data.

contentType, string

Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.

contexts, object

User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.

crc32c, string

CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Data Validation and Change Detection.

customTime, string date-time

A timestamp in RFC 3339 format specified by the user for an object.

customerEncryption, object

Metadata of customer-supplied encryption key, if the object is encrypted by such a key.

etag, string

HTTP 1.1 Entity tag for the object.

eventBasedHold, boolean

Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.

generation, string int64

The content generation of this object. Used for object versioning.

hardDeleteTime, string date-time

This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.

id, string

The ID of the object, including the bucket name, object name, and generation number.

kind, string

The kind of item this is. For objects, this is always storage#object.

kmsKeyName, string

Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.

md5Hash, string

MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Data Validation and Change Detection.

mediaLink, string

Media download link.

metadata, object

User-provided metadata, in key/value pairs.

metageneration, string int64

The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.

name, string

The name of the object. Required if not specified by URL parameter.

owner, object

The owner of the object. This will always be the uploader of the object.

restoreToken, string

Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.

retention, object

A collection of object level retention parameters.

retentionExpirationTime, string date-time

A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).

selfLink, string

The link to this object.

size, string uint64

Content-Length of the data in bytes.

softDeleteTime, string date-time

The time at which the object became soft-deleted in RFC 3339 format.

storageClass, string

Storage class of the object.

temporaryHold, boolean

Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.

timeCreated, string date-time

The creation time of the object in RFC 3339 format.

timeDeleted, string date-time

The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.

timeFinalized, string date-time

The time when the object was finalized.

timeStorageClassUpdated, string date-time

The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated.

updated, string date-time

The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.

zonalAvailabilityInfo, object

Information about the object's availability in Rapid Cache Ultra (RCU) zonal caches. This field will only populate once the object is loaded into the cache.

Changes

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/devstorage.read_write was removed from the endpoint's security scheme Oauth2

    1 more change in this revision