PATCH method
Written by
Updated at December 11, 2023
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.
Query
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. The maximum range length is 5 GB. The Content-Length header must be equal to the length of Content-Range .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 RFC 9110
|
X-Yc-S3-Patch-Append-Part-Size |
Optional parameter. Value: {size_of_the_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. A condition for partial update of the object. If the ETag of the object equals the value specified in the header, the operation is executed.If the condition is not met, Object Storage returns the 412 Precondition Failed error.This parameter can be used together with the If-Unmodified-Since header. |
If-Unmodified-Since |
Optional parameter. A condition for partial update of the object. The operation is executed if the object has not been changed since the specified time. If the condition is not met, Object Storage will return the 412 Precondition Failed error.You can use it together 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 in 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. |