Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
1
minLevel1
maxLevel2
outlinefalse
typelist
printablefalse

The individual parts of a larger object are ready to upload when the initiate request is complete. Swarm allows any number of parts in a multipart upload. (v9.1)

...

The part uploads for an upload ID must include the same domain query argument if the initiate request included a domain query argument for a specific domain. The part uploads must not include an encoding query argument as they inherit whatever was specified in the initiate request, unlike the initiate request. A failed part upload can be retried without affecting the outcome of the multipart upload.

A part is stored as an immutable object whose Content-UUID is returned in the request response when it is successfully uploaded. Client applications must keep track of the part number used for the upload and the Content-UUID Swarm assigned when stored to eventually complete the multipart upload, as described below.

Info

Parts are

unnamed

Unnamed

Each part is an immutable object that returns a Content-UUID even if the initiated object is named, even though a POST on a named object does not ordinarily return that header. The parts are tenanted in the same domain as the destination object, but parts are unnamed, so they cannot reside in buckets.

Using

...

Object Part Numbers

Swarm uses part numbers to identify the position of each part in an object. Include the upload ID and a unique part number for each part so Swarm can assemble the parts in the correct order when uploading parts. Non-sequential part numbers for each part can be selected (2, 4, 6, 8), but Swarm assembles the parts in sequential order.

Record each part number and corresponding Content-UUID. This information is required to complete the multipart write procedure.

Uploading a

...

Part

The following must be included to upload each part:

  1. The object name or UUID (or Content-UUID, for immutable objects) returned by the initiate request

  2. The upload ID returned from the initiate request

  3. A unique part number for each part uploaded

Code Block
languagexml
POST /ObjectNameorUUID?partNumber=PartNumber&uploadId=UploadId HTTP/1.1 
	Host: cluster.example.com 
	User-Agent: Swarm Client/0.1 
	Content-Length: 43402 
	Expect: 100-continue
	[ content ]

The content to be uploaded for the part is placed in the body of the request, like a normal POST operation.

Uploading a

...

Part by

...

Copying from an

...

Existing Object

Create a POST request that uses the content from existing objects if the required parts currently exist in the storage cluster. Swarm creates an EC copy of the object for the multipart write when the part copy request is completed. The request fails if the source object does not exist or cannot be read from the specified range. This process leaves the source and destination versions unrelated to each other.

...

Info

Response Headers

The result code for the operation (which always responds with chunked encoding) is in the trailing header Castor-System-Result when the x-castor-copy-source header is used. 

See "Response Headers for Multipart Writes" in in Completing the Multipart Write.

Copy-

...

Source-

...

Headers

The following headers in the POST request for part uploads are optional, except for the first. They perform the same filtering as the regular headers of those names (rangeif-match, etc.) performed against the source object being copied if included.

...

Note

Error responses on conditional headers come back immediately, in place of a 202 (Accepted for processing) response. Condition failures (such as the ETags not matching) are reported in the initial HTTP response, not the castor-system-result header.

Type

Header

Notes

Source

x-castor-copy-source

Required. Must be a valid name or UUID.

Domain

x-castor-copy-source-domain

Required (unless untenanted)

Range

x-castor-copy-source-range: bytes=first-last 

If the range values are out of bounds for the data, the request returns 416 (Range Not Satisfiable).

Tip: To copy from a start range to the end of the object, omit the end range. (v11.1)

Conditional

x-castor-copy-source-if-match: "<ETag>"
x-castor-copy-source-if-none-match: "<ETag>"

The ETag must be enclosed in quotes.

x-castor-copy-source-if-unmodified-since: <timestamp>
x-castor-copy-source-if-modified-since: <timestamp>

Uses the format of the standard HTTP last-modified header.

Validating the

...

Uploaded Parts

Include a gencontentmd5 query argument or Content-MD5 header in the POST argument to return a Content-MD5 header to validate the content of the uploaded part. See Content-MD5 Checksums. (v9.2)

...