Queries the details of a compliance package.

In this topic, the cp-fdc8626622af00f9**** compliance package is used as an example. The return result shows that the name of the compliance package is ClassifiedProtectionPreCheck, the compliance package is in the ACTIVE state, and the risk level specified for the rules in the compliance package is 1, which indicates high risk level.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes GetCompliancePack

The operation that you want to perform. Set the value to GetCompliancePack.

CompliancePackId String Yes cp-a8a8626622af0082****

The ID of the compliance package.

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

Response parameters

Parameter Type Example Description
RequestId String 6EC7AED1-172F-42AE-9C12-295BC2ADB751

The ID of the request.

CompliancePack Object

The details of the compliance package.

Status String ACTIVE

The status of the compliance package. Valid values:

  • ACTIVE: The compliance package is available for use.
  • CREATING: The compliance package is being created.
CompliancePackId String cp-a8a8626622af0082****

The ID of the compliance package.

RiskLevel Integer 1

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

  • 1: high risk level
  • 2: medium risk level
  • 3: low risk level
Description String The compliance package continuously monitors your resources to check whether the resources are compliant with MLPS 2.0 Level 3. This allows you to perform self-service prechecks and handle resource non-compliance to pass the formal compliance evaluation with efficiency.

The description of the compliance package.

ConfigRules Array of ConfigRules

The rules enabled in the compliance package.

ManagedRuleIdentifier String eip-bandwidth-limit

The identifier of the managed rule.

ConfigRuleName String eip-bandwidth-limit

The name of the rule.

ConfigRuleId String cr-a260626622af0005****

The ID of the rule.

ConfigRuleParameters Array of ConfigRuleParameters

The input parameter settings of the rule.

Required Boolean true

Indicates whether the input parameter is required. Valid values:

  • true
  • false
ParameterName String bandwidth

The name of the input parameter.

ParameterValue String 10

The expected value of the input parameter.

Description String If the available bandwidth of an elastic IP address is greater than or equal to the specified parameter value, the configuration is considered compliant. Default value: 10 MB.

The description of the rule.

RiskLevel Integer 1

The risk level of the resources that are not compliant with the rule. Valid values:

  • 1: high risk level
  • 2: medium risk level
  • 3: low risk level
CompliancePackName String ClassifiedProtectionPreCheck

The name of the compliance package.

AccountId Long 100931896542****

The ID of the Alibaba Cloud account to which the compliance package belongs.

CompliancePackTemplateId String ct-5f26ff4e06a300c4****

The ID of the compliance package template based on which the compliance package was created.

CreateTimestamp Long 1624245766000

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

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetCompliancePack
&CompliancePackId=cp-a8a8626622af0082****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<GetCompliancePackResponse>
    <RequestId>6EC7AED1-172F-42AE-9C12-295BC2ADB751</RequestId>
    <CompliancePack>
        <Status>ACTIVE</Status>
        <CompliancePackId>cp-a8a8626622af0082****</CompliancePackId>
        <RiskLevel>1</RiskLevel>
        <Description>The compliance package continuously monitors your resources to check whether the resources are compliant with MLPS 2.0 Level 3. This allows you to perform self-service prechecks and handle resource non-compliance to pass the formal compliance evaluation with efficiency. </Description>
        <ConfigRules>
            <ManagedRuleIdentifier>eip-bandwidth-limit</ManagedRuleIdentifier>
            <ConfigRuleName>eip-bandwidth-limit</ConfigRuleName>
            <ConfigRuleId>cr-a260626622af0005****</ConfigRuleId>
            <ConfigRuleParameters>
                <Required>true</Required>
                <ParameterName>bandwidth</ParameterName>
                <ParameterValue>10</ParameterValue>
            </ConfigRuleParameters>
            <Description>If the available bandwidth of an elastic IP address is greater than or equal to the specified parameter value, the configuration is considered compliant. Default value: 10 MB. </Description>
            <RiskLevel>1</RiskLevel>
        </ConfigRules>
        <CompliancePackName> ClassifiedProtectionPreCheck </CompliancePackName>
        <CompliancePackTemplateId>ct-5f26ff4e06a300c4****</CompliancePackTemplateId>
        <CreateTimestamp>1624245766000</CreateTimestamp>
    </CompliancePack>
</GetCompliancePackResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "6EC7AED1-172F-42AE-9C12-295BC2ADB751",
  "CompliancePack" : {
    "Status" : "ACTIVE",
    "CompliancePackId" : "cp-a8a8626622af0082****",
    "RiskLevel" : 1,
    "Description" : "The compliance package continuously monitors your resources to check whether the resources are compliant with MLPS 2.0 Level 3. This allows you to perform self-service prechecks and handle resource non-compliance to pass the formal compliance evaluation with efficiency.",
    "ConfigRules" : [ {
      "ManagedRuleIdentifier" : "eip-bandwidth-limit",
      "ConfigRuleName": "eip-bandwidth-limit",
      "ConfigRuleId" : "cr-a260626622af0005****",
      "ConfigRuleParameters" : [ {
        "Required" : true,
        "ParameterName" : "bandwidth",
        "ParameterValue" : "10"
      } ],
      "Description": "If the available bandwidth of an elastic IP address is greater than or equal to the specified parameter value, the configuration is considered compliant. Default value: 10 MB.",
      "RiskLevel" : 1
    } ],
    "CompliancePackName" : "ClassifiedProtectionPreCheck",
    "CompliancePackTemplateId" : "ct-5f26ff4e06a300c4****",
    "CreateTimestamp" : 1624245766000
  }
}

Error codes

Http status code Error code Error message Description
400 Invalid.CompliancePackId.Value The specified CompliancePackId does not exist. The error message returned because the specified compliance package ID does not exist.
404 AccountNotExisted Your account does not exist. The error message returned because your account does not exist.
503 ServiceUnavailable The request has failed due to a temporary failure of the server. The error message returned because the service is unavailable.

For a list of error codes, visit the API Error Center.