Queries the detailed information about policy instances of the specified type in a Container Service for Kubernetes (ACK) cluster, such as the policy description and severity level. You can choose a type of security policy for an ACK cluster, specify the action and applicable scope of the policy, and then create and deploy a policy instance.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
cs:DescribePolicyInstances | get |
|
| none |
Request syntax
GET /clusters/{cluster_id}/policies HTTP/1.1
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
cluster_id | string | Yes | The cluster ID. | c8155823d057948c69a**** |
policy_name | string | No | The name of the policy that you want to query. | ACKPSPCapabilities |
instance_name | string | No | The name of the policy instance that you want to query. | allowed-repos-cz4s2 |
Response parameters
Examples
Sample success responses
JSON
format
[
{
"ali_uid": "16298168****",
"cluster_id": "c8155823d057948c69a****",
"instance_name": "no-env-var-secrets-****",
"policy_name": "ACKPSPCapabilities",
"policy_category": "k8s-general",
"policy_description": "Restricts secrets used in pod envs",
"policy_parameters": "\"restrictedNamespaces\": [ \"test\" ]",
"policy_severity": "low",
"policy_scope": "*",
"policy_action": "deny",
"Created": "2024-10-29T18:09:12+08:00",
"Updated": "2024-10-29T18:09:12+08:00",
"resource_id": "123456***",
"total_violations": 0,
"is_deleted": 0
}
]
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-10-23 | The response structure of the API has changed | View Change Details |