All Products
Search
Document Center

Container Service for Kubernetes:ListClusterKubeconfigStates

Last Updated:Mar 21, 2025

Queries the kubeconfig files that are issued to users for the current cluster and the status of the kubeconfig files.

Operation description

Note
  • To call this operation, make sure that you have ram:ListUsers and ram:ListRoles permissions.
  • To call this operation, make sure that you have the AliyunCSFullAccess permissions.
  • Debugging

    You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

    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:
      • For mandatory resource types, indicate with a prefix of * .
      • 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:ListClusterKubeconfigStatesnone
    *Cluster
    acs:cs:{#regionId}:{#accountId}:cluster/{#ClusterId}
      none
    none

    Request syntax

    GET /clusters/{ClusterId}/kubeconfig/states HTTP/1.1

    Request parameters

    ParameterTypeRequiredDescriptionExample
    ClusterIdstringNo

    The ID of the cluster.

    c82e6987e2961451182edacd74faf****
    pageNumberintegerNo

    The page number.

    • Valid values: ≥ 1.
    • Default value: 1.
    1
    pageSizeintegerNo

    The number of entries per page.

    • Valid values: 10 to 50.
    • Default value: 10
    10

    Response parameters

    ParameterTypeDescriptionExample
    object

    The response body.

    statesarray<object>

    The status list of the kubeconfig files associated with the cluster.

    stateobject
    account_idstring

    The ID of an Alibaba Cloud account, RAM user, or RAM role.

    22855*****************
    account_namestring

    The logon name or role name of the RAM user.

    tom
    account_display_namestring

    The displayed name or role name of the RAM user.

    tom
    account_typestring

    The type of the account.

    • RootAccount: Alibaba Cloud account.
    • RamUser: RAM user.
    • RamRole: RAM role.
    RamUser
    account_statestring

    The status of the account.

    • Active: The account is active.
    • InActive: The account is locked.
    • Deleted: The account is deleted.
    Active
    cert_expire_timestring

    The expiration time of the client certificate for the kubeconfig file.

    2027-07-15T01:32:20Z
    cert_statestring

    The status of the client certificate for the kubeconfig file.

    • Unexpired: The certificate is not expired.
    • Expired: The certificate is expired.
    • Unknown: The status of the certificate is unknown.
    Expired
    revokableboolean

    Indicates whether the client certificate for the kubeconfig file can be revoked.

    true
    pageobject

    The pagination information.

    page_numberinteger

    The page number.

    1
    page_sizeinteger

    The number of entries per page.

    10
    total_countinteger

    The total number of entries returned.

    5

    Examples

    Sample success responses

    JSONformat

    {
      "states": [
        {
          "account_id": "22855*****************",
          "account_name": "tom",
          "account_display_name": "tom",
          "account_type": "RamUser",
          "account_state": "Active",
          "cert_expire_time": "2027-07-15T01:32:20Z",
          "cert_state": "Expired",
          "revokable": true
        }
      ],
      "page": {
        "page_number": 1,
        "page_size": 10,
        "total_count": 5
      }
    }

    Error codes

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

    Change history

    Change timeSummary of changesOperation
    No change history