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

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

Project ID

Minimum length: 0

Maximum length: 32

publicip_id

Yes

String

EIP ID

Minimum length: 0

Maximum length: 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

  • EIP name

Minimum length: 0

Maximum length: 64

description

No

String

  • Supplementary information about the EIP.
  • The value can contains 0 to 256 characters and cannot contain the following special characters: <>

Minimum length: 0

Maximum length: 256

associate_instance_type

No

String

  • Type of the instance that the port belongs to.
  • The value can be:
    • PORT
    • NATGW
    • VPN
    • ELB
  • Constraints:
    • If neither associate_instance_type nor associate_instance_id is left empty, the EIP is bound to an instance.
    • If both associate_instance_type and associate_instance_id are null, the EIP is unbound.
    • A dual-stack EIP cannot have its bound instance changed.

Minimum length: 0

Maximum length: 36

The value can be:

  • PORT
  • NATGW
  • VPN
  • ELB

associate_instance_id

No

String

  • ID of the bound instance, such as a load balancer ID or an ECS NIC ID.
  • Constraints:
    • If neither associate_instance_type nor associate_instance_id is left empty, the EIP is bound to an instance.
    • If both associate_instance_type and associate_instance_id are null, the EIP is unbound.
    • A dual-stack EIP cannot have its bound instance changed.

Minimum length: 0

Maximum length: 36

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

request_id

String

Request ID

Minimum length: 0

Maximum length: 36

publicip

PublicipUpdateResp object

Response object of updating an EIP

Table 5 PublicipUpdateResp

Parameter

Type

Description

id

String

  • EIP ID, which uniquely identifies the EIP.

Minimum length: 0

Maximum length: 36

project_id

String

  • Project ID

Minimum length: 0

Maximum length: 32

ip_version

Integer

  • IP address version
  • The value can be:
    • 4: IPv4 EIP
    • 6: IPv6 EIP

The value can be:

  • 4
  • 6

public_ip_address

String

  • EIP or IPv6 port address

Minimum length: 0

Maximum length: 36

public_ipv6_address

String

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

Minimum length: 0

Maximum length: 64

status

String

  • EIP status
  • The value can be:
    • FREEZED (Frozen)
    • BIND_ERROR (Binding failed)
    • BINDING (Binding)
    • PENDING_DELETE (Releasing)
    • PENDING_CREATE (Assigning)
    • NOTIFYING (Notify that EIP is assigned)
    • NOTIFY_DELETE (Notify to release an EIP)
    • PENDING_UPDATE (Updating)
    • DOWN (Unbound)
    • ACTIVE (Bound)
    • ELB (Bound to a load balancer)
    • VPN (Bound to a VPN)
    • ERROR (Assignment failed)

Minimum length: 0

Maximum length: 64

The value can be:

  • FREEZED
  • BIND_ERROR
  • BINDING
  • PENDING_DELETE
  • PENDING_CREATE
  • NOTIFYING
  • NOTIFY_DELETE
  • PENDING_UPDATE
  • DOWN
  • ACTIVE
  • ELB
  • ERROR
  • VPN

description

String

  • Supplementary information about the EIP
  • You can customize this value to identify your EIP, which is not perceived by the system.

Minimum length: 0

Maximum length: 256

public_border_group

String

  • Whether it is a central or an edge EIP.
  • The value can be center or an edge site name.
  • An EIP can only be bound to a resource of the same region or site.

Minimum length: 1

Maximum length: 64

created_at

String

  • Time (UTC) when an EIP is assigned.
  • Format: yyyy-MM-ddTHH:mm:ssZ

Minimum length: 0

Maximum length: 64

updated_at

String

  • Time (UTC) when an EIP is updated.
  • Format: yyyy-MM-ddTHH:mm:ssZ

Minimum length: 0

Maximum length: 64

type

String

EIP type

Minimum length: 1

Maximum length: 36

The value can be:

  • EIP
  • DUALSTACK

vnic

VnicInfo object

  • Port information of the instance with an EIP bound.
  • If the instance has no port, the value is null.

bandwidth

PublicipBandwidthInfo object

Bandwidth of an EIP

enterprise_project_id

String

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

Minimum length: 0

Maximum length: 36

billing_info

String

  • Order information of an EIP.
  • The value is available only for yearly/monthly resources. This value is left blank for pay-per-use resources.

Minimum length: 0

Maximum length: 256

lock_status

String

  • Frozen status of an EIP.
  • The metadata type indicates that the EIP is frozen due to arrears or security reasons.
  • The value can be:
    • police
    • locked

Minimum length: 0

Maximum length: 64

associate_instance_type

String

  • Type of the instance with an EIP bound.
  • ELBv1 instances are not available on the Huawei Cloud Chinese Mainland console. Existing instances can be used on the Huawei Cloud International console and jointly-operated clouds.
  • The value can be:
    • PORT
    • NATGW
    • ELB
    • ELBV1
    • VPN

Minimum length: 0

Maximum length: 64

The value can be:

  • PORT
  • NATGW
  • ELB
  • ELBV1
  • VPN

associate_instance_id

String

ID of the instance with an EIP bound

Minimum length: 0

Maximum length: 36

publicip_pool_id

String

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

Minimum length: 0

Maximum length: 36

publicip_pool_name

String

  • Network type of an EIP, including public EIP pool (for example, 5_bgp or 5_sbgp) and dedicated EIP pool.
  • For details about the dedicated EIP pool, see the APIs about publcip_pool.

Minimum length: 0

Maximum length: 64

alias

String

  • EIP name.

Minimum length: 0

Maximum length: 64

associate_mode

String

  • Passthrough mode. (The parameter is not displayed by default.)

Minimum length: 1

Maximum length: 36

Table 6 VnicInfo

Parameter

Type

Description

private_ip_address

String

  • Private IP address.

Minimum length: 0

Maximum length: 36

device_id

String

  • ID of the device that the port belongs to.
  • The system automatically sets this parameter.

Minimum length: 0

Maximum length: 36

device_owner

String

  • Device that the port belongs to.
  • The value can be:
    • network:dhcp
    • network:VIP_PORT
    • network:router_interface_distributed
    • network:router_centralized_snat
  • The system automatically sets this parameter.

Minimum length: 0

Maximum length: 64

vpc_id

String

  • VPC ID

Minimum length: 0

Maximum length: 36

port_id

String

  • Port ID

Minimum length: 0

Maximum length: 36

port_profile

String

  • Port profile

Minimum length: 0

Maximum length: 256

mac

String

  • Port MAC address
  • The system automatically sets this parameter.

Minimum length: 0

Maximum length: 64

vtep

String

  • VTEP IP address

Minimum length: 0

Maximum length: 36

vni

String

  • VXLAN ID

Minimum length: 0

Maximum length: 36

instance_id

String

  • ID of the instance that the port belongs to, for example, RDS instance ID
  • The system automatically sets this parameter.

Minimum length: 0

Maximum length: 36

instance_type

String

  • Type of the instance that the port belongs to, for example, RDS.
  • The system automatically sets this parameter.

Minimum length: 0

Maximum length: 36

Table 7 PublicipBandwidthInfo

Parameter

Type

Description

id

String

  • Bandwidth ID

Minimum length: 0

Maximum length: 36

size

Integer

  • Bandwidth size
  • The value ranges from 5 Mbit/s to 2,000 Mbit/s by default.

Minimum value: 0

Maximum value: 99999

share_type

String

  • Whether the bandwidth is shared or dedicated.
  • The value can be:
    • PER: Dedicated bandwidth
    • WHOLE: Shared bandwidth
  • IPv6 addresses do not support bandwidth whose type is WHOLE.

Minimum length: 0

Maximum length: 36

charge_mode

String

  • Whether the billing is based on traffic or bandwidth.
  • The value can be:
    • bandwidth: billed by bandwidth
    • traffic: billed by traffic
    • 95peak_plus: billed by 95th percentile bandwidth (enhanced)

Minimum length: 0

Maximum length: 36

name

String

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

Minimum length: 0

Maximum length: 64

billing_info

String

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

Minimum length: 0

Maximum length: 256

Example Request

{
  "publicip" : {
    "alias" : "abcd",
    "description" : "test!!!!"
  }
}

Example Response

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" : "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.