Updated on 2024-04-18 GMT+08:00

Unbinding a Virtual IP Address from an ECS NIC

Function

A virtual IP address provides the second IP address for one or multiple ECS NICs, improving high availability between the ECSs.

This API is used to unbind a virtual IP address from an ECS NIC. After the NIC is unbound, it is not deleted. For instructions about how to delete an ECS NIC, see Deleting NICs from an ECS in a Batch.

URI

PUT /v1/{project_id}/cloudservers/nics/{nic_id}

Table 1 describes the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

For details about how to obtain the ID, see Obtaining a Project ID.

nic_id

Yes

Specifies the ECS NIC ID.

Request

Table 2 describes the request parameters.
Table 2 Request parameters

Parameter

Mandatory

Type

Description

nic

Yes

Object

Specifies the NIC parameters required for unbinding a virtual IP address. For details, see Table 3.

Table 3 nic field description

Parameter

Mandatory

Type

Description

subnet_id

Yes

String

Specifies the information about the NICs to be added to an ECS.

This parameter must be left blank when you unbind the virtual IP address from an ECS NIC.

ip_address

Yes

String

Specifies the virtual IP address to be unbound from a NIC.

This parameter must be left blank when you unbind the virtual IP address from an ECS NIC.

reverse_binding

No

Boolean

Indicates the allowed_address_pairs attribute of a virtual IP address, specifying whether the NIC IP/MAC address pair is added.

Response

Table 4 describes the response parameters.
Table 4 Response parameters

Parameter

Type

Description

port_id

String

Specifies the ECS NIC ID.

Example Request

Unbind a virtual IP address from an ECS NIC.

PUT https://{endpoint}/v1/{project_id}/cloudservers/nics/{nic_id}

{
    "nic": { 
           "subnet_id": "",
           "ip_address": "",
           "reverse_binding": false
    }
}

Example Response

{
   "port_id": "d32019d3-bc6e-4319-9c1d-6722fc136a23"
}

Error Codes

See Error Codes.