Obtaining an Online Decompression Policy
Function
This API is used to obtain the online decompression policy of a bucket. If such a policy exists, a success message is returned with status code 200. For more information about online decompression, see Online Decompression.
The obscompresspolicy URI parameter is an OBS-defined sub-resource identifier for online decompression. Its API name DecompressPolicy directly expresses the decompression semantics of the policy.
URI
GET /
Calling Method
For details, see Calling APIs. Before calling this API, calculate the API signature and add it to the request.
You can debug this API in API Explorer.
Request Syntax
GET /?obscompresspolicy HTTP/1.1 Host: bucketname.obs.region.myhuaweicloud.com Authorization: authorization Date: date
URI Parameters
| Parameter | Type | Description |
|---|---|---|
| obscompresspolicy | String | Definition A query parameter in the URI that specifies the operation for an online decompression policy, passed without a value. It is used to distinguish between different policies of a bucket, meaning that this request is for the online decompression policy. Constraints N/A Range Empty (Only the key ?obscompresspolicy is required. No value is needed.) Default Value N/A |
Request Headers
This request uses common headers. For details, see Table 3.
Request Body
This request contains no request body parameters.
Response Syntax
HTTP/1.1 status_code
Server: OBS
Date: date
Content-Type: type
Content-Length: length
{
"rules": [{
"id": "ruleid",
"project": "your project id",
"agency": "testagency",
"events": ["ObjectCreated:*"],
"prefix": "decompress",
"suffix": ".zip",
"overwrite": 0,
"decompresspath": "after-decompress/",
"policytype": "decompress"
}]
} Response Headers
This response uses common headers. For details, see Table 1.
Response Body
This response body contains the JSON configuration of the online decompression rules.
Table 1 describes the response body elements.
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition Unique ID of a rule. Range The value can contain 1 to 256 characters. Only letters, digits, underscores (_), and hyphens (-) are allowed. |
| project | String | Definition ID of the project to which the triggering service belongs. Range A valid project ID |
| agency | String | Definition IAM agency name used to authorize OBS to send messages to the triggering service. Range The name must comply with the IAM agency naming rules. |
| events | Array of string | Definition Trigger event type. Range Event types supported by OBS, for example, ObjectCreated:* |
| prefix | String | Definition Object name prefix that serves as a filter. Only objects matching this prefix trigger decompression. Range 1 to 1,024 characters |
| suffix | String | Definition Object name suffix that serves as a filter. Only objects matching this suffix trigger decompression. Range 1 to 1,024 characters |
| overwrite | Int | Definition Overwrite policy for the files with the same name. Range
|
| decompresspath | String | Definition OBS path for storing decompressed files. Range A valid OBS object path |
| policytype | String | Definition Policy type ID. Range Fixed value: decompress |
Error Responses
No special errors. You can find all errors in Error Code Overview and Table 3.
Sample Request
GET /?obscompresspolicy HTTP/1.1 Host: bucketname.obs.region.myhuaweicloud.com Authorization: OBS H4IPJX0TQTHTHEBQQCEC:sc2PM13Wlfcoc/YZLK0MwsI2Zpo= Date: Tue, 21 Jul 2020 22:28:46 GMT
Sample Response
HTTP/1.1 200 OK
Server: OBS
Date: Tue, 07 Jul 2020 07:28:46 GMT
Content-Type: application/json
Content-Length: 497
{
"rules": [{
"id": "ruleid",
"project": "your project id",
"agency": "testagency",
"events": ["ObjectCreated:*"],
"prefix": "decompress",
"suffix": ".zip",
"overwrite": 0,
"decompresspath": "after-decompress/",
"policytype": "decompress"
}]
} Helpful Links
- For more information about online decompression, see Online Decompression.
- For details about the billing items involved in API operations, see Billing Items.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot