Help Center/ Elastic IP/ API Reference/ API V3/ EIP/ Querying Details About an EIP
Updated on 2026-11-06 GMT+08:00

Querying Details About an EIP

Function

This API is used to query details about a specified EIP.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permissions are required for calling this API.

URI

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

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. For details, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

publicip_id

Yes

String

Definition

EIP ID.

Constraints

N/A

Range

The value contains a maximum of 36 characters.

Default Value

N/A

Maximum: 36

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

fields

No

Array of strings

Definition

Query field, in the format of fields=id&fields=owner&...

Constraints

Supported fields: id, project_id, ip_version, type, public_ip_address, public_ipv6_address, network_type, status, description, created_at, updated_at, vnic, bandwidth, associate_instance_type, associate_instance_id, lock_status, billing_info, tags, enterprise_project_id, publicip_pool_name, allow_share_bandwidth_types, alias, publicip_pool_id, and public_border_group

Range

Array length: 0 to 999

Default Value

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

request_id

String

Definition

Request ID.

Range

N/A

publicip

PublicipSingleShowResp object

Definition

EIP object.

Range

N/A

Table 4 PublicipSingleShowResp

Parameter

Type

Description

id

String

Definition

ID of the EIP.

Range

N/A

project_id

String

Definition

Project ID.

Range

N/A

ip_version

Integer

Definition

IP address version.

Range

  • 4: IPv4 address

  • 6: IPv6 address

public_ip_address

String

Definition

EIP. If type is DUALSTACK, 0.0.0.0 is returned, which is not a normal IPv4 EIP.

Range

N/A

public_ipv6_address

String

Definition

The obtained EIP if IPv6 EIPs are available. This parameter does not exist if only IPv4 EIPs are available.

Range

N/A

network_type

String

Definition

Network type of the EIP. This parameter is discarded and is not displayed by default. It is inherited by publicip_pool_name.

Range

N/A

status

String

Definition

EIP status.

Range

  • FREEZED: frozen

  • BIND_ERROR: binding failed

  • BINDING: being bound

  • PENDING_DELETE: being released

  • PENDING_CREATE: creating

  • NOTIFYING: creating

  • NOTIFY_DELETE: releasing

  • PENDING_UPDATE: updating

  • DOWN: not bound

  • ACTIVE: bound

-ELB: bound to a load balancer

  • VPN: bound to a VPN

  • ERROR: failed

description

String

Definition

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

Range

N/A

public_border_group

String

Definition

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

Range

Name of the central or edge site.

created_at

String

Definition

UTC time when a resource was created.

Range

Format: yyyy-MM-ddTHH:mm:ssZ

updated_at

String

Definition

UTC time when a resource was updated.

Range

Format: yyyy-MM-ddTHH:mm:ssZ

type

String

Definition

EIP type.

Range

  • EIP: IPv4 EIP

  • DUALSTACK: IPv6 EIP

vnic

VnicInfo object

Definition

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

Range

N/A

bandwidth

PublicipBandwidthInfo object

Definition

Bandwidth bound to an EIP.

Range

N/A

enterprise_project_id

String

Definition

Enterprise project ID. This is the ID of the enterprise project that you associate with the EIP when you assign the EIP.

Range

The value is 0 or a string that contains a maximum of 36 bytes in the UUID format with hyphens (-).

billing_info

String

Definition

Order information of the EIP.

Range

This parameter is available only for yearly/monthly EIPs.

lock_status

String

Definition

Frozen status of an EIP. The metadata type indicates that the EIP is frozen due to arrears or security reasons.

Range

  • police: frozen due to public security reasons

  • locked: resource locked

associate_instance_type

String

Definition

Type of the instance that the EIP is bound to. associate_instance_type can be used for filtering.

Range

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

  • NATGW (NAT gateway type)

  • ELB (Load balancer type)

  • ELBV1 (ELBv1 instance type, classic ELBv1)

  • VPN (VPN instance type)

associate_instance_id

String

Definition

ID of the instance to which the EIP is bound.

Range

N/A

publicip_pool_id

String

Definition

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

Range

N/A

publicip_pool_name

String

Definition

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

Range

N/A

alias

String

Definition

EIP name.

Range

N/A

profile

ProfileInfo object

Definition

EIP and metadata. The parameter is not displayed by default.

Range

N/A

fake_network_type

Boolean

Definition

Whether the BGP type of the EIP is sbgp.

Range

  • TRUE: The BGP type of the EIP can be changed.

  • FALSE: The BGP type of the EIP cannot be changed. The parameter is not displayed by default.

tags

Array of strings

Definition

User tags.

Range

N/A

associate_instance_metadata

String

Definition

Records the upper-level ownership of an instance. For example, if associate_instance_type is set to PORT, this parameter records the device_id and device_owner information of the port. This parameter only records information in limited scenarios. The parameter is not displayed by default.

Range

Array length: 0 to 9999

associate_mode

String

Definition

Passthrough mode. This parameter is available after the passthrough mode is enabled. The parameter is not displayed by default.

Range

N/A

allow_share_bandwidth_types

Array of strings

Definition

Types of the shared bandwidth that an EIP can be added to. If this parameter is left blank, the EIP cannot be added to any shared bandwidth. EIPs can be added only to the shared bandwidth of these types.

Range

Array length: 0 to 9999

cascade_delete_by_instance

Boolean

Definition

Whether an EIP can be released together with its instance. The parameter is not displayed by default.

Range

N/A

Table 5 VnicInfo

Parameter

Type

Description

private_ip_address

String

Definition

Private IP address.

Range

N/A

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. The system automatically sets this parameter.

Range

N/A

device_owner

String

Definition

Device that the port belongs to. It can be a cloud service resource that uses a private IP address in the subnet.

Range

  • network:dhcp: DHCP service

  • network:VIP_PORT: Virtual IP address

  • network:router_interface_distributed: Subnet gateway address

  • network:router_centralized_snat: SNAT gateway address

vpc_id

String

Definition

VPC ID.

Range

N/A

port_id

String

Definition

Port ID.

Range

N/A

port_profile

String

Definition

Port profile.

Range

N/A

mac

String

Definition

MAC address of the port.

Range

The system automatically sets this parameter.

vtep

String

Definition

VTEP IP address.

Range

N/A

vni

String

Definition

VXLAN ID.

Range

N/A

instance_id

String

Definition

The ID of the instance that the port belongs to, for example, RDS instance ID.

Range

The system automatically sets this parameter.

instance_type

String

Definition

Type of the instance that uses the port.

Range

  • PORT: elastic network interface

  • PEP_PORT: PEP elastic network interface

  • EVPN: Ethernet virtual private network

  • NATGW: NAT gateway

  • P2CVPN: P2C virtual private network

port_vif_details

String

Definition

Details about the virtual interface of the network interface.

Range

N/A

Table 6 PublicipBandwidthInfo

Parameter

Type

Description

id

String

Definition

Bandwidth ID.

Range

N/A

size

Integer

Definition

Bandwidth size.

Range

The value ranges from 5 Mbit/s to 2000 Mbit/s.

share_type

String

Definition

Whether the bandwidth is shared or dedicated.

Range

  • PER: dedicated bandwidth

  • WHOLE: shared bandwidth

charge_mode

String

Definition

The billing option of the bandwidth.

Range

  • bandwidth: billed by bandwidth

  • traffic: billed by traffic

  • 95peak_plus: billed by enhanced 95th percentile bandwidth

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

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

Range

N/A

Table 7 ProfileInfo

Parameter

Type

Description

local_network_port

String

Definition

port_id in the 5_xxx network (for example, 5_bgp) of an EIP.

Range

N/A

standalone

Boolean

Definition

Whether an EIP is assigned together with a VM.

Range

  • true: The EIP is assigned independently.

  • false: The EIP is assigned together with a VM.

notify_status

String

Definition

EIP assigning status, which is used internally by the EIP service.

Range

  • PENDING_CREATE

  • PENDING_UPDATE

  • NOTIFYING

  • NOTIFYED

  • NOTIFY_DELETE

create_time

String

Definition

Time when an EIP was assigned.

Range

N/A

fake_network_type

Boolean

Definition

This field is used only to indicate whether the BGP type of the EIP is sbgp.

Range

  • TRUE: The BGP type of the EIP can be changed.

  • FALSE: The BGP type of the EIP cannot be changed. The parameter is not displayed by default.

create_source

String

Definition

Type of the resource purchased together with an EIP.

Range

N/A

ecs_id

String

Definition

ID of the ECS purchased together with an EIP.

Range

N/A

lock_status

String

Definition

Lock status of an EIP.

Range

  • POLICE: frozen due to public security reasons

  • LOCKED: frozen due to common issues

    • ARREAR: frozen due to arrears

    • DELABLE: frozen and can be deleted

freezed_status

String

Definition

EIP frozen status.

Range

  • FREEZED: The EIP is frozen.

  • UNFREEZED: The EIP is not frozen.

bandwidth_info

BandwidthInfoResp object

Definition

Information about the bandwidth bound to the EIP.

Range

N/A

Table 8 BandwidthInfoResp

Parameter

Type

Description

bandwidth_name

String

Definition

Bandwidth name.

Range

N/A

bandwidth_number

Integer

Definition

Bandwidth size.

Range

N/A

bandwidth_type

String

Definition

Bandwidth type that will be used to filter resources.

Range

  • PER: dedicated bandwidth

  • WHOLE: shared bandwidth

bandwidth_id

String

Definition

Bandwidth ID.

Range

Format: [A-Za-z0-9]{8}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{12}

Example Requests

Querying details about the EIP whose ID is 006343a1-32bf-4361-958a-efd158153dd0

GET https://{Endpoint}/v3/{project_id}/eip/publicips/006343a1-32bf-4361-958a-efd158153dd0

Example Responses

Status code: 200

{
  "publicip" : {
    "created_at" : "2022-03-17T09:46:22Z",
    "updated_at" : "2022-03-30T02:46:04Z",
    "lock_status" : null,
    "allow_share_bandwidth_types" : [ "bgp", "sbgp", "share", "share_yidongdanxian", "share_bgp_premium" ],
    "id" : "006343a1-32bf-4361-958a-efd158153dd0",
    "alias" : null,
    "project_id" : "060576787a80d5762fa2c00f07ddfcf4",
    "ip_version" : 4,
    "public_ip_address" : "88.88.1.141",
    "public_ipv6_address" : null,
    "status" : "DOWN",
    "description" : "",
    "enterprise_project_id" : "0",
    "billing_info" : null,
    "type" : "EIP",
    "vnic" : {
      "private_ip_address" : "172.16.1.235",
      "device_id" : "",
      "device_owner" : "",
      "vpc_id" : "1c30f428-9741-48b2-a788-0b2f359705eb",
      "port_id" : "22d3576d-c042-4f3d-8c7c-1330a2724627",
      "mac" : "fa:16:3e:3a:22:66",
      "vtep" : null,
      "vni" : null,
      "instance_id" : "",
      "instance_type" : "",
      "port_profile" : null,
      "port_vif_details" : "{\"primary_interface\": true}"
    },
    "bandwidth" : {
      "id" : "149ff19b-5de4-4436-958f-2eca39952e93",
      "size" : 100,
      "share_type" : "PER",
      "charge_mode" : "traffic",
      "name" : "bandwidth-xym-br-eqos",
      "billing_info" : ""
    },
    "associate_instance_type" : "PORT",
    "associate_instance_id" : "22d3576d-c042-4f3d-8c7c-1330a2724627",
    "publicip_pool_id" : "9af5f2e5-1765-4b86-b342-ece52e785c8b",
    "publicip_pool_name" : "5_union",
    "public_border_group" : "center",
    "tags" : [ "key=value" ]
  },
  "request_id" : "ce1a33a85d2e105040497a21bbe58c26"
}

SDK Sample Code

The SDK sample code is as follows.

Java

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.huaweicloud.sdk.test;

import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.eip.v3.region.EipRegion;
import com.huaweicloud.sdk.eip.v3.*;
import com.huaweicloud.sdk.eip.v3.model.*;


public class ShowPublicipSolution {

    public static void main(String[] args) {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        String ak = System.getenv("CLOUD_SDK_AK");
        String sk = System.getenv("CLOUD_SDK_SK");
        String projectId = "{project_id}";

        ICredential auth = new BasicCredentials()
                .withProjectId(projectId)
                .withAk(ak)
                .withSk(sk);

        EipClient client = EipClient.newBuilder()
                .withCredential(auth)
                .withRegion(EipRegion.valueOf("<YOUR REGION>"))
                .build();
        ShowPublicipRequest request = new ShowPublicipRequest();
        request.withPublicipId("{publicip_id}");
        try {
            ShowPublicipResponse response = client.showPublicip(request);
            System.out.println(response.toString());
        } catch (ConnectionException e) {
            e.printStackTrace();
        } catch (RequestTimeoutException e) {
            e.printStackTrace();
        } catch (ServiceResponseException e) {
            e.printStackTrace();
            System.out.println(e.getHttpStatusCode());
            System.out.println(e.getRequestId());
            System.out.println(e.getErrorCode());
            System.out.println(e.getErrorMsg());
        }
    }
}

Python

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# coding: utf-8

import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkeip.v3.region.eip_region import EipRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkeip.v3 import *

if __name__ == "__main__":
    # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak = os.environ["CLOUD_SDK_AK"]
    sk = os.environ["CLOUD_SDK_SK"]
    projectId = "{project_id}"

    credentials = BasicCredentials(ak, sk, projectId)

    client = EipClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(EipRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = ShowPublicipRequest()
        request.publicip_id = "{publicip_id}"
        response = client.show_publicip(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)

Go

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    eip "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/eip/v3"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/eip/v3/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/eip/v3/region"
)

func main() {
    // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak := os.Getenv("CLOUD_SDK_AK")
    sk := os.Getenv("CLOUD_SDK_SK")
    projectId := "{project_id}"

    auth, err := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        WithProjectId(projectId).
        SafeBuild()

    if err != nil {
        fmt.Println(err)
        return
    }

    hcClient, err := eip.EipClientBuilder().
         WithRegion(region.ValueOf("<YOUR REGION>")).
         WithCredential(auth).
         SafeBuild()


    if err != nil {
        fmt.Println(err)
        return
    }

    client := eip.NewEipClient(hcClient)

    request := &model.ShowPublicipRequest{}
	request.PublicipId = "{publicip_id}"
	response, err := client.ShowPublicip(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

More

For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.

Status Codes

Status Code

Description

200

Normal response to the GET operation

Error Codes

See Error Codes.