Domain name for API request: as.intl.tencentcloudapi.com.
This API is used to create a notification.
This API is used to send notifications to a CMQ topic or queue with the following message content:.
{
"Service": "Tencent Cloud Auto Scaling",
"CreatedTime": "2021-10-11T10:15:11Z", // Activity creation time.
"AppId": "100000000",
"ActivityId": "asa-fznnvrja", // scaling activity ID.
This API is used to specify the scaling group ID.
"ActivityType": "SCALE_OUT", // scaling activity type.
"StatusCode": "SUCCESSFUL".
"Description": "Activity was launched in response to a difference between desired capacity and actual capacity,
This API is used to scale out 1 instance.
This API is used to set the activity start time.
"EndTime": "2021-10-11T10:15:32Z", // activity end time.
"DetailedStatusMessageSet": [ // Collection of activity internal errors (non-empty does not mean activity failure).
{
"Code": "InvalidInstanceType",
"Zone": "ap-guangzhou-6",
"InstanceId": "",
"InstanceChargeType": "POSTPAID_BY_HOUR",
"SubnetId": "subnet-4t5mgeuu",
"Message": "The specified instance type `S5.LARGE8` is invalid in `subnet-4t5mgeuu`, `ap-guangzhou-6`.",
"InstanceType": "S5.LARGE8"
}
]
}A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: CreateNotificationConfiguration. |
| Version | Yes | String | Common Params. The value used for this API: 2018-04-19. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| AutoScalingGroupId | Yes | String | Scaling group ID. obtain the scaling group ID by logging in to the console (https://console.tencentcloud.com/autoscaling/group) or calling the api DescribeAutoScalingGroups (https://www.tencentcloud.com/document/api/377/20438?from_cn_redirect=1), and retrieve AutoScalingGroupId from the returned information. |
| NotificationTypes.N | Yes | Array of String | Notification type, i.e., the set of types of notifications to be subscribed to. Value range: |
| NotificationUserGroupIds.N | No | Array of String | Notification GROUP ID, which is the USER GROUP ID collection. USER GROUP ID can be accessed through ListGroups. this parameter is valid only when TargetType is USER_GROUP. |
| TargetType | No | String | Notification receiver type. values as follows:. Default value: USER_GROUP. |
| QueueName | No | String | TDMQ CMQ QUEUE name. this field is required if TargetType value is TDMQ_CMQ_QUEUE. |
| TopicName | No | String | TDMQ CMQ TOPIC name. this field is required when TargetType is TDMQ_CMQ_TOPIC. |
| Parameter Name | Type | Description |
|---|---|---|
| AutoScalingNotificationId | String | Notification ID. |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
POST / HTTP/1.1
Host: as.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateNotificationConfiguration
<Common request parameters>
{
"AutoScalingGroupId": "asg-12wjuh0s",
"NotificationUserGroupIds": [
"1678"
],
"NotificationTypes": [
"SCALE_OUT_FAILED",
"SCALE_OUT_SUCCESSFUL"
]
}{
"Response": {
"AutoScalingNotificationId": "asn-2sestqbr",
"RequestId": "fb02c8bd-5f38-4786-91b6-0c6e06a88832"
}
}
POST / HTTP/1.1
Host: as.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateNotificationConfiguration
<Common request parameters>
{
"AutoScalingGroupId": "asg-pc2oqu2z",
"NotificationTypes": [
"SCALE_OUT_FAILED"
],
"TargetType": "CMQ_QUEUE",
"QueueName": "test-queue"
}{
"Response": {
"AutoScalingNotificationId": "asn-03kyokwk",
"RequestId": "8565bcc0-7b02-4e9c-ae9f-27e3d3d73e12"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| InvalidParameter.ActionNotFound | Invalid Action request. |
| InvalidParameterValue.ConflictNotificationTarget | Conflicting notification receiver type. |
| InvalidParameterValue.InvalidAutoScalingGroupId | Invalid scaling group ID. |
| InvalidParameterValue.InvalidNotificationUserGroupId | The notification group ID should be a numeric string. |
| InvalidParameterValue.LimitExceeded | The value exceeds the limit. |
| InvalidParameterValue.UserGroupIdNotFound | The user group does not exist. |
| LimitExceeded | The quota limit is exceeded. |
| LimitExceeded.QuotaNotEnough | You are short of the quota. |
| MissingParameter | Parameter missing. |
| ResourceNotFound.AutoScalingGroupNotFound | The scaling group does not exist. |
| ResourceNotFound.CmqQueueNotFound | The specified CMQ queue does not exist. |
| ResourceNotFound.TDMQCMQQueueNotFound | The TDMQ-CMQ queue doesn't exist. |
| ResourceNotFound.TDMQCMQTopicNotFound | The TDMQ-CMQ topic doesn't exist. |
| ResourceUnavailable.CmqTopicHasNoSubscriber | There are no subscribers for the specified CMQ topic. |
| ResourceUnavailable.TDMQCMQTopicHasNoSubscriber | The TDMQ-CMQ topic is not subscribed. |
フィードバック