Updates a desired-state configuration.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
oos:UpdateStateConfiguration |
update |
*stateconfiguration
|
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The region ID. |
cn-hangzhou |
| Description |
string |
No |
The description. |
ACS-ECS-InventoryDataCollection |
| Parameters |
object |
No |
The parameters. |
{ "policy": { "ACS:Application": { "Collection": "Enabled" }, "ACS:Network": { "Collection": "Enabled" } } } |
| ConfigureMode |
string |
No |
The configuration mode. Valid values: ApplyOnce: The configuration is applied only once. When updated, the new configuration takes effect. ApplyAndMonitor: The configuration is applied only once. After that, the system only checks whether the configuration has drifted. ApplyAndAutoCorrect: The configuration is continuously applied. |
ApplyOnce |
| ScheduleType |
string |
No |
The schedule type. |
rate |
| ScheduleExpression |
string |
No |
The schedule expression. |
1 hour |
| Targets |
string |
No |
The target resources. |
{ "ResourceType": "ALIYUN::ECS::Instance", "Filters": [ { "Type": "All", "RegionId": "cn-hangzhou", "Parameters": { "RegionId": "cn-hangzhou", "Status": "Running" } } ] } |
| ClientToken |
string |
No |
The client token used to ensure the idempotence of the request. |
DASKJJLKADS-AHKLJHJSAKL-AJK |
| StateConfigurationId |
string |
Yes |
The ID of the desired-state configuration. |
sc-asfgdhj12345 |
| Tags |
object |
No |
The tags added to the configuration. |
{"Key": "oos", "Value": "sc"} |
| ResourceGroupId |
string |
No |
The resource group ID. |
rg-acfmxsn4m4****** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
1306108F-610C-40FD-AAD5-DA13E8B00BE9 |
| StateConfiguration |
array<object> |
The details of the configuration. |
|
|
array<object> |
|||
| UpdateTime |
string |
The time when the configuration was updated. |
2021-03-22T03:13:32Z |
| CreateTime |
string |
The time when the configuration was created. |
2021-03-22T03:13:32Z |
| Targets |
string |
The target resources. |
{ "ResourceType": "ALIYUN::ECS::Instance", "Filters": [ { "Type": "All", "RegionId": "cn-hangzhou", "Parameters": { "RegionId": "cn-hangzhou", "Status": "Running" } } ] } |
| Tags |
object |
The tags of the configuration. |
{"Key": "oos", "Value": "inventory"} |
| StateConfigurationId |
string |
The ID of the desired-state configuration. |
StateConfigurationId |
| ScheduleExpression |
string |
The CRON expression. |
1 hour |
| TemplateName |
string |
The name of the template. |
ACS-ECS-InventoryDataCollection |
| TemplateVersion |
string |
The template version. |
v1 |
| ConfigureMode |
string |
The configuration mode. Valid values: |
ApplyAndAutoCorrect |
| ScheduleType |
string |
The schedule type. |
rate |
| Parameters |
string |
The parameters. |
{"policy": {"ACS:Network": {"Collection": "Enabled"}, "ACS:Application": {"Collection": "Enabled"}}} |
| Description |
string |
The description of the desired-state configuration. |
收集Inventory数据 |
| ResourceGroupId |
string |
The resource group ID. |
rg-acfmxsn4m4****** |
| TemplateId |
string |
The template ID. |
t-1234asadf |
Examples
Success response
JSON format
{
"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"
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.