All Products
Search
Document Center

Resource Management:GetAutoGroupingRule

Last Updated:Dec 15, 2025

Queries the information about a transfer rule.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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.
OperationAccess levelResource typeCondition keyAssociated operation
resourcemanager:GetAutoGroupingRuleget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RuleIdstringYes

The ID of the rule.

gr-acfo******hy6a

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

Ruleobject

The information about the rule.

CreateTimestring

The time when the rule was created.

2025-01-01T10:00:00+08:00
ExcludeRegionIdsScopestring

The IDs of excluded regions. Multiple IDs are separated by commas (,).

cn-hangzhou,cn-shanghai
ExcludeResourceGroupIdsScopestring

The IDs of excluded resource groups. Multiple IDs are separated by commas (,).

rg-aekz******4b5ea,rg-aek2******fxykq
ExcludeResourceIdsScopestring

The IDs of excluded resources. Multiple IDs are separated by commas (,).

i-2zee******ym49kfmwis,vpc-5ts6******fnw493g849a
ExcludeResourceTypesScopestring

The excluded resource types. Multiple resource types are separated by commas (,).

ecs.instance,vpc.vpc
ModifyTimestring

The time when the rule was modified.

2025-01-01T10:00:00+08:00
RegionIdsScopestring

The IDs of regions. Multiple IDs are separated by commas (,).

cn-hangzhou,cn-shanghai
ResourceGroupIdsScopestring

The IDs of resource groups. Multiple IDs are separated by commas (,).

rg-aekz******4b5ea,rg-aek2******fxykq
ResourceIdsScopestring

The IDs of resources. Multiple IDs are separated by commas (,).

i-2zee******ym49kfmwis,vpc-5ts6******fnw493g849a
ResourceTypesScopestring

The resource types. Multiple resource types are separated by commas (,).

ecs.instance,vpc.vpc
RuleContentsarray<object>

The content records of the rule.

RuleContentobject

The content record of the rule.

AutoGroupingScopeConditionstring

The condition for the range of resources that are automatically transferred.

{"children":[{"desired":"{\"env\":\"online\", \"project\":\"A\"}","featurePath":"$.tags","featureSource":"RESOURCE","operator":"TagMatchAll"}],"operator":"and"}
RuleContentIdstring

The ID of the content record.

grc-acfo******fwybpq
TargetResourceGroupConditionstring

The condition for the destination resource group.

{"children":[{"desired":"rg-aek2********qcy","featurePath":"$.resourceGroupId","featureSource":"RESOURCE","operator":"StringEquals"}],"operator":"and"}
RuleDescstring

The description of the rule.

Transfer resources to which the {"env": "online"} and {"project": "A"} tags are added to the resource group rg-aek2********qcy.
RuleIdstring

The ID of the rule.

gr-acfo******hy6a
RuleNamestring

The name of the rule.

Custom Transfer Rule for Online Resources of Project A
RuleTypestring

The type of the rule. Valid values:

  • custom_condition: custom transfer rule
  • associated_transfer: transfer rule for associated resources
associated_transfer
RequestIdstring

The request ID.

9EA4F962-1A2E-4AFE-BE0C-B14736FC46CC

Examples

Sample success responses

JSONformat

{
  "Rule": {
    "CreateTime": "2025-01-01T10:00:00+08:00",
    "ExcludeRegionIdsScope": "cn-hangzhou,cn-shanghai\n",
    "ExcludeResourceGroupIdsScope": "rg-aekz******4b5ea,rg-aek2******fxykq\n",
    "ExcludeResourceIdsScope": "i-2zee******ym49kfmwis,vpc-5ts6******fnw493g849a",
    "ExcludeResourceTypesScope": "ecs.instance,vpc.vpc",
    "ModifyTime": "2025-01-01T10:00:00+08:00",
    "RegionIdsScope": "cn-hangzhou,cn-shanghai",
    "ResourceGroupIdsScope": "rg-aekz******4b5ea,rg-aek2******fxykq\n",
    "ResourceIdsScope": "i-2zee******ym49kfmwis,vpc-5ts6******fnw493g849a",
    "ResourceTypesScope": "ecs.instance,vpc.vpc",
    "RuleContents": [
      {
        "AutoGroupingScopeCondition": {
          "children": [
            {
              "desired": {
                "env": "online",
                "project": "A"
              },
              "featurePath": "$.tags",
              "featureSource": "RESOURCE",
              "operator": "TagMatchAll"
            }
          ],
          "operator": "and"
        },
        "RuleContentId": "grc-acfo******fwybpq",
        "TargetResourceGroupCondition": {
          "children": [
            {
              "desired": "rg-aek2********qcy",
              "featurePath": "$.resourceGroupId",
              "featureSource": "RESOURCE",
              "operator": "StringEquals"
            }
          ],
          "operator": "and"
        }
      }
    ],
    "RuleDesc": "Transfer resources to which the {\"env\": \"online\"} and {\"project\": \"A\"} tags are added to the resource group rg-aek2********qcy.",
    "RuleId": "gr-acfo******hy6a",
    "RuleName": "Custom Transfer Rule for Online Resources of Project A",
    "RuleType": "associated_transfer"
  },
  "RequestId": "9EA4F962-1A2E-4AFE-BE0C-B14736FC46CC"
}

Error codes

HTTP status codeError codeError messageDescription
404EntityNotExists.AutoGroupingRuleThe specified rule is not found.The specified rule is not found.
409AutoGroupingNotEnabledThe auto grouping is disabled.The auto grouping is disabled.

For a list of error codes, visit the Service error codes.