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.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cs:DescribePolicyInstances |
get |
*Cluster
|
None | None |
Request syntax
GET /clusters/{cluster_id}/policies HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| cluster_id |
string |
Yes |
The ID of the cluster. |
c8155823d057948c69a**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| 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 elements
|
Element |
Type |
Description |
Example |
|
array |
A list of policy instances. |
||
|
object |
The policy instance. |
||
| ali_uid |
string |
The UID of the Alibaba Cloud account that is used to deploy the policy instance. |
16298168**** |
| cluster_id |
string |
The ID of the cluster. |
c8155823d057948c69a**** |
| instance_name |
string |
The name of the policy instance. |
no-env-var-secrets-**** |
| policy_name |
string |
The name of the policy. |
ACKPSPCapabilities |
| policy_category |
string |
The type of the policy. |
k8s-general |
| policy_description |
string |
The description of the policy template. |
Restricts secrets used in pod envs |
| policy_parameters |
string |
The parameters of the policy instance. |
"restrictedNamespaces": [ "test" ] |
| policy_severity |
string |
The severity level of the policy instance. |
low |
| policy_scope |
string |
The applicable scope of the policy instance. A value of * indicates all namespaces in the cluster. This is the default value. Multiple namespaces are separated by commas (,). |
* |
| policy_action |
string |
The action of the policy. Valid values:
|
deny |
Created
deprecated
|
string |
The creation time of the instance. This parameter is deprecated. |
2024-10-29T18:09:12+08:00 |
Updated
deprecated
|
string |
The update time of the instance. This parameter is deprecated. |
2024-10-29T18:09:12+08:00 |
resource_id
deprecated
|
string |
The ID of the resource. This parameter is deprecated. |
123456*** |
total_violations
deprecated
|
integer |
The number of violations processed in the cluster. This parameter is deprecated. |
0 |
is_deleted
deprecated
|
integer |
The status of the deletion. This parameter is deprecated. |
0 |
Examples
Success response
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
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.