Truncating an Object
Functions
This operation can truncate an object to a specified size.
This API is supported only by parallel file systems. For details about how to create a parallel file system, see Sample Request: Creating a Parallel File System.
Request Syntax
PUT /ObjectName?truncate&length=Length HTTP/1.1Host: bucketname.obs.region.example.comAuthorization: authorizationContent-Length: lengthDate: date
Request Parameters
The request needs to specify parameters in the message, indicating that this is to truncate an object to a specified size. Table 1 describes the parameters.
Parameter | Description | Mandatory |
---|---|---|
truncate | Indicates that the upload is for truncation. Type: string | Yes |
length | Size of the object after the truncation Type: integer | Yes |
Request headers
This request uses common request headers. For details, see Table 3.
Request Elements
This request involves no elements.
Response Syntax
HTTP/1.1 204 status_codeServer: OBSx-obs-request-id: request-idx-obs-id-2: idDate: Date
Response Headers
The response to the request uses common headers. For details, see Table 1.
Response Elements
This response contains no elements.
Error Responses
No special error responses are returned. For details about error responses, see Table 2.
Sample Request
PUT /ObjectName?truncate&length=1000 HTTP/1.1Host: examplebucket.obs.region.example.comAuthorization: OBS H4IPJX0TQTHTHEBQQCEC:75/Y4Ng1izvzc1nTGxpMXTE6ynw=Content-Length: 1Date: WED, 01 Jul 2015 04:19:20 GMT
Sample Response
HTTP/1.1 204 No ContentServer: OBSx-obs-request-id: 8DF400000163D3F51DEA05AC9CA066F1x-obs-id-2: 32AAAUgAIAABAAAQAAEAABAAAQAAEAABCSgkM4Dij80gAeFY8pAZIwx72QhDeBZ5Date: WED, 01 Jul 2015 04:19:21 GMT
- Functions
- Request Syntax
- Request Parameters
- Request headers
- Request Elements
- Response Syntax
- Response Headers
- Response Elements
- Error Responses
- Sample Request
- Sample Response