创建终态配置。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
oos:CreateStateConfiguration |
create |
*StateConfiguration
|
|
无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| RegionId |
string |
否 |
地域 ID。 |
cn-hangzhou |
| Description |
string |
否 |
终态配置的描述信息。 |
collect inventory data |
| TemplateName |
string |
是 |
模板名称。内容限制为字母、数字、中划线、下划线,长度 200 字符。 |
ACS-ECS-InventoryDataCollection |
| TemplateVersion |
string |
否 |
版本号,如不填默认为最新的版本号。 |
v1 |
| Parameters |
string |
否 |
参数。 |
{ "policy": { "ACS:Application": { "Collection": "Enabled" }, "ACS:Network": { "Collection": "Enabled" } } } |
| ConfigureMode |
string |
否 |
配置模式。 ApplyOnly:配置只应用一次(更新配置后重新应用)。 ApplyAndMonitor: 配置只应用一次,成功应用后,后续只检查配置是否漂移。 ApplyAndAutoCorrect:总是应用配置。 |
ApplyOnce |
| ScheduleType |
string |
是 |
调度类型。可选值:rate。 |
rate |
| ScheduleExpression |
string |
是 |
调度表达式。调度间隔不得小于 30 分钟。 |
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 |
| Tags |
object |
否 |
标签。 |
{"Key": "oos", "Value": "inventory"} |
| ResourceGroupId |
string |
否 |
资源组 ID。 |
rg-acfmxsn4m4****** |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| RequestId |
string |
请求 ID。 |
1306108F-610C-40FD-AAD5-DA13E8B00BE9 |
| StateConfiguration |
object |
终态配置。 |
|
| 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。 |
sc-a538febe18fabcdef |
| ScheduleExpression |
string |
定时表达式。 |
1 hour |
| TemplateName |
string |
模板名称。 |
ACS-ECS-InventoryDataCollection |
| TemplateVersion |
string |
模板版本。 |
v1 |
| ConfigureMode |
string |
配置模式。 |
ApplyAndAutoCorrect |
| ScheduleType |
string |
定时类型。 |
rate |
| Parameters |
object |
参数。 |
{"policy": {"ACS:Network": {"Collection": "Enabled"}, "ACS:Application": {"Collection": "Enabled"}}} |
| Description |
string |
描述信息。 |
collect inventory data |
| ResourceGroupId |
string |
资源组 ID。 |
rg-acfmxsn4m4****** |
| TemplateId |
string |
模板 ID。 |
t-1234asadf |
示例
正常返回示例
JSON格式
{
"RequestId": "1306108F-610C-40FD-AAD5-DA13E8B00BE9",
"StateConfiguration": {
"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": "sc-a538febe18fabcdef",
"ScheduleExpression": "1 hour",
"TemplateName": "ACS-ECS-InventoryDataCollection",
"TemplateVersion": "v1",
"ConfigureMode": "ApplyAndAutoCorrect",
"ScheduleType": "rate",
"Parameters": {
"policy": {
"ACS:Network": {
"Collection": "Enabled"
},
"ACS:Application": {
"Collection": "Enabled"
}
}
},
"Description": "collect inventory data",
"ResourceGroupId": "rg-acfmxsn4m4******",
"TemplateId": "t-1234asadf"
}
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。