All Products
Search
Document Center

Cloud Config:ListCompliancePackTemplates

Last Updated:Mar 08, 2023

Queries compliance package templates.

Operation Description

This topic provides an example on how to query the details of a compliance package template whose ID is ct-d254ff4e06a300cf****. The returned result indicates that the template name is BestPracticesForNetwork, the template ID is ct-d254ff4e06a300cf****, and the ID of the managed rule of the template is slb-servercertificate-expired-check.

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 keyAssociation operation
config:ListCompliancePackTemplatesList
  • Config
    acs:config:*:{#accountId}:*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
CompliancePackTemplateIdstringNo

The ID of the compliance package template.

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

ct-d254ff4e06a300cf****
PageSizeintegerNo

The number of entries to return on each page.

Valid values: 1 to 100. Pages start from page 1. Default value: 10.

10
PageNumberintegerNo

The number of the page to return.

Pages start from page 1. Default value: 1.

1

For more information about common request parameters, see Common parameters.

Response parameters

ParameterTypeDescriptionExample
object
CompliancePackTemplatesResultobject

The information about the compliance package templates returned.

PageSizeinteger

The number of entries returned per page.

10
PageNumberinteger

The page number of the returned page.

1
TotalCountlong

The total number of the compliance package templates returned.

1
CompliancePackTemplatesarray

The compliance package templates.

object
RiskLevelinteger

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
1
Descriptionstring

The description of the compliance package.

ConfigRulesarray

The information about managed rules in the compliance package.

object
Descriptionstring

The description of the managed rule.

ManagedRuleIdentifierstring

The ID of the managed rule.

slb-servercertificate-expired-check
ManagedRuleNamestring

The name of the managed rule.

ConfigRuleParametersarray

The input parameters of the managed rule.

object
Requiredboolean

Indicates whether the input parameter is required. Valid values:

  • true: The input parameter is required.
  • false: The input parameter is optional.
true
ParameterNamestring

The name of the input parameter.

days
ParameterValuestring

The value of the input parameter.

90
RiskLevelinteger

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

  • 1: high risk level
  • 2: medium risk level
  • 3: low risk level
1
ControlIdstring

The ID of the regulation.

NoteThis parameter is available only for regulation compliance packages.
3.1
ControlDescriptionstring

The description of the regulation. This parameter is available only for regulation compliance packages.

No classic networks exist.
DefaultEnableboolean

Indicates whether the rule was enabled together with the compliance package. Default value: false. The value true indicates that the rule was enabled together with the compliance package. Valid values:

  • true
  • false
false
CompliancePackTemplateNamestring

The name of the compliance package template.

CompliancePackTemplateIdstring

The ID of the compliance package template.

ct-d254ff4e06a300cf****
Labelsstring

The tag of the compliance package.

LastUpdateinteger

The time when the compliance package was last updated.

1663408308
RequestIdstring

The ID of the request.

D67FC82F-25AE-4268-A94C-3348340748F9

Examples

Sample success responses

JSONformat

{
  "CompliancePackTemplatesResult": {
    "PageSize": 10,
    "PageNumber": 1,
    "TotalCount": 1,
    "CompliancePackTemplates": [
      {
        "RiskLevel": 1,
        "Description": "",
        "ConfigRules": [
          {
            "Description": "",
            "ManagedRuleIdentifier": "slb-servercertificate-expired-check",
            "ManagedRuleName": "",
            "ConfigRuleParameters": [
              {
                "Required": true,
                "ParameterName": "days",
                "ParameterValue": "90"
              }
            ],
            "RiskLevel": 1,
            "ControlId": "3.1",
            "ControlDescription": "No classic networks exist.",
            "DefaultEnable": true
          }
        ],
        "CompliancePackTemplateName": "",
        "CompliancePackTemplateId": "ct-d254ff4e06a300cf****",
        "Labels": "",
        "LastUpdate": 1663408308
      }
    ]
  },
  "RequestId": "D67FC82F-25AE-4268-A94C-3348340748F9"
}

Error codes

HTTP status codeError codeError messageDescription
400NoPermissionYou are not authorized to perform this operation.You are not authorized to perform this operation.
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.