Help Center/ Enterprise Switch/ API Reference/ Enterprise Switch/ Updating an Enterprise Switch
Updated on 2025-12-04 GMT+08:00

Updating an Enterprise Switch

Function

This API is used to update the name or description of an enterprise switch.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

esw:instance:update

Write

-

-

-

-

URI

PUT /v3/{project_id}/l2cg/instances/{instance_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

instance_id

Yes

String

  • Definition: Unique ID of an enterprise switch.

  • Constraints: The value is in the UUID format with hyphens (-).

  • Range: N/A

  • Default value: N/A

project_id

Yes

String

  • Definition: ID of the project to which the enterprise switch belongs.

  • Constraints: N/A

  • Range: N/A

  • Default value: N/A

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

instance

Yes

UpdateInstanceOption object

  • Definition: Request body for updating the instance information.

  • Constraints: N/A

  • Range: N/A

  • Default value: N/A

Table 3 UpdateInstanceOption

Parameter

Mandatory

Type

Description

description

No

String

  • Definition: Description of the enterprise switch.

  • Constraints:

    • The value can contain 0 to 255 characters.

    • Angle brackets (<>) are not allowed.

  • Range: N/A

  • Default value: N/A

name

No

String

  • Definition: Name of the enterprise switch.

  • Constraints:

    • The value can contain 1 to 64 characters.

    • The value can contain letters, digits, underscores (_), hyphens (-), and periods (.).

  • Range: N/A

  • Default value: N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

request_id

String

  • Definition: Unique request ID.

  • Constraints: The value is in the UUID format.

  • Range: N/A

  • Default value: N/A

instance

Instance object

  • Definition: Response body for updating the instance information.

  • Constraints: N/A

  • Range: N/A

  • Default value: N/A

Table 5 Instance

Parameter

Type

Description

id

String

  • Definition: Unique ID of the enterprise switch.

  • Constraints: The value is in the UUID format with hyphens (-).

  • Range: N/A

  • Default value: N/A

name

String

  • Definition: Name of the enterprise switch.

  • Constraints:

    • The value can contain 1 to 64 characters.

    • The value can contain letters, digits, underscores (_), hyphens (-), and periods (.).

  • Range: N/A

  • Default value: N/A

project_id

String

  • Definition: ID of the project to which the enterprise switch belongs.

  • Constraints: N/A

  • Range: N/A

  • Default value: N/A

region

String

  • Definition: ID of the region where the enterprise switch is created.

  • Constraints: N/A

  • Range: N/A

  • Default value: N/A

flavor_ref

String

  • Definition: Enterprise switch flavors.

  • Constraints: N/A

  • Range: For details, see the response of the flavor list API.

  • Default value: N/A

ha_mode

String

  • Definition: HA mode of the enterprise switch.

  • Constraints: Currently, only ha is supported.

  • Range: ha

  • Default value: N/A

status

String

  • Definition: Status of the enterprise switch.

  • Constraints: N/A

  • Range:

    • active: The enterprise switch is running.

    • failed: Failed to create the enterprise switch.

    • abnormal: The enterprise switch is abnormal.

    • build: The enterprise switch is being created.

    • frozen: The enterprise switch is frozen.

  • Default value: N/A

created_at

String

  • Definition: Time when the enterprise switch was created.

  • Constraints: The value is a UTC time in the format of yyyy-MM-ddTHH:mm:ss.

  • Range: N/A

  • Default value: N/A

updated_at

String

  • Definition: Time when the enterprise switch was updated.

  • Constraints: The value is a UTC time in the format of yyyy-MM-ddTHH:mm:ss.

  • Range: N/A

  • Default value: N/A

description

String

  • Definition: Description of the enterprise switch.

  • Constraints:

    • The value can contain 0 to 255 characters.

    • Angle brackets (<>) are not allowed.

  • Range: N/A

  • Default value: N/A

tunnel_info

TunnelInfoResult object

  • Definition: Local tunnel information.

  • Constraints: N/A

  • Range: N/A

  • Default value: N/A

charge_infos

PostPaidChargeInfos object

  • Definition: Billing information.

  • Constraints: N/A

  • Range: N/A

  • Default value: N/A

availability_zones

AvailabilityZones object

  • Definition: AZ where the enterprise switch node is located.

  • Constraints: N/A

  • Range: AZs in the current region.

  • Default value: N/A

Table 6 TunnelInfoResult

Parameter

Type

Description

vpc_id

String

  • Definition: ID of the VPC where the enterprise switch is created.

  • Constraints:

    • You need to use the IDs of the VPCs that you can manage.

    • The value is in the UUID format with hyphens (-).

  • Range: N/A

  • Default value: N/A

virsubnet_id

String

  • Definition: ID of the tunnel subnet where the enterprise switch is located.

  • Constraints:

    • You need to use the IDs of the subnets that you can manage. The ID is the network ID in the subnet details.

    • The value is in the UUID format with hyphens (-).

  • Range: N/A

  • Default value: N/A

tunnel_ip

String

  • Definition: Local tunnel IP address of the enterprise switch.

  • Constraints: The value cannot conflict with an existing subnet IP address.

  • Range: A standard IPv4 address, for example, 192.168.1.1.

  • Default value: N/A

tunnel_port

Integer

  • Definition: Tunnel port of the enterprise switch.

  • Constraints: N/A

  • Range: 4789

  • Default value: N/A

tunnel_type

String

  • Definition: The tunnel protocol type of the enterprise switch.

  • Constraints: N/A

  • Range: vxlan

  • Default value: N/A

Table 7 PostPaidChargeInfos

Parameter

Type

Description

charge_mode

String

  • Definition: Billing mode.

  • Constraints: N/A

  • Range: postPaid, indicates the pay-per-use billing mode.

  • Default value: N/A

Table 8 AvailabilityZones

Parameter

Type

Description

primary

String

  • Definition: AZ where the default active node of the enterprise switch is located.

  • Constraints: The value can contain 1 to 128 characters.

  • Range: ID of the AZ in the current region.

  • Default value: N/A

standby

String

  • Definition: AZ where the default standby node of the enterprise switch is located.

  • Constraints: The value can contain 1 to 128 characters.

  • Range: ID of the AZ in the current region.

  • Default value: N/A

Example Requests

PUT https://{endpoint}/v3/88104fcc62a640bfa0a0bf687607621c/l2cg/instances/16b2eea7-5935-445d-8410-083b7064b939

{
  "instance" : {
    "name" : "esw-online-update"
  }
}

Example Responses

Status code: 200

The PUT operation is successful. For more status codes, see Status Codes.

{
  "request_id" : "14f6cf49525c604e5cb67a20d1404b5d",
  "instance" : {
    "name" : "esw-online-update",
    "id" : "16b2eea7-5935-445d-8410-083b7064b939",
    "region" : "cn-southwest-242",
    "status" : "active",
    "description" : null,
    "created_at" : "2025-05-20T07:51:52Z",
    "updated_at" : "2025-07-28T08:29:14Z",
    "project_id" : "88104fcc62a640bfa0a0bf687607621c",
    "flavor_ref" : "l2cg.small.ha",
    "ha_mode" : "ha",
    "availability_zones" : {
      "standby" : "cn-southwest-242a",
      "primary" : "cn-southwest-242a"
    },
    "charge_infos" : {
      "charge_mode" : "postPaid"
    },
    "tunnel_info" : {
      "vpc_id" : "41829b5e-66c0-4928-a3d4-f4570ce81d8f",
      "virsubnet_id" : "71f74174-c3fb-4929-9207-a4256b19e280",
      "tunnel_ip" : "192.168.0.76",
      "tunnel_port" : 4789,
      "tunnel_type" : "vxlan"
    }
  }
}

Status Codes

Status Code

Description

200

The PUT operation is successful. For more status codes, see Status Codes.

Error Codes

See Error Codes.