Concatenates a list of existing objects into a new object in the same bucket. The existing source objects are unaffected by this operation.
See Composite objects for a general discussion of object composition, and see Compose objects for tool-specific guides to performing a composition.
Request
HTTP request
POST https://storage.googleapis.com/storage/v1/b/ bucket/o/ destinationObject /compose
In addition to standard query parameters , the following query parameters apply to this method.
To see an example of how to include query parameters in a request, see the JSON API Overview page.
Parameters
bucket
string
destinationObject
string
destinationPredefinedAcl
string
Acceptable values are:
-
authenticatedRead
: Object owner getsOWNER
access, andallAuthenticatedUsers
getREADER
access. -
bucketOwnerFullControl
: Object owner getsOWNER
access, and project team owners getOWNER
access. -
bucketOwnerRead
: Object owner getsOWNER
access, and project team owners getREADER
access. -
private
: Object owner getsOWNER
access. -
projectPrivate
: Object owner getsOWNER
access, and project team members get access according to their roles. -
publicRead
: Object owner getsOWNER
access, andallUsers
getREADER
access.
iamConfiguration.uniformBucketLevelAccess.enabled
is set to true
, requests that include this parameter fail with a 400 Bad Request
response.ifGenerationMatch
long
ifGenerationMatch
to 0 makes the
operation succeed only if there is no live destination object.ifMetagenerationMatch
long
kmsKeyName
string
X-Goog-Encryption-Algorithm
string
AES256
. Used when encrypting
the composed object with a customer-supplied
encryption key
.X-Goog-Encryption-Key
string
X-Goog-Encryption-Key-Sha256
string
Request body
In the request body, supply data with the following structure:
{ "kind": "storage#composeRequest", "sourceObjects": [ { "name": string , "generation": " long ", "objectPreconditions": { "ifGenerationMatch": " long " } } ], "destination": objects Resource }
Property name | Value | Description | Notes |
---|---|---|---|
kind
|
string
|
The kind of item this is. | |
destination
|
nested object
|
Properties of the resulting object. | writable |
sourceObjects[]
|
list
|
The list of source objects that will be concatenated into a single object. There is a limit of 32 components that can be composed in a single operation. | |
sourceObjects[].name
|
string
|
The source object's name. All source objects must reside in the same bucket and use the same storage class . | writable |
sourceObjects[].generation
|
long
1
|
The generation of this object to use as the source. | writable |
sourceObjects[].objectPreconditions
|
object
|
Conditions that must be met for this operation to execute. | |
sourceObjects[].objectPreconditions.ifGenerationMatch
|
long
1
|
Only perform the composition if the generation of the source object that would be used matches this value. If this value and a generation are both specified, they must be the same value or the call will fail. | writable |
Response
If successful, this method returns an object
resource
in the response body, with the owner
and acl
properties omitted.
For information about status and error codes returned by this API, see the reference page .
Try it!
Use the APIs Explorer below to call this method on live data and see the response.