调用UpdateAutoGroupingRule更新自动转组规则。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
resourcemanager:UpdateAutoGroupingRule |
update |
*全部资源
|
无 | 无 |
请求语法
POST HTTP/1.1
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| RuleId |
string |
是 |
规则 ID。 |
gr-acfo******hy6a |
| RuleName |
string |
是 |
规则名称。 |
A项目线上资源自动转组规则 |
| RuleDesc |
string |
否 |
规则描述。 |
带有标签 {"env": "online"} 和 {"project": "A"} 的资源转移到资源组rg-aek2********qcy |
| RuleContents |
array<object> |
是 |
规则内容列表。 |
|
|
object |
否 |
规则内容。 |
||
| AutoGroupingScopeCondition |
string |
否 |
自动转组范围条件,用于指定需要自动转组的资源范围。 |
{"children":[{"desired":"{\"env\":\"online\", \"project\":\"A\"}","featurePath":"$.tags","featureSource":"RESOURCE","operator":"TagMatchAll"}],"operator":"and"} |
| RuleContentId |
string |
否 |
规则内容 ID。 |
grc-acfo******fwybpq |
| TargetResourceGroupCondition |
string |
是 |
目标资源组条件,用于指定自动转组的目标资源组。 |
{"children":[{"desired":"rg-aek2********qcy","featurePath":"$.resourceGroupId","featureSource":"RESOURCE","operator":"StringEquals"}],"operator":"and"} |
| ResourceGroupIdsScope |
string |
否 |
资源组 ID 范围,多个资源组 ID 用半角逗号(,)分隔。 |
rg-aekz******4b5ea,rg-aek2******fxykq |
| ExcludeResourceGroupIdsScope |
string |
否 |
资源组 ID 排除范围,多个资源组 ID 用半角逗号(,)分隔。 |
rg-aekz******zj2oi,rg-aekz******r62ua |
| RegionIdsScope |
string |
否 |
地域 ID 范围,多个地域 ID 用半角逗号(,)分隔。 |
cn-hangzhou,cn-shanghai |
| ExcludeRegionIdsScope |
string |
否 |
地域 ID 排除范围,多个地域 ID 用半角逗号(,)分隔。 |
cn-beijing,cn-guangzhou |
| ResourceIdsScope |
string |
否 |
资源 ID 范围,多个资源 ID 用半角逗号(,)分隔。 |
i-2zee******ym49kfmwis,vpc-5ts6******fnw493g849a |
| ExcludeResourceIdsScope |
string |
否 |
资源 ID 排除范围,多个资源 ID 用半角逗号(,)分隔。 |
pc-uf6p******4h784y,rmq-cn-******ny0y |
| ResourceTypesScope |
string |
否 |
资源类型范围,多个资源类型用半角逗号(,)分隔。 |
rds.dbinstance,oss.bucket |
| ExcludeResourceTypesScope |
string |
否 |
资源类型排除范围,多个资源类型用半角逗号(,)分隔。 |
mse.cluster,slb.loadbalancer |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
返回结果。 |
||
| RequestId |
string |
请求 ID。 |
7B8A4E7D-6CFF-471D-84DF-195A7A241ECB |
示例
正常返回示例
JSON格式
{
"RequestId": "7B8A4E7D-6CFF-471D-84DF-195A7A241ECB"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | Invalid.AssociatedTransferRule.NotSupported | The associated transfer rule is not supported for this operation. | 关联转组规则不支持更新操作。 |
| 400 | InvalidParameter.ResourceTypesScope | The parameter ResourceTypesScope is invalid. | 参数ResourceTypesScope无效。 |
| 400 | InvalidParameter.ExcludeResourceTypesScope | The parameter ExcludeResourceTypesScope is invalid. | 参数ExcludeResourceTypesScope无效。 |
| 400 | InvalidParameter.ResourceGroupIdsScope | The parameter ResourceGroupIdsScope is invalid. | 参数ResourceGroupIdsScope无效。 |
| 400 | InvalidParameter.ExcludeResourceGroupIdsScope | The parameter ExcludeResourceGroupIdsScope is invalid. | 参数ExcludeResourceGroupIdsScope无效。 |
| 400 | InvalidParameterCombination.BothRegionIdScopes | The combination of parameters RegionIdsScope and ExcludeRegionIdsScope is not allowed. Please select only one of these parameters. | RegionIdsScope和ExcludeRegionIdsScope是互斥的。同一个请求中只能指定其中一个参数。 |
| 400 | InvalidParameterCombination.BothResourceGroupIdScopes | The combination of parameters ResourceGroupIdsScope and ExcludeResourceGroupIdsScope is not allowed. Please select only one of these parameters. | ResourceGroupIdsScope和ExcludeResourceGroupIdsScope是互斥的。同一个请求中只能指定其中一个参数。 |
| 400 | InvalidParameterCombination.BothResourceIdScopes | The combination of parameters ResourceIdsScope and ExcludeResourceIdsScope is not allowed. Please select only one of these parameters. | ResourceIdsScope和ExcludeResourceIdsScope是互斥的。同一个请求中只能指定其中一个参数。 |
| 400 | InvalidParameterCombination.BothResourceTypeScopes | The combination of parameters ResourceTypesScope and ExcludeResourceTypesScope is not allowed. Please select only one of these parameters. | ResourceTypesScope和ExcludeResourceTypesScope是互斥的。同一个请求中只能指定其中一个参数。 |
| 400 | InvalidParameter.RuleContents | The parameter RuleContents is invalid. | RuleContents 参数非法。 |
| 400 | MissingParameter.RuleContents | The parameter RuleContents is required. | RuleContents是必要参数。 |
| 404 | EntityNotExists.AutoGroupingRule | The specified rule is not found. | 指定的规则不存在。 |
| 409 | AutoGroupingNotEnabled | The auto grouping is disabled. | 自动转组已禁用。 |
| 409 | QuotaExceeded.RuleContent | The number of rule contents exceeds the quota. | 创建的分组条件内容数量超过限制。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。