Queries compliance package templates.
In this topic, the ct-d254ff4e06a300cf****
compliance package template is used as an example. The return result shows the template
name BestPracticesForNetwork
, the template ID ct-d254ff4e06a300cf****
, and the ID of the managed rule slb-servercertificate-expired-check
in the compliance package template.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ListCompliancePackTemplates |
The operation that you want to perform. Set the value to ListCompliancePackTemplates. |
CompliancePackTemplateId | String | No | ct-d254ff4e06a300cf**** |
The ID of the compliance package template. For more information about how to obtain the ID of a compliance package template, see ListCompliancePackTemplates. |
PageSize | Integer | No | 10 |
The number of entries to return on each page. Valid values: 1 to 100. Default value: 10. |
PageNumber | Integer | No | 1 |
The number of the page to return. Pages start from page 1. Default value: 1. |
For more information about common request parameters, see Common parameters.
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
CompliancePackTemplatesResult | Object |
The information about the compliance package templates returned. |
|
PageSize | Integer | 10 |
The number of entries returned on each page. |
PageNumber | Integer | 1 |
The page number of the returned page. |
TotalCount | Long | 1 |
The total number of the compliance package templates returned. |
CompliancePackTemplates | Array of CompliancePackTemplate |
The details of the compliance package template. |
|
RiskLevel | Integer | 1 |
The risk level of the resources that are not compliant with the managed rules in the compliance package. Valid values:
|
Description | String | The compliance package continuously checks the network architecture, workloads, and network security configurations to prevent compliance issues. |
The description of the compliance package. |
ConfigRules | Array of ConfigRules |
The information about managed rules in the compliance package. |
|
Description | String | If the remaining validity period before the SLB certificate expires is longer than the period specified by the input parameter, the resource is evaluated as compliant. Default value: 90. Unit: days. |
The description of the managed rule. |
ManagedRuleIdentifier | String | slb-servercertificate-expired-check |
The identifier of the managed rule. |
ManagedRuleName | String | slb-server-certificate-expired |
The name 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:
|
ParameterName | String | days |
The name of the input parameter. |
ParameterValue | String | 90 |
The expected value of the input parameter. |
RiskLevel | Integer | 1 |
The risk level of the resources that are not compliant with the managed rule. Valid values:
|
CompliancePackTemplateName | String | BestPracticesForNetwork |
The name of the compliance package template. |
CompliancePackTemplateId | String | ct-d254ff4e06a300cf**** |
The ID of the compliance package template. |
RequestId | String | D67FC82F-25AE-4268-A94C-3348340748F9 |
The ID of the request. |
Examples
Sample requests
http(s)://[Endpoint]/?Action=ListCompliancePackTemplates
&CompliancePackTemplateId=ct-d254ff4e06a300cf****
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ListCompliancePackTemplatesResponse>
<CompliancePackTemplatesResult>
<PageSize>10</PageSize>
<PageNumber>1</PageNumber>
<TotalCount>1</TotalCount>
<CompliancePackTemplates>
<RiskLevel>1</RiskLevel>
<Description>The compliance package continuously checks the network architecture, workloads, and network security configurations to prevent compliance issues. </Description>
<ConfigRules>
<Description>If the remaining validity period before the SLB certificate expires is longer than the period specified by the input parameter, the resource is evaluated as compliant. Default value: 90. Unit: days. </Description>
<ManagedRuleIdentifier>slb-servercertificate-expired-check</ManagedRuleIdentifier>
<ManagedRuleName>slb-server-certificate-expired</ManagedRuleName>
<ConfigRuleParameters>
<Required>true</Required>
<ParameterName>days</ParameterName>
<ParameterValue>90</ParameterValue>
</ConfigRuleParameters>
</ConfigRules>
<CompliancePackTemplateName>BestPracticesForNetwork</CompliancePackTemplateName>
<CompliancePackTemplateId>ct-d254ff4e06a300cf****</CompliancePackTemplateId>
</CompliancePackTemplates>
</CompliancePackTemplatesResult>
<RequestId>D67FC82F-25AE-4268-A94C-3348340748F9</RequestId>
</ListCompliancePackTemplatesResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"CompliancePackTemplatesResult" : {
"PageSize" : 10,
"PageNumber" : 1,
"TotalCount" : 1,
"CompliancePackTemplates" : [ {
"RiskLevel" : 1,
"Description": "The compliance package continuously checks the network architecture, workloads, and network security configurations to prevent compliance issues.",
"ConfigRules" : [ {
"Description": "If the remaining validity period before the SLB certificate expires is longer than the period specified by the input parameter, the resource is evaluated as compliant. Default value: 90. Unit: days.",
"ManagedRuleIdentifier" : "slb-servercertificate-expired-check",
"ManagedRuleName": "slb-server-certificate-expired",
"ConfigRuleParameters" : [ {
"Required" : true,
"ParameterName" : "days",
"ParameterValue" : "90"
} ]
} ],
"CompliancePackName": "BestPracticesForNetwork",
"CompliancePackTemplateId" : "ct-d254ff4e06a300cf****"
} ]
},
"RequestId" : "D67FC82F-25AE-4268-A94C-3348340748F9"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | NoPermission | You are not authorized to perform this operation. | The error message returned because you are not authorized to perform the specified operation. |
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.