To send a Container Service for Kubernetes API request, you must send an HTTP request to the Container Service for Kubernetes endpoint. You must add the request parameters that correspond to the API operation being called. After you call the API, the system returns a response. The request and response are encoded in UTF-8.

Endpoint

The endpoint of the Container Service for Kubernetes API is cs.aliyuncs.com.

Protocol

You can send requests over HTTP or HTTPS. We recommend that you send requests over HTTPS to enhance security.

Request syntax

Container Service for Kubernetes provides a RESTful API. The request syntax is as follows:

HTTPMethod /resource_URI_parameters
RequestHeader
RequestBody
where:
  • HTTPMethod: the method of the HTTP request, such as PUT, POST, GET, and DELETE.
  • resource_URI_parameters: the identifier of the resource to call, for example, cluster.
  • RequestHeader: the request header, which contains information such as the API version, the host name, and authorization information. For more information, see Common parameters.

    Request parameters include both common parameters and operation-specific parameters. The common request header contains information such as the API version and authentication information.

  • RequestBody: the request parameters.

Example:

POST /clusters/cluster_id/attach HTTP/1.1
<Common request header>
{
    "password": "Hello1234",
    "instances": [
        "i-xxxx",
        "i-yyyy"
    ]
}

Request encoding

All requests and responses are encoded in UTF-8.