Updates a desired-state configuration.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
oos:UpdateStateConfiguration | update |
|
| 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. After a configuration is updated, the new configuration is applied. ApplyAndMonitor: The configuration is applied only once. After the configuration is applied, the system only checks whether the configuration is migrated in the future. ApplyAndAutoCorrect: The configuration is always applied. | ApplyOnce |
ScheduleType | string | No | The schedule type. | rate |
ScheduleExpression | string | No | The schedule expression. | 1 hour |
Targets | string | No | The resources to be queried. | { "ResourceType": "ALIYUN::ECS::Instance", "Filters": [ { "Type": "All", "RegionId": "cn-hangzhou", "Parameters": { "RegionId": "cn-hangzhou", "Status": "Running" } } ] } |
ClientToken | string | No | The client token that is 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 to be added to the configuration. | {"Key": "oos", "Value": "sc"} |
ResourceGroupId | string | No | The resource group ID. | rg-acfmxsn4m4****** |
Response parameters
Examples
Sample success responses
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": "collect inventory data",
"ResourceGroupId": "rg-acfmxsn4m4******",
"TemplateId": "t-1234asadf"
}
]
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|