All Products
Search
Document Center

:Query the agent of a cluster

Last Updated:Oct 18, 2023

You can call the DescribeExternalAgent operation to query the agent configurations of a registered cluster. You can deploy the agent configurations in an external cluster. This allows you to access the API server of the cluster.

For more information, see Register an external Kubernetes cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request syntax

GET /k8s/ClusterId/external/agent/deployment?PrivateIpAddress=String HTTP/1.1 
Content-Type:application/json

Request parameters

Request path parameters

Parameter

Type

Required

Example

Description

ClusterId String Yes c106f377e16f34eb1808d6b9362c9****

The ID of the cluster that you want to query.

Request query parameters

Parameter

Type

Required

Example

Description

PrivateIpAddress String No true

Specifies whether to obtain the credentials that are used to access the cluster over the internal network.

  • true: obtains the credentials that are used to access the cluster over the internal network.
  • false: obtains the credentials that are used to access the cluster over the Internet.

Default value: false.

AgentMode String No admin

The permission mode of the agent. Valid values:

admin: the admin mode, which provides full permissions.

restricted: the restricted mode, which provides partial permissions.

Default value: admin.

Response syntax

HTTP/1.1 200
Content-Type:application/json
{
  "config" : "String"
}

Response parameters

Response body parameters

Parameter

Type

Example

Description

config String apiVersion: v1****

The agent configurations in the YAML format.

Examples

Sample requests

GET /k8s/c106f377e16f34eb1808d6b9362c9****/external/agent/deployment?PrivateIpAddress=true HTTP/1.1 
Content-Type:application/json

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<config>apiVersion: v1****</config>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "config" : "apiVersion: v1****"
}

Error codes

For a list of error codes, see Service error codes.