Files
doc-exports/docs/vpc/api-ref/UpdatePublicips.html
fanqinying 7655950d89 VPC API 20251113 version
Reviewed-by: Hajba, László Antal <laszlo-antal.hajba@t-systems.com>
Co-authored-by: fanqinying <fanqinying@huawei.com>
Co-committed-by: fanqinying <fanqinying@huawei.com>
2026-04-10 09:21:14 +00:00

116 KiB

Updating an EIP

Function

This API is used to update an EIP.

URI

PUT /v3/{project_id}/eip/publicips/{publicip_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition:

Project ID.

Range:

N/A.

Maximum: 32

publicip_id

Yes

String

EIP ID

Minimum: 36

Maximum: 36

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

publicip

Yes

UpdatePublicipOption object

EIP

Table 3 UpdatePublicipOption

Parameter

Mandatory

Type

Description

alias

No

String

  • Definition: EIP name

Minimum: 0

Maximum: 64

description

No

String

  • Definition: Supplementary information about the EIP.

  • Range: The value can contain 0 to 255 characters and cannot contain the following special characters: <>

Minimum: 0

Maximum: 255

associate_instance_type

No

String

  • Definition: Type of the instance with an EIP bound.

  • Range:

    • PORT (Instance type, including ECS, BMS, and CCE)

    • NATGW (NAT gateway type)

    • ELB (Load balancer type)

    • ELBV1 (ELB V1 load balancer type)

    • VPN (VPN instance type)

  • Constraints:

    • If both associate_instance_type and associate_instance_id are not left empty, the EIP is bound to an instance.

    • If both associate_instance_type and associate_instance_id are null, an instance is unbound. You can configure associate_instance_type and associate_instance_id to null on API Explorer. For details, see the example request for unbinding an EIP from an instance.

    • A dual-stack EIP cannot have its bound instance changed.

Minimum: 0

Maximum: 36

associate_instance_id

No

String

  • Definition: ID of the bound instance, such as a load balancer ID or an ECS network interface ID.

  • Constraints:

    • If both associate_instance_type and associate_instance_id are not left empty, the EIP is bound to an instance.

    • If both associate_instance_type and associate_instance_id are null, an instance is unbound. You can configure associate_instance_type and associate_instance_id to null on API Explorer. For details, see the example request for unbinding an EIP from an instance.

    • A dual-stack EIP cannot have its bound instance changed.

Minimum: 0

Maximum: 36

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

request_id

String

Request ID.

publicip

PublicipUpdateResp object

Response object of updating an EIP

Table 5 PublicipUpdateResp

Parameter

Type

Description

id

String

  • Definition: EIP ID, which uniquely identifies the EIP.

project_id

String

  • Definition: Project ID.

ip_version

Integer

  • Definition: IP address version

  • Range:

    • 4: IPv4 EIP

    • 6: IPv6 EIP

public_ip_address

String

  • Definition: EIP or IPv6 port address.

public_ipv6_address

String

  • Definition: Obtained EIP if IPv6 EIPs are available. This parameter does not exist if only IPv4 EIPs are available.

status

String

  • Definition: EIP status

  • Range:

    • FREEZED: frozen

    • BIND_ERROR: failed to be bound

    • BINDING: being bound

    • PENDING_DELETE: being released

    • PENDING_CREATE: being created

    • NOTIFYING: being created

    • NOTIFY_DELETE: being released

    • PENDING_UPDATE: being updated

    • DOWN: not bound

    • ACTIVE: bound

    • ELB: bound to a load balancer

    • VPN: bound to a VPN

    • ERROR: failed

description

String

  • Definition: Supplementary information about the EIP.

  • Constraints: You can customize this value to identify your EIP, which is not perceived by the system.

public_border_group

String

  • Definition: Whether the resource is in a central region or an edge site.

  • Range: The value can be center or an edge site name.

  • Constraints: An EIP can only be bound to a resource from the same region or site.

created_at

String

  • Definition: Time (UTC) when the resource was created.

  • Format: yyyy-MM-ddTHH:mm:ssZ

updated_at

String

  • Definition: Time (UTC) when the resource was updated.

  • Format: yyyy-MM-ddTHH:mm:ssZ

type

String

  • Definition: EIP type.

  • Constraints: N/A

  • Range:

    • EIP: IPv4 EIP.

    • DUALSTACK: IPv6 EIP.

  • Default Value: N/A

vnic

VnicInfo object

  • Definition: Port information of the instance that an EIP is bound to.

  • Constraints: If the instance has no port, the value is null.

bandwidth

PublicipBandwidthInfo object

Definition: Bandwidth of an EIP

enterprise_project_id

String

Definition: Enterprise project ID The value is 0 or a string that contains a maximum of 36 characters in the UUID format with hyphens (-). This is the ID of the enterprise project that you associate with the EIP when you assign the EIP.

billing_info

String

  • Definition: Order information of an EIP.

  • Constraints: Order information is available only for yearly/monthly resources. This parameter is left empty for pay-per-use resources.

lock_status

String

  • Definition: Frozen reason of the EIP.

  • Constraints: The metadata type is used.

  • Range:

    • POLICE: frozen due to public security issues

    • LOCKED: frozen due to common issues

    • ARREAR: frozen due to arrears

    • DELABLE: frozen and can be deleted

  • Default Value: N/A

associate_instance_type

String

  • Definition: Type of the instance with an EIP bound.

  • Range:

    • PORT (Instance type, including ECS, BMS, and CCE)

    • NATGW (NAT gateway type)

    • ELB (Load balancer type)

    • VPN (VPN instance type)

associate_instance_id

String

Definition: ID of the instance with an EIP bound.

publicip_pool_id

String

Definition: ID of the network that an EIP belongs to. It is the network ID corresponding to publicip_pool_name.

publicip_pool_name

String

  • Definition: Network type of an EIP, including public EIP pool (for example, 5_bgp or 5_sbgp) and dedicated EIP pool.

  • For details about a dedicated EIP pool, see the APIs about publicip_pool.

alias

String

  • Definition: EIP name

associate_mode

String

  • Definition: Passthrough mode. This parameter is available after the passthrough mode is enabled. (Not displayed by default)

Table 6 VnicInfo

Parameter

Type

Description

private_ip_address

String

  • Definition: Private IP address

device_id

String

  • Definition: ID of the device that the port belongs to. The device ID indicates the ID of the cloud service resource that uses the private IP address in the subnet, for example, the cloud server ID or load balancer ID.

  • Constraints: The value cannot be configured or updated and is automatically maintained by the system.

device_owner

String

  • Definition: Device that the port belongs to, that is, a cloud service resource that uses a private IP address in the subnet.

  • Range: Valid devices.

    • network:dhcp: DHCP service

    • network:VIP_PORT: Virtual IP address

    • network:router_interface_distributed: Subnet gateway address

    • network:router_centralized_snat: SNAT gateway address

  • Constraints: The value cannot be configured or updated and is automatically maintained by the system.

vpc_id

String

  • Definition: VPC ID

port_id

String

  • Definition: Port ID

port_profile

String

  • Definition: Port profile

mac

String

  • Definition: MAC address of the port

  • Constraints: The value is allocated by the system and cannot be specified.

vtep

String

  • Definition: VTEP IP address

vni

String

  • Definition: VXLAN ID

instance_id

String

  • Definition: ID of the instance that the port belongs to, for example, RDS instance ID.

  • Constraints: The value cannot be configured or updated and is automatically maintained by the system.

instance_type

String

  • Definition: Port user.

  • Constraints: N/A

  • Range:

  • PORT: elastic network interface

  • PEP_PORT: PEP elastic network interface

  • EVPN: Ethernet virtual private network

  • NATGW: NAT gateway

  • P2CVPN: P2C virtual private network

  • Default Value: N/A

port_vif_details

String

  • Definition: Details about the virtual interface of the network interface

Table 7 PublicipBandwidthInfo

Parameter

Type

Description

id

String

  • Definition: Bandwidth ID

size

Integer

  • Definition: Bandwidth size.

  • Range: The value ranges from 5 Mbit/s to 2000 Mbit/s by default.

share_type

String

  • Definition: Whether the bandwidth is shared or dedicated.

  • Range:

    • PER: dedicated bandwidths

    • WHOLE: shared bandwidth

    [- Constraints: IPv6 addresses do not support bandwidth whose type is "WHOLE".] (tag:hws,srg)

charge_mode

String

  • Definition: Whether the billing is based on traffic or bandwidth.

  • Range:

    • bandwidth: billed by bandwidth

    • traffic: billed by traffic

    • 95peak_plus: 95th percentile bandwidth (enhanced)

name

String

  • Definition: Bandwidth name.

  • Range: The value can contain 1 to 64 characters, including letters, digits, underscores (_), hyphens (-), and periods (.).

billing_info

String

  • Definition: Billing information If billinginfo is specified, the bandwidth is billed on a yearly/monthly basis.

Example Requests

  • Update the alias and description of an EIP.

    {
      "publicip" : {
        "alias" : "abcd",
        "description" : "test!!!!"
      }
    }
  • Unbind an EIP from an instance.

    {
      "publicip" : {
        "associate_instance_type" : null,
        "associate_instance_id" : null
      }
    }

Example Responses

Status code: 200

Normal response to PUT requests

{
  "publicip" : {
    "alias" : "abcd",
    "associate_instance_id" : null,
    "associate_instance_type" : null,
    "bandwidth" : {
      "billing_info" : "xxxx:xxxx:xxxx",
      "charge_mode" : "bandwidth",
      "id" : "80549ae1-cf7a-4f39-a45f-bdb8e194a1f4",
      "name" : "bandwidth-bd25-test",
      "share_type" : "WHOLE",
      "size" : 7
    },
    "billing_info" : null,
    "created_at" : "2020-06-18T14:05:32Z",
    "description" : "test!!!!",
    "enterprise_project_id" : "0",
    "public_border_group" : "center",
    "id" : "b0c42aa6-3d1d-4b39-9188-35ee6aa8d6f7",
    "ip_version" : 4,
    "lock_status" : null,
    "project_id" : "060576782980d5762f9ec014dd2f1148",
    "public_ip_address" : "xx.xx.xx.xx",
    "public_ipv6_address" : null,
    "publicip_pool_id" : "160576782980d5762f9ec014dd2f1148",
    "publicip_pool_name" : "5_mobile",
    "status" : "DOWN",
    "type" : "Updating an EIP",
    "updated_at" : "2020-06-18T14:05:32Z",
    "vnic" : null
  },
  "request_id" : "ead9f912bd1191e3d5f0037141098d91"
}

Status Codes

Status Code

Description

200

Normal response to PUT requests

Error Codes

See Error Codes.