Setting an Analytics Configuration
Function
-
This API is used to set an Analytics configuration.
Calling Method
For details, see Calling APIs.
URI
POST /v1/cdn/statistics/stats-configs
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
config_type |
No |
Integer |
Configuration type. 0: popular content statistics. |
resource_type |
Yes |
String |
Resource type. domain:resource_name: domain name. account:resource_name: account. |
resource_name |
Yes |
String |
Resource name, which is an account or a list of domain names. Separate domain names with commas (,). |
config_info |
Yes |
config_info object |
Configuration information. Top N metrics support only user agent, referer, URL, and origin URL. |
expired_time |
No |
Long |
Time when the Analytics configuration expires. The value is a timestamp in seconds. The time cannot be one year later than the current time. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
url |
No |
TopUrlinReq object |
top_url configuration. |
ua |
No |
TopUa object |
top_ua configuration. |
Response Parameters
Status code: 204
Success response.
Status code: default
Parameter |
Type |
Description |
---|---|---|
error |
ErrMsg object |
Error code and error message. |
Example Requests
Creating an Analytics configuration
post https://cdn.myhuaweicloud.com/v1/cdn/statistics/stats-configs { "config_type" : 0, "resource_type" : "www.example.com", "resource_name" : "all", "config_info" : { "url" : { "enable" : true }, "ura" : { "enable" : true } }, "expired_time" : 1712678400 }
Example Responses
None
Status Codes
Status Code |
Description |
---|---|
204 |
Success response. |
default |
Error response. |
Error Codes
See Error Codes.
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