All Products
Search
Document Center

Container Service for Kubernetes:DescribePolicyInstances

Last Updated:Aug 28, 2026

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cs:DescribePolicyInstances

get

*Cluster

acs:cs:{#regionId}:{#accountId}:cluster/{#ClusterId}

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: Deployments that match the policy are denied.

  • warn: Alerts are generated for deployments that match the policy.

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.