Operation description
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
cms:PutCustomMetric | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
MetricList | array<object> | Yes | ||
object | Yes | |||
Type | string | Yes | The type of the reported data. Valid values of N: 1 to 21. Valid values:
Note
We recommend that you report aggregate data in both the aggregation periods of 60s and 300s. Otherwise, you cannot query monitoring data in a time span that is more than seven days.
| 0 |
MetricName | string | Yes | The name of the metric. Valid values of N: 1 to 21. For more information, see Appendix 1: Metrics. | cpu_total |
Time | string | No | The timestamp when the metric data is generated. Valid values of N: 1 to 21. The timestamp can be in one of the following formats:
| 1508136760000 |
GroupId | string | Yes | The ID of the application group. Valid values of N: 1 to 21. Note
If the metric does not belong to any application group, enter 0.
| 12345 |
Values | string | Yes | The collection of metric values. Valid values of N: 1 to 21. Note
If the MetricList.N.Type parameter is set to 0, the keys in this parameter must be set to the specified value. CloudMonitor aggregates raw data in each aggregation period to generate multiple statistical values, such as the maximum value, the count, and the total value.
| {"value":10.5} |
Dimensions | string | Yes | The dimensions that specify the resources whose monitoring data you want to query. Valid values of N: 1 to 21. Set the value to a collection of key-value pairs. Format: The key or value must be 1 to 64 bytes in length. Excessive characters are truncated. The key or value can contain letters, digits, periods (.), hyphens (-), underscores (_), forward slashes (/), and backslashes (\). Note
Dimensions must be formatted as a JSON string in a specified order.
| {"sampleName1":"value1","sampleName2":"value2"} |
Period | string | No | The aggregation period. Valid values of N: 1 to 21. Unit: seconds. Valid values: 60 and 300. Note
If the MetricList.N.Type parameter is set to 1, the MetricList.N.Period parameter is required.
| 60 |
Response parameters
Examples
Sample success responses
JSON
format
{
"Code": "200",
"Message": "The request has failed due to a temporary failure of the server.",
"RequestId": "05B36C2C-5F6E-48D5-8B41-CE36DD7EE8E0"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | %s | %s |
500 | InternalError | %s |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|