All Products
Search
Document Center

:Modify cluster configurations

更新時間:Nov 17, 2023

You can call the ModifyCluster operation to modify the configurations of a cluster by cluster ID.

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 header

This operation uses only common request headers. For more information, see Common request parameters.

Request syntax

PUT /api/v2/clusters/{ClusterId} HTTP/1.1

Request parameters

Parameter

Type

Position

Required

Example

Description

ClusterId String Path Yes cb95aa626a47740afbf6aa099b65****

The cluster ID.

Object Body No

The request parameters.

api_server_eip Boolean Body No true

Specifies whether to associate an elastic IP address (EIP) with the cluster API server. This enables Internet access for the cluster. Valid values:

  • true: associates an EIP with the cluster API server.
  • false: does not associate an EIP with the cluster API server.
api_server_eip_id String Body No eip-wz9fnasl6dsfhmvci****

The ID of the EIP that you want to associate with the cluster API server. The parameter takes effect only if api_server_eip is set to true.

deletion_protection Boolean Body No true

Specifies whether to enable deletion protection for the cluster. If deletion protection is enabled, the cluster cannot be deleted in the Container Service console or by calling API operations. Valid values:

  • true: enables deletion protection for the cluster. This way, the cluster cannot be deleted in the ACK console or by calling API operations.
  • false: disables deletion protection for the cluster. This way, the cluster can be deleted in the ACK console or by calling API operations.

Default value: false.

instance_deletion_protection Boolean Body No true

Specifies whether to enable deletion protection for the instances in the cluster. If deletion protection is enabled, the instances in the cluster cannot be deleted in the console or by calling the API. Valid values:

  • true: enables deletion protection for the instances in the cluster. You cannot delete the instances in the cluster in the console or by calling the API.
  • false: disables deletion protection for the instances in the cluster. You can delete the instances in the cluster in the console or by calling the API.

Default value: false.

ingress_domain_rebinding Boolean Body No true

Specifies whether to remap the test domain name of the cluster. Valid values:

  • true: remaps the test domain name of the cluster.
  • false: does not remap the test domain name of the cluster.

Default value: false.

ingress_loadbalancer_id String Body No lb-wz97kes8tnndkpodw****

The ID of the Server Load Balancer (SLB) instance that is associated with the cluster.

resource_group_id String Body No rg-acfmyvw3wjm****

The ID of the resource group to which the cluster belongs.

maintenance_window maintenance_window Body No

The maintenance window of the cluster. This parameter takes effect only in ACK Pro clusters.

enable_rrsa Boolean Body No true

Specifies whether to enable the RAM Roles for Service Accounts (RRSA) feature. Valid values:

  • true: enables the RRSA feature.
  • false: disables the RRSA feature.
access_control_list Array of String Body No 192.168.1.0/24

The network access control list (ACL) of the SLB instance associated with the API server if the cluster is a registered cluster.

Note: Do not enter 0.0.0.0/0.

cluster_name String Body No cluster-new-name

The cluster name.

The name must be 1 to 63 characters in length, and can contain digits, letters, and hyphens (-). The name cannot start with a hyphen (-).

Response parameters

Parameter

Type

Example

Description

cluster_id String cb95aa626a47740afbf6aa09****

The cluster ID.

request_id String 687C5BAA-D103-4993-884B-C35E4314****

The request ID.

task_id String T-5a54309c80282e39ea00****

The task ID.

Examples

Sample requests

PUT /api/v2/clusters/cb95aa626a47740afbf6aa099b65**** HTTP/1.1 
Content-Type:application/json
{
  "api_server_eip" : true,
  "api_server_eip_id" : "eip-wz9fnasl6dsfhmvci****",
  "deletion_protection" : true,
  "instance_deletion_protection" : true,
  "ingress_domain_rebinding" : "true",
  "ingress_loadbalancer_id" : "lb-wz97kes8tnndkpodw****",
  "resource_group_id" : "rg-acfmyvw3wjm****",
  "maintenance_window" : {
    "enable" : false,
    "maintenance_time" : "03:00:00Z",
    "duration" : "3h",
    "weekly_period" : "Monday,Thursday"
  }
}

Sample success responses

XML format

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

<cluster_id>cb95aa626a47740afbf6aa09****</cluster_id>
<request_id>687C5BAA-D103-4993-884B-C35E4314****</request_id>
<task_id>T-5a54309c80282e39ea00****</task_id>

JSON format

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

{
  "cluster_id" : "cb95aa626a47740afbf6aa09****",
  "request_id" : "687C5BAA-D103-4993-884B-C35E4314****",
  "task_id" : "T-5a54309c80282e39ea00****"
}

Error codes

For more error codes, see Service error codes.