You need to enable JavaScript to run this app.
文档中心
弹性伸缩

弹性伸缩

复制全文
下载 pdf
伸缩规则
DescribeScalingPolicies - 查询伸缩规则列表
复制全文
下载 pdf
DescribeScalingPolicies - 查询伸缩规则列表
查询伸缩规则。如果不存在匹配的伸缩规则,则自动忽略,继续查询其他伸缩规则。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:DescribeScalingPolicies​
要执行的操作,取值:DescribeScalingPolicies。​
​
Version string 必选 示例值:2020-01-01​
API的版本,取值:2020-01-01。​
​
ScalingGroupId string 必选 示例值:scg-ybmssdnnhn5pkgyd****​
伸缩组的ID。您可以调用DescribeScalingGroups查询伸缩组ID。​
​
ScalingPolicyIds.N string[] 可选 示例值:sp-ybmvamf8uql8j1fl****​
伸缩规则的ID列表。​
  • 参数 - N:表示伸缩规则的序号,取值:1~10。​
​
PageNumber integer 可选 示例值:1​
伸缩规则列表的页码,默认值:1。​
​
PageSize integer 可选 示例值:10​
分页查询时设置的每页行数,取值:1 ~ 100。​
默认值:10。​
​
ScalingPolicyNames.N string[] 可选 示例值:test-1​
伸缩规则的名称列表。​
  • 参数 - N:表示伸缩规则的序号,取值:1~10。​
​
ScalingPolicyType string 可选 示例值:Scheduled​
伸缩规则的类型,取值:​
  • Scheduled:定时任务。​
  • Recurrence:周期任务。​
  • Alarm:报警任务。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
PageNumber integer 示例值:1​
当前页数。​
​
PageSize integer 示例值:10​
当前分页的行数。​
​
ScalingPolicies object[] 示例值:--​
符合条件的伸缩规则信息。​
ScalingGroupId string 示例值:scg-ybmssdnnhn5pkgyd****​
伸缩规则所属的伸缩组的ID。​
​
ScalingPolicyId string 示例值:sp-ybmvamf8uql8j1fl****​
伸缩规则的ID。​
​
ScalingPolicyName string 示例值:test-1​
伸缩规则的名称。​
​
AlarmPolicy object 示例值:--​
报警任务的详细信息。​
ConditionOperator string 示例值:||​
多指标告警时的判定条件。​
  • &&:多个指标同时成立才判定为触发告警。​
  • ||(默认):任意指标满足条件就判定为触发告警。​
​
Conditions object[]​
多指标监控时的监控指标详细信息。​
说明​
仅当ScalingPolicyType取值为Alarm时有效。​
Threshold string 示例值:10​
监控指标的阈值。​
​
MetricUnit string 示例值:Percent​
监控指标阈值的单位。取值:​
  • Percent。​
  • Bytes/Second(IEC)。​
  • Count/Second。​
  • Count。​
  • Bits/Second(IEC)。​
  • Packet/Second。​
​
MetricName string 示例值:CpuTotal_Max​
监控指标名称,取值:​
  • CpuTotal_Max:带内CPU使用率最大值,表示伸缩组中所有实例CPU使用率的最大值。​
  • CpuTotal_Min:带内CPU使用率最小值。​
  • CpuTotal_Avg:带内CPU使用率平均值。​
  • MemoryUsedUtilization_Max:带内内存使用率最大值。​
  • MemoryUsedUtilization_Min:带内内存使用率最小值。​
  • MemoryUsedUtilization_Avg:带内内存使用率平均值。​
  • Instance_CpuBusy_Max:带外CPU使用率最大值。​
  • Instance_CpuBusy_Min:带外CPU使用率最小值。​
  • Instance_CpuBusy_Avg:带外CPU使用率平均值。​
  • Instance_NetTxBits_Avg: 带外网络流出速率平均值。​
  • Instance_NetRxBits_Avg: 带外网络流入速率平均值。​
  • Instance_NetTxPackets_Avg: 带外网络发送包速率平均值。​
  • Instance_NetRxPackets_Avg: 带外网络接收包速率平均值。​
  • SystemDiskReadBytes_Avg: 带内系统盘读带宽平均值。​
  • SystemDiskWriteBytes_Avg: 带内系统盘写带宽平均值。​
  • SystemDiskReadIOPS_Avg: 带内系统盘读IOPS平均值。​
  • SystemDiskWriteIOPS_Avg: 带内系统盘写IOPS平均值。​
  • NetTcpConnection_Avg: 带内TCP连接数平均值。​
​
ComparisonOperator string 示例值:>​
规则表达式对象。​
  • >:大于​
  • <:小于​
  • =:等于​
​
​
Effective string​
报警任务的生效时间段。​
​
EvaluationCount integer 示例值:3​
当监控指标数据连续几次达到阈值时,即触发伸缩行为。​
​
RuleType string 示例值:Static​
报警任务的类型,取值:​
  • Static:表示由agent采集的静态监控。​
​
Condition object 示例值:--​
单指标监控时的监控指标详细信息。​
说明​
仅当ScalingPolicyType取值为Alarm时有效。​
Threshold string 示例值:10​
监控指标的阈值。​
​
MetricUnit string 示例值:Percent​
监控指标阈值的单位。取值:​
  • Percent。​
  • Bytes/Second(IEC)。​
  • Count/Second。​
  • Count。​
  • Bits/Second(IEC)。​
  • Packet/Second。​
​
MetricName string 示例值:CpuTotal_Max​
监控指标名称,取值:​
  • CpuTotal_Max:带内CPU使用率最大值,表示伸缩组中所有实例CPU使用率的最大值。​
  • CpuTotal_Min:带内CPU使用率最小值。​
  • CpuTotal_Avg:带内CPU使用率平均值。​
  • MemoryUsedUtilization_Max:带内内存使用率最大值。​
  • MemoryUsedUtilization_Min:带内内存使用率最小值。​
  • MemoryUsedUtilization_Avg:带内内存使用率平均值。​
  • Instance_CpuBusy_Max:带外CPU使用率最大值。​
  • Instance_CpuBusy_Min:带外CPU使用率最小值。​
  • Instance_CpuBusy_Avg:带外CPU使用率平均值。​
  • Instance_NetTxBits_Avg: 带外网络流出速率平均值。​
  • Instance_NetRxBits_Avg: 带外网络流入速率平均值。​
  • Instance_NetTxPackets_Avg: 带外网络发送包速率平均值。​
  • Instance_NetRxPackets_Avg: 带外网络接收包速率平均值。​
  • SystemDiskReadBytes_Avg: 带内系统盘读带宽平均值。​
  • SystemDiskWriteBytes_Avg: 带内系统盘写带宽平均值。​
  • SystemDiskReadIOPS_Avg: 带内系统盘读IOPS平均值。​
  • SystemDiskWriteIOPS_Avg: 带内系统盘写IOPS平均值。​
  • NetTcpConnection_Avg: 带内TCP连接数平均值。​
​
ComparisonOperator string 示例值:>​
规则表达式对象。​
  • >:大于​
  • <:小于​
  • =:等于​
​
​
​
AdjustmentValue integer 示例值:1​
伸缩行为的调整数值。​
​
Cooldown integer 示例值:60​
伸缩规则的冷却时间,单位:s。​
​
ScalingPolicyType string 示例值:Scheduled​
伸缩规则的类型,取值:​
  • Scheduled:定时任务。​
  • Recurrence:周期任务。​
  • Alarm:报警任务。​
​
ScheduledPolicy object 示例值:--​
定时任务/周期任务的详细信息。​
LaunchTime string 示例值:2022-04-01T16:00Z​
表示任务的触发时间,默认为此刻。​
  • 当ScalingPolicyType值为Scheduled时,表示定时任务的触发时间。​
  • 当ScalingPolicyType值为Recurrence时:​
  • 如果ScheduledPolicy.RecurrenceType为空,则表示仅按照此处指定的日期和时间执行一次。​
  • 如果ScheduledPolicy.RecurrenceType不为空,则表示周期任务开始时间。​
​
RecurrenceEndTime string 示例值:2022-04-02T16:00Z​
表示周期任务的结束时间。​
说明​
当ScalingPolicyType取值为Recurrence时有效。​
​
RecurrenceValue string 示例值:3​
表示重复执行周期任务的数值。​
说明​
当ScalingPolicyType取值为Recurrence时有效。​
​
RecurrenceType string 示例值:Daily​
表示周期任务的重复周期,取值:​
  • Daily:每XX天执行一次。​
  • Weekly:选择每周中的几天,每天执行一次。​
  • Monthly:选择每月中XX号到XX号,每天执行一次。​
  • Cron:按照指定的Cron表达式执行。​
说明​
当ScalingPolicyType取值为Recurrence时有效。​
​
RecurrenceStartTime string 示例值:2022-04-01T16:00Z​
表示周期任务的开始执行时间。​
说明​
当ScalingPolicyType取值为Recurrence时有效。​
​
​
AdjustmentType string 示例值:QuantityChangeInCapacity​
伸缩规则的伸缩行为, 适用于简单规则和步进规则,取值:​
  • QuantityChangeInCapacity:增加或减少指定数量的实例。​
  • PercentChangeInCapacity:增加或减少指定比例的实例。​
  • TotalCapacity: 将当前伸缩组的实例数量调整到指定数量。​
​
Status string 示例值:Active​
伸缩规则的状态。取值:​
  • Active:已启用。​
  • InActive:已停用。​
​
​
TotalCount integer 示例值:20​
符合条件的伸缩规则总数。​
​
​
​
请求示例​
​
GET /?Action=DescribeScalingPolicies&ScalingGroupId=scg-ybmssdnnhn5pkgyd****&Version=2020-01-01 HTTP/1.1​
Host: auto-scaling.cn-beijing.volcengineapi.com​
X-Date: 20240507T111034Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20240507/cn-beijing/auto_scaling/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "20240507191044074190125159D96104",​
"Version": "2020-01-01",​
"Service": "auto_scaling",​
"Region": "cn-beijing"​
},​
"Result": {​
"PageNumber": 1,​
"PageSize": 10,​
"ScalingPolicies": [​
{​
"ScalingGroupId": "scg-ybmssdnnhn5pkgyd****",​
"ScalingPolicyId": "sp-ybmvamf8uql8j1fl****",​
"ScalingPolicyName": "test-1",​
"AlarmPolicy": {​
"EvaluationCount": 3,​
"RuleType": "Static",​
"Condition": {​
"Threshold": "10",​
"MetricUnit": "Percent",​
"MetricName": "CpuTotal_Max",​
"ComparisonOperator": ">"​
}​
},​
"AdjustmentValue": 1,​
"Cooldown": 60,​
"ScalingPolicyType": "Scheduled",​
"ScheduledPolicy": {​
"LaunchTime": "2022-04-01T16:00Z",​
"RecurrenceEndTime": "2022-04-02T16:00Z",​
"RecurrenceValue": "3",​
"RecurrenceType": "Daily",​
"RecurrenceStartTime": "2022-04-01T16:00Z"​
},​
"AdjustmentType": "QuantityChangeInCapacity",​
"Status": "Active"​
},​
],​
"TotalCount": 20​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
MissingParameter.ScalingGroupId​
The required parameter ScalingGroupId is not supplied.​
伸缩组ID不能为空。​
400​
LimitExceeded.ScalingPolicyId​
You've reached the limit on the number of ScalingPolicyId.​
已达到伸缩规则ID数量上限。​
400​
LimitExceeded.ScalingPolicyNames​
You've reached the limit on the number of ScalingPolicyNames.​
已达到伸缩规则名称数量上限。​
400​
InvalidScalingPolicyType​
The specified ScalingPolicyType is unsupported.​
指定的伸缩规则类型不合法。​
500​
InternalError​
An internal error has occurred.​
内部错误,请重试。如果多次尝试失败,请提交工单。​
​
​
最近更新时间:2025.08.27 19:18:33
这个页面对您有帮助吗?
有用
有用
无用
无用