PATCH method
Written by
Updated at September 30, 2024
Partially updates and appends object data in Yandex Object Storage.
Note
The mechanism of partial object updates is not included in the S3 API standard functionality and is supported for buckets with versioning disabled.
The request includes the updated object range and the new data.
Objects can be updated concurrently with multiple requests.
For more information on getting started with the API and the general request format, see How to use the S3 API.
Request
PATCH /{bucket}/{key} HTTP/2
Path parameters
Parameter | Description |
---|---|
bucket |
Bucket name. |
key |
Object key. The ID used to store the object in Object Storage. |
Headers
Use common headers in the request, as well as the headers presented below:
Header | Description |
---|---|
Content-Range |
Required parameter. Value: bytes {<start_byte>}-{<end_byte>}/* .Range boundaries are included. Maximum range length is 5 GB. Content-Length header must be equal to the Content-Range length.To append data to an object, specify the end byte value larger than the object size. The start byte value cannot exceed the object size. The header format complies with the RFC 9110
|
X-Yc-S3-Patch-Append-Part-Size |
Optional parameter. Value: {size_of_new_part} .The size of new parts of an object uploaded in parts, if appending to the end of the object. In bytes. If the object's last part has reached the specified size, the next append will be saved as a new part. The default value is 25 MB. |
If-Match |
Optional parameter. Condition for partial object update. If ETag of an object is the same as in the header, the operation is performed.If the condition is not met, Object Storage returns the 412 error ( Precondition Failed ).You can use it with the If-Unmodified-Since header. |
If-Unmodified-Since |
Optional parameter. Condition for partial object update. The operation is performed if the object has not been modified since the specified time. If the condition is not met, Object Storage returns the 412 error ( Precondition Failed ).You can use it with the If-Match header. |
Response
Headers
Responses can only contain common response headers.
Response codes
For a list of possible responses, see Responses.
In addition, Object Storage can return other errors described in the table below.
Error | Description |
---|---|
MissingContentRange |
The Content-Range header is missing from the request. |
MalformedPatchAppendPartSize |
The X-Yc-S3-Patch-Append-Part-Size header in the request is invalid. |
ObjectVersionPatchConflict |
During the partial update, the object was overwritten with a new version. |
ConcurrentUpdatesPatchConflict |
The conflict could not be resolved due to a high number of concurrent requests. |
Data schema
<?xml version="1.0" encoding="UTF-8"?>
<PatchObjectResult>
<Object>
<LastModified>2023-07-21T11:46:16.357Z</LastModified>
<ETag>"daebcb5e72f14b690c18018c9f92af05-2"</ETag>
</Object>
</PatchObjectResult>
Tag | Description |
---|---|
PatchObjectResult |
Root element. |
Object |
Parent tag for update results. |
LastModified |
Date and time of the last object update. During the partial object update, the tag does not change. |
ETag |
ETag of the updated object. For more details, see common headers. |