Domain name for API request: as.intl.tencentcloudapi.com.
This API is used to create a notification policy.
When the notification is sent to a CMQ topic or queue, the following contents are included:
{
"Service": "Tencent Cloud Auto Scaling",
"CreatedTime": "2021-10-11T10:15:11Z", // Activity creation time
"AppId": "100000000",
"ActivityId": "asa-fznnvrja", // Scaling activity ID
"AutoScalingGroupId": "asg-pc2oqu2z", // Scaling group ID
"ActivityType": "SCALE_OUT", // Scaling activity type
"StatusCode": "SUCCESSFUL", // Scaling activity result
"Description": "Activity was launched in response to a difference between desired capacity and actual capacity,
scale out 1 instance(s).", // Scaling activity description
"StartTime": "2021-10-11T10:15:11Z", // Activity starting time
"EndTime": "2021-10-11T10:15:32Z", // Activity ending time
"DetailedStatusMessageSet": [ // A collection of failed attempts during the scaling process (Failed attempts are allowed in a successful scaling activity)
{
"Code": "InvalidInstanceType",
"Zone": "ap-guangzhou-2",
"InstanceId": "",
"InstanceChargeType": "POSTPAID_BY_HOUR",
"SubnetId": "subnet-4t5mgeuu",
"Message": "The specified instance type `S5.LARGE8` is invalid in `subnet-4t5mgeuu`, `ap-guangzhou-2`.",
"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 | Auto scaling group ID. |
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 set of user group IDs. You can query the user group IDs through the ListGroups API. |
TargetType | No | String | Notification receiver type. Valid values: Default value: USER_GROUP . |
QueueName | No | String | CMQ queue name. This parameter is required when TargetType is CMQ_QUEUE or TDMQ_CMQ_QUEUE . |
TopicName | No | String | CMQ topic name. This parameter is required when TargetType is CMQ_TOPIC or 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. |
本页内容是否解决了您的问题?