All Products
Search
Document Center

Quota Center:CreateQuotaAlarm

Last Updated:Apr 19, 2023

Creates a quota alert.

Operation Description

In this example, the operation is called to create a quota alert for a quota whose ID is q_hvnoqv. This quota is the maximum number of rules that can be created by a user. The quota belongs to Cloud Config whose service code is config.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ProductCodestringYes

The abbreviation of the Alibaba Cloud service name.

config
QuotaActionCodestringYes

The ID of the quota.

q_hvnoqv
AlarmNamestringYes

The name of the quota alert.

rules
ThresholdTypestringNo

The type of the quota alert. Valid values:

  • used: The alert is created for the used quota.
  • usable: The alert is created for the available quota.
used
ThresholdfloatNo

The numeric value of the alert threshold. Valid values:

  • If you set the ThresholdType parameter to used, you will receive an alert notification when the used quota is greater than or equal to the preset alert threshold. The alert threshold must be greater than the current used quota.
  • If you set the ThresholdType parameter to usable, you will receive an alert notification when the available quota is less than or equal to the preset alert threshold. The alert threshold must be less than the current available quota.
NoteYou must set one of the Threshold and ThresholdPercent parameters.
150
ThresholdPercentfloatNo

The percentage of the alert threshold. Valid values:

  • If you set the ThresholdType parameter to used, you will receive an alert notification when the used quota is greater than or equal to the preset percentage of the alert threshold. Value range: (50%, 100%].
  • If you set the ThresholdType parameter to usable, you will receive an alert notification when the available quota is less than or equal to the preset percentage of the alert threshold. Value range: (0%, 50%].
NoteYou must set one of the Threshold and ThresholdPercent parameters.
50
WebHookstringNo

The webhook URL. Quota Center sends alert notifications to the specified URL by using HTTP POST requests.

https://alert.aliyun.com/callback
QuotaDimensionsarrayNo

The dimensions.

objectNo

The dimension.

KeystringNo

The key of the quota dimension.

The value range of N varies based on the number of dimensions that are supported by the related Alibaba Cloud service.

NoteThis parameter is required if you set the ProductCode parameter to ecs, ecs-spec, actiontrail, or ess.
regionId
ValuestringNo

The value of the quota dimension.

The value range of N varies based on the number of dimensions that are supported by the related Alibaba Cloud service.

NoteThis parameter is required if you set the ProductCode parameter to ecs, ecs-spec, actiontrail, or ess.
cn-hangzhou

For more information about common request parameters, see API Reference.

Response parameters

ParameterTypeDescriptionExample
object
AlarmIdstring

The ID of the alert.

18b3be23-b7b0-4d45-91bc-d0c331aa****
RequestIdstring

The ID of the request.

BD219E2B-E687-45EE-B5F3-61FB730551B1

Examples

Sample success responses

JSONformat

{
  "AlarmId": "18b3be23-b7b0-4d45-91bc-d0c331aa****",
  "RequestId": "BD219E2B-E687-45EE-B5F3-61FB730551B1"
}

Error codes

HTTP status codeError codeError messageDescription
400QUOTA.UNSUPPORT.ALARMThis quota does not support creating alarmYou cannot create an alert rule for this quota item.
400ALARM.NAME.REPEATThe warning name must be unique.The alert name must be unique.
400QUOTA.ALARM.MAXQuota alarm have reached the upper limit of 100The maximum number of quota alerts has been reached.

For a list of error codes, visit the Service error codes.