• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference 2.0
  4. API
  5. Cluster Management
  6. Modifying the Access Information of a Specified Cluster

Modifying the Access Information of a Specified Cluster

Function

This API is used to modify the access information of a specified cluster.

URI

PUT /api/v3/projects/{project_id}/clusters/{cluster_id}/mastereip

Table 1 describes the parameters of the API.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Project ID.

cluster_id

Yes

Cluster ID.

Request

Request parameters:

Table 2 describes the request parameters.

Table 2 Parameter description

Parameter

Mandatory

Type

Description

spec

Yes

Table 3

-

Table 3 Data structure of the spec field

Parameter

Mandatory

Type

Description

action

Yes

String

Whether to bind an elastic IP address to the cluster or unbind an elastic IP address from the cluster. The value is bind or unbind (case insensitive).

NOTE:

id need to be configured only when action is set to bind.

spec

No

Table 4

Information about the elastic IP address.

Table 4 Data structure of the spec-spec field

Parameter

Mandatory

Type

Description

id

Yes

String

ID of the elastic IP address.

Example request:

  • Binding an elastic IP address to the cluster
    {
        "spec": {
            "action": "bind",
            "spec": {
                "id": "5be63e51-dc16-48cb-9245-c4ad21725ef1"
            }
        }
    }
  • Unbinding an elastic IP address from the cluster
    {
        "spec": {
            "action": "unbind"
        }
    }

Response

Response parameters:

Table 5 describes the response parameters.

Table 5 Response parameters

Parameter

Type

Description

metadata

json

Metadata.

spec

Table 6

-

status

Table 7

Cluster endpoint.

Table 6 Data structure of the spec field

Parameter

Type

Description

action

String

Whether an EIP is bound to or unbound from the cluster. The value is bind or unbind (case insensitive).

spec

Table 4

Information about the elastic IP address.

elasticIp

String

Elastic IP address.

Table 7 Data structure of the status field

Parameter

Type

Description

privateEndpoint

String

Address for access within the VPC.

publicEndpoint

String

Address for access outside the VPC.

Example response:

{
    "metadata": {},
    "spec": {
        "action": "bind",
        "spec": {
            "id": "0ef26920-3527-405d-a7b4-27106618c2d7",
            "eip": {
                "bandwidth": {
                    "size": 5,
                    "sharetype": "PER"
                }
            },
            "IsDynamic": false
        },
        "elasticIp": "10.154.50.11"
    },
    "status": {
        "privateEndpoint": "https://172.16.0.86:5443",
        "publicEndpoint": "https://10.154.50.11:5443"
    }
}

Status Code

Table 8 describes the status code of the API.

Table 8 Status code

Status Code

Description

200

The progress of the specified job is successfully obtained.

For details about error status codes, see Status Codes.