All Products
Search
Document Center

Container Service for Kubernetes:DescribePolicyInstances

Last Updated:Apr 17, 2024

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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 keyAssociated operation
cs:DescribePolicyInstancesRead
  • Cluster
    acs:cs:{#regionId}:{#accountId}:cluster/{#ClusterId}
    none
none

Request syntax

GET /clusters/{cluster_id}/policies

Request parameters

ParameterTypeRequiredDescriptionExample
cluster_idstringYes

The cluster ID.

c8155823d057948c69a****
policy_namestringNo

The name of the policy that you want to query.

ACKPSPCapabilities
instance_namestringNo

The name of the policy instance that you want to query.

allowed-repos-cz4s2

Response parameters

ParameterTypeDescriptionExample
object []

The list of the returned policy instances.

ali_uidstring

The UID of the Alibaba Cloud account that is used to deploy the policy instance.

16298168****
cluster_idstring

The ID of the cluster.

c8155823d057948c69a****
instance_namestring

The name of the policy instance.

no-env-var-secrets-****
policy_namestring

The name of the policy.

ACKPSPCapabilities
policy_categorystring

The type of policy.

k8s-general
policy_descriptionstring

The description of the policy template.

Restricts secrets used in pod envs
policy_parametersstring

The parameters of the policy instance.

"restrictedNamespaces": [ "test" ]
policy_severitystring

The severity level of the policy instance.

low
policy_scopestring

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_actionstring

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

Examples

Sample success responses

JSONformat

[
  {
    "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"
  }
]

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history