更新终态配置。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
oos:UpdateStateConfiguration |
update |
*stateconfiguration
|
|
无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| RegionId |
string |
否 |
地域 ID。 |
cn-hangzhou |
| Description |
string |
否 |
描述内容。 |
ACS-ECS-InventoryDataCollection |
| Parameters |
object |
否 |
参数。 |
{ "policy": { "ACS:Application": { "Collection": "Enabled" }, "ACS:Network": { "Collection": "Enabled" } } } |
| ConfigureMode |
string |
否 |
配置模式。 ApplyOnce:配置只应用一次(更新配置后重新应用)。 ApplyAndMonitor: 配置只应用一次,成功应用后,后续只检查配置是否漂移。 ApplyAndAutoCorrect:总是应用配置。 |
ApplyOnce |
| ScheduleType |
string |
否 |
调度类型。 |
rate |
| ScheduleExpression |
string |
否 |
调度表达式。 |
1 hour |
| Targets |
string |
否 |
目标资源。 |
{ "ResourceType": "ALIYUN::ECS::Instance", "Filters": [ { "Type": "All", "RegionId": "cn-hangzhou", "Parameters": { "RegionId": "cn-hangzhou", "Status": "Running" } } ] } |
| ClientToken |
string |
否 |
幂等 token。 |
DASKJJLKADS-AHKLJHJSAKL-AJK |
| StateConfigurationId |
string |
是 |
终态配置 ID。 |
sc-asfgdhj12345 |
| Tags |
object |
否 |
标签。 |
{"Key": "oos", "Value": "sc"} |
| ResourceGroupId |
string |
否 |
资源组 ID。 |
rg-acfmxsn4m4****** |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| RequestId |
string |
请求 ID。 |
1306108F-610C-40FD-AAD5-DA13E8B00BE9 |
| StateConfiguration |
array<object> |
配置清单。 |
|
|
array<object> |
|||
| UpdateTime |
string |
更新时间。 |
2021-03-22T03:13:32Z |
| CreateTime |
string |
创建时间。 |
2021-03-22T03:13:32Z |
| Targets |
string |
目标资源。 |
{ "ResourceType": "ALIYUN::ECS::Instance", "Filters": [ { "Type": "All", "RegionId": "cn-hangzhou", "Parameters": { "RegionId": "cn-hangzhou", "Status": "Running" } } ] } |
| Tags |
object |
标签。 |
{"Key": "oos", "Value": "inventory"} |
| StateConfigurationId |
string |
创建生成的配置 ID。 |
StateConfigurationId |
| ScheduleExpression |
string |
定时表达式。 |
1 hour |
| TemplateName |
string |
模板名称。 |
ACS-ECS-InventoryDataCollection |
| TemplateVersion |
string |
模板版本。 |
v1 |
| ConfigureMode |
string |
配置模式。 |
ApplyAndAutoCorrect |
| ScheduleType |
string |
定时类型。 |
rate |
| Parameters |
string |
参数。 |
{"policy": {"ACS:Network": {"Collection": "Enabled"}, "ACS:Application": {"Collection": "Enabled"}}} |
| Description |
string |
终态配置的描述信息。 |
收集Inventory数据 |
| ResourceGroupId |
string |
资源组 ID。 |
rg-acfmxsn4m4****** |
| TemplateId |
string |
模板 ID。 |
t-1234asadf |
示例
正常返回示例
JSON格式
{
"RequestId": "1306108F-610C-40FD-AAD5-DA13E8B00BE9",
"StateConfiguration": [
{
"UpdateTime": "2021-03-22T03:13:32Z",
"CreateTime": "2021-03-22T03:13:32Z",
"Targets": "{ \"ResourceType\": \"ALIYUN::ECS::Instance\", \"Filters\": [ { \"Type\": \"All\", \"RegionId\": \"cn-hangzhou\", \"Parameters\": { \"RegionId\": \"cn-hangzhou\", \"Status\": \"Running\" } } ] }",
"Tags": {
"Key": "oos",
"Value": "inventory"
},
"StateConfigurationId": "StateConfigurationId",
"ScheduleExpression": "1 hour",
"TemplateName": "ACS-ECS-InventoryDataCollection",
"TemplateVersion": "v1",
"ConfigureMode": "ApplyAndAutoCorrect",
"ScheduleType": "rate",
"Parameters": "{\"policy\": {\"ACS:Network\": {\"Collection\": \"Enabled\"}, \"ACS:Application\": {\"Collection\": \"Enabled\"}}}",
"Description": "收集Inventory数据",
"ResourceGroupId": "rg-acfmxsn4m4******",
"TemplateId": "t-1234asadf"
}
]
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。