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 managed 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 active.
  • 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 managed 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 details of the managed rules that are 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 managed rule.

ConfigRuleId String cr-a260626622af0005****

The ID of the managed rule.

ConfigRuleParameters Array of ConfigRuleParameters

The input parameters of the managed 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.

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>
		<CompliancePackId>cp-a8a8626622af0082****</CompliancePackId>
		<Status>ACTIVE</Status>
		<AccountId>100931896542****</AccountId>
		<CompliancePackName> ClassifiedProtectionPreCheck </CompliancePackName>
		<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>
			<ConfigRuleId>cr-a260626622af0005****</ConfigRuleId>
			<ConfigRuleName>eip-bandwidth-limit</ConfigRuleName>
			<ManagedRuleIdentifier>eip-bandwidth-limit</ManagedRuleIdentifier>
			<ConfigRuleParameters>
				<ParameterValue>10</ParameterValue>
				<Required>true</Required>
				<ParameterName>bandwidth</ParameterName>
			</ConfigRuleParameters>
		</ConfigRules>
		<CompliancePackTemplateId>ct-5f26ff4e06a300c4****</CompliancePackTemplateId>
		<RiskLevel>1</RiskLevel>
		<CreateTimestamp>1624245766000</CreateTimestamp>
	</CompliancePack>
</GetCompliancePackResponse>

JSON format

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

{
  "RequestId" : "6EC7AED1-172F-42AE-9C12-295BC2ADB751",
  "CompliancePack" : {
    "CompliancePackId" : "cp-a8a8626622af0082****",
    "Status" : "ACTIVE",
    "AccountId" : "100931896542****",
    "CompliancePackName" : "ClassifiedProtectionPreCheck",
    "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" : [ {
      "ConfigRuleId" : "cr-a260626622af0005****",
      "ConfigRuleName": "eip-bandwidth-limit",
      "ManagedRuleIdentifier" : "eip-bandwidth-limit",
      "ConfigRuleParameters" : [ {
        "ParameterValue" : "10",
        "Required" : true,
        "ParameterName" : "bandwidth"
      } ]
    } ],
    "CompliancePackTemplateId" : "ct-5f26ff4e06a300c4****",
    "RiskLevel" : 1,
    "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.