更新时间:2025-04-28 GMT+08:00
查看策略列表
功能说明
该接口用于查询指定项目下所有策略的详细信息。
请求消息
请求消息头
无
请求参数
无
请求示例
无
响应消息
响应参数
响应参数如表2所示。
参数名称 | 参数类型 | 描述 |
|---|---|---|
id | String | 策略ID。 |
name | String | 策略名称。 |
policy_type | String | 策略类型。 |
rule | 参见表4 | 触发策略的规则 |
create_time | String | 创建时间 |
update_time | String | 更新时间 |
status | String | 状态 |
参数名称 | 参数类型 | 描述 |
|---|---|---|
metric_namespace | String | 命名空间 |
metric_name | String | 指标名称 |
metric_unit | String | 单位 |
period | Integer | 统计周期,单位:秒 |
evaluation_periods | Integer | 连续周期数 |
statistic | String | 统计方式 |
metric_operation | String | 指标操作符 |
metric_threshold | Float | 阈值条件 |
响应示例
{
"errorCode" : "SVCSTG.PE.0",
"errorMessage" : "",
"policies" : [{
"id" : "8accffb6-e0ed-4433-b216-ccf6960eb1ad",
"name" : "alarm",
"group_id" : "77c37e1f-aa0c-438d-8445-39b3997786a2",
"policy_type" : "ALARM",
"rule" : {
"name" : "",
"conditions" : [{
"metric_namespace" : "PAAS.CONTAINER",
"metric_name" : "cpuCoreLimit",
"metric_unit" : "Percent",
"period" : 60,
"evaluation_periods" : 1,
"statistic" : "average",
"metric_operation" : "\u003e",
"metric_threshold" : 100,
"metric_dimensions" : null
}
],
"actions" : [{
"type" : "scale_out_k8s",
"parameters" : {
"scale_unit" : 1
}
}
]
},
"create_time" : "2017-12-21T09:13:42Z",
"update_time" : "2017-12-21T09:13:42Z",
"status" : "enabled"
}, {
"id" : "9aafbd3d-eac4-4a92-a342-5b6f8d60fff2",
"name" : "dingshi2",
"group_id" : "77c37e1f-aa0c-438d-8445-39b3997786a2",
"policy_type" : "SCHEDULED",
"rule" : {
"name" : "",
"conditions" : [{
"launch_time" : "2017-12-22T06:30Z",
"recurrence_type" : "",
"recurrence_value" : "",
"start_time" : "",
"end_time" : ""
}
],
"actions" : [{
"type" : "scale_set_k8s",
"parameters" : {
"scale_unit" : 1
}
}
]
},
"create_time" : "2017-12-21T09:14:00Z",
"update_time" : "2017-12-21T09:14:00Z",
"status" : "enabled"
}
]
} 错误码
错误码 | 错误信息 | 处理措施 |
|---|---|---|
SVCSTG.PE.4031012 | Failed to verify the project ID. | 请检查对应的参数是否符合要求。 |
SVCSTG.PE.5001203 | Query error. | 请联系技术支持工程师解决。 |

