Dynamic Web Acceleration,Media Acceleration VoD,Media Acceleration Live Broadcast,Content Acceleration
Modify amazon s3 access authorization configurations. The interface * can be domain name or domain id.
Single user trigger frequency: 300/5min
| Name | Description |
|---|---|
*domainString | Domain ID or domain name. |
| Name | Description |
|---|---|
*amazon-s3-access-authorization-rulesList | Amazon S3 Access Authorization Configuration, parent node
1. When you need to configure the Amazon S3 Access Authorization rules, this must be filled in.
2. Configuration of clearing for |
*path-patternString | The url matching mode. If all matches, the input parameters can be configured as: .* |
except-path-patternString | The exception url matching mode. |
*add-authorization-headerString | Define whether to add Authorization header when back to Amazon S3 source. Allowed true and false. |
*access-keyString | access key |
*access-key-idString | access key id |
signature-versionString | Signature version, default value is 2. Support 2 and 4. |
regionString | Authorization region. Please refer to the AWS official site for detail. |
data-idLong | Data-id is to indicate a specific group configuration when the client has multiple groups of configurations. Data-id can be retrieved through a query interface. Note:
A. If data-id is passed, it means that one group of configuration items is specified to be modified, and no other group configuration items need to be modified.
B. If multiple groups of configurations are included, some of them are configured with data-id and others are not, then the expression of data-id is used to modify a specific group of configurations, and a new group of configurations is added on the original basis without the expression of data-id.
C. If the data-id is not transmitted, it means that the original configuration will be fully covered by this configuration.
D. If no configuration parameter is passed, only domain name and secondary label are passed, which means that all configuration of domain name secondary service corresponding to this interface is cleared.
E. If there is no specific configuration item in a set of configurations, the data-id must be filled in, and the value is the actual data-id, which means clearing the value of the corresponding data-id configuration item; it is not allowed that there is no specific configuration item or data-id in a set of configurations. |
| Name | Description |
|---|---|
codeString | The error code, when HTTPStatus is not 202, indicates the type of error the current request is calling. |
messageString | Response information, when success is successful |
| Error code(code) | Description(message) | HTTP status | Semantic |
|---|---|---|---|
| InvalidParameter | No amazon-s3-access-authorization-rules was specified. | 400 | No amazon-s3-access-authorization-rules was specified. |
| InvalidParameter | The request has null config with null data-id, please remove it. | 400 | The request has null config with null data-id, please remove it. |
| InvalidParameter | The specified path-pattern could not be blank. | 400 | The specified path-pattern could not be blank. |
| InvalidParameter | The specified add-authorization-header could not be blank. | 400 | The specified add-authorization-header could not be blank. |
| InvalidParameter | The specified add-authorization-header is invalid. | 400 | The specified add-authorization-header is invalid. |
| InvalidParameter | The specified access-key could not be blank. | 400 | The specified access-key could not be blank. |
| InvalidParameter | The specified access-key-id could not be blank. | 400 | The specified access-key-id could not be blank. |
| InvalidParameter | The specified signature-version could not be blank. | 400 | The specified signature-version could not be blank. |
| InvalidParameter | The specified signature-version is invalid. | 400 | The specified signature-version is invalid. |
| NoSuchDomain | The specified domain does not exist. | 404 | The specified domain does not exist. |
| CustomerNoOwnDomain | customer not own domain name[{0}] | 400 | customer not own domain name[{0}] |
#!/bin/bash
username="example_username"
apiKey="example_apiKey"
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://{@apiDomain}/api/config/amazons3access/123344" \
-X "PUT" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-d '
{
"amazon-s3-access-authorization-rules":[
{
"data-id":"1",
"add-authorization-header":"true",
"path-pattern":".*",
"except-path-pattern":"",
"access-key":"yourAccessKey",
"access-key-id":"yourAccessKeyID",
"signature-version":"4",
"region":"us-east-1"
}
]
}'HTTP/1.1 202 Accepted
Date: Sun, 05 May 2019 09:08:53 GMT
Content-Type: application/json;charset=utf-8
x-cnc-request-id: 83bbebc7-2c95-47d7
{"message":"success"}