All Products
Search
Document Center

Cloud Config:GetAggregateCompliancePack

Last Updated:Mar 11, 2024

Queries the details of a compliance package in an account group.

Operation description

The topic provides an example on how to query the details of a compliance package whose ID is cp-fdc8626622af00f9**** in an account group whose ID is ca-f632626622af0079****.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
config:GetAggregateCompliancePackRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
CompliancePackIdstringYes

The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see ListAggregateCompliancePacks .

cp-fdc8626622af00f9****
AggregatorIdstringYes

The ID of the account group.

For more information about how to obtain the ID of the account group, see ListAggregators .

ca-f632626622af0079****

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

6EC7AED1-172F-42AE-9C12-295BC2ADB751
CompliancePackobject

The details of the compliance package.

Statusstring

The status of the compliance package. Valid values:

  • ACTIVE: The compliance package was normal.
  • CREATING: The compliance package was being created.
ACTIVE
RiskLevelinteger

The risk level of the resources that are not compliant with the rules in the compliance package. Valid values:

  • 1: high
  • 2: medium
  • 3: low
1
CompliancePackIdstring

The ID of the compliance package.

cp-fdc8626622af00f9****
Descriptionstring

The description of the compliance package.

ConfigRulesobject []

The rules in the compliance package.

ManagedRuleIdentifierstring

The identifier of the managed rule.

eip-bandwidth-limit
ConfigRuleNamestring

The rule name.

ConfigRuleIdstring

The rule ID.

cr-a260626622af0005****
ConfigRuleParametersobject []

The input parameters of the rule.

Requiredboolean

Indicates whether the input parameters are required. Valid values:

  • true
  • false
true
ParameterNamestring

The name of the input parameter.

bandwidth
ParameterValuestring

The value of the input parameter.

10
Descriptionstring

The description of the rule.

RiskLevelinteger

The risk level of the resources that do not comply with the rule. Valid values:

  • 1: high.
  • 2: medium.
  • 3: low.
1
ResourceTypesScopestring

The types of the resources evaluated based on the rule. Multiple resource types are separated with commas (,).

ACS::EIP::EipAddress
TemplateContentstring

The information about the current compliance package template. The rules in the template do not contain custom function rules. You can quickly create the same compliance package for other accounts or account groups based on the template information.

CompliancePackNamestring

The name of the compliance package.

AccountIdlong

The ID of the management account to which the compliance package belongs.

100931896542****
AggregatorIdstring

The ID of the account group.

ca-f632626622af0079****
CompliancePackTemplateIdstring

The ID of the compliance package template.

ct-5f26ff4e06a300c4****
CreateTimestamplong

The timestamp when the compliance package was created. Unit: milliseconds.

1624243657000
Scopeobject

The evaluation scope of the compliance package.

RegionIdsScopestring

The ID of the region whose resources were evaluated by using the compliance package.

cn-hangzhou
ExcludeResourceIdsScopestring

The ID of the resource that is not evaluated by using the compliance package.

eip-8vbf3x310fn56ijfd****
ResourceGroupIdsScopestring

The ID of the resource group whose resources are evaluated by using the compliance package.

rg-aekzc7r7rhx****
TagKeyScopestring

The tag key of the resource that is evaluated by using the compliance package.

ECS
TagValueScopestring

The tag value of the resource that is evaluated by using the compliance package.

test

Examples

Sample success responses

JSONformat

{
  "RequestId": "6EC7AED1-172F-42AE-9C12-295BC2ADB751",
  "CompliancePack": {
    "Status": "ACTIVE",
    "RiskLevel": 1,
    "CompliancePackId": "cp-fdc8626622af00f9****",
    "Description": "",
    "ConfigRules": [
      {
        "ManagedRuleIdentifier": "eip-bandwidth-limit",
        "ConfigRuleName": "",
        "ConfigRuleId": "cr-a260626622af0005****",
        "ConfigRuleParameters": [
          {
            "Required": true,
            "ParameterName": "bandwidth",
            "ParameterValue": "10"
          }
        ],
        "Description": "",
        "RiskLevel": 1,
        "ResourceTypesScope": "ACS::EIP::EipAddress"
      }
    ],
    "TemplateContent": "",
    "CompliancePackName": "",
    "AccountId": 0,
    "AggregatorId": "ca-f632626622af0079****",
    "CompliancePackTemplateId": "ct-5f26ff4e06a300c4****",
    "CreateTimestamp": 1624243657000,
    "Scope": {
      "RegionIdsScope": "cn-hangzhou",
      "ExcludeResourceIdsScope": "eip-8vbf3x310fn56ijfd****",
      "ResourceGroupIdsScope": "rg-aekzc7r7rhx****",
      "TagKeyScope": "ECS",
      "TagValueScope": "test"
    }
  }
}

Error codes

HTTP status codeError codeError messageDescription
400Invalid.AggregatorId.ValueThe specified AggregatorId is invalid.The specified aggregator ID does not exist or you are not authorized to use the aggregator.
400Invalid.CompliancePackId.ValueThe specified CompliancePackId does not exist.The specified compliance pack ID does not exist.
404AccountNotExistedYour account does not exist.The specified account does not exist.
503ServiceUnavailableThe request has failed due to a temporary failure of the server.The request has failed due to a temporary failure of the server.

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

Change history

Change timeSummary of changesOperation
2023-12-13The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 404
    delete Error Codes: 503
Output ParametersThe response structure of the API has changed.
2023-06-12API Description Update. The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
API DescriptionAPI Description Update.
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 404
    delete Error Codes: 503
Output ParametersThe response structure of the API has changed.