• Virtual Private Cloud

vpc
  1. Help Center
  2. Virtual Private Cloud
  3. API Reference
  4. APIs
  5. Private IP Address
  6. Querying Private IP Addresses

Querying Private IP Addresses

Function

This interface is used to query private IP addresses using search criteria and to display the private IP addresses in a list.

URI

GET /v1/{project_id}/subnets/{subnet_id}/privateips

Example:
/v1/{project_id}/subnets/{subnet_id}/privateips?limit=10&marker=4779ab1c-7c1a-44b1-a02e-93dfc361b32d
Table 1 Parameter description

Name

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

subnet_id

Yes

String

Specifies the unique ID of the subnet to which the private IP address belongs.

marker

No

String

Specifies the start resource ID of pagination query. If the parameter is left blank, only resources on the first page are queried.

limit

No

int

  • Specifies the number of records returned on each page.
  • The value ranges from 0 to intmax.

Request Message

  • Request parameter

    None

  • Example request

    None

Response Message

  • Request parameter
    Table 2 Request parameter

    Name

    Type

    Description

    privateips

    List data structure

    Specifies the private IP address list objects.

    Private IP addresses reserved for system interfaces are not displayed. You can log in to the management console to view the IP addresses.

    Table 3 Description of the privateips field

    Name

    Type

    Description

    status

    String

    • Specifies the status of the private IP address.
    • The value can be ACTIVE or DOWN.

    id

    String

    Specifies the ID of the private IP address, which uniquely identifies the private IP address.

    subnet_id

    String

    Specifies the ID of the subnet from which IP addresses are assigned.

    tenant_id

    String

    Specifies the project ID.

    device_owner

    String

    • Specifies the resource using the private IP address. The parameter is left blank if it is not used.
    • The value can be network:dhcpnetwork:router_interface_distributedcompute:xxx, or neutron:VIP_PORT. (In value compute:xxxxxx specifies the AZ name, for example, compute:aa-bb-cc indicates that the private IP address is used by a VM in the aa-bb-cc AZ).
    • The value range specifies only the type of private IP addresses supported by the current service.

    ip_address

    String

    Specifies the assigned private IP address.

  • Example response
    {
        "privateips": [
            {
                "status": "DOWN",
                "id": "d600542a-b231-45ed-af05-e9930cb14f78",
                "subnet_id": "531dec0f-3116-411b-a21b-e612e42349fd",
                "tenant_id": "8b7e35ad379141fc9df3e178bd64f55c",
                "device_owner": "",
                "ip_address": "192.168.1.11"
            },
            {
                "status": "DOWN",
                "id": "d600542a-b231-45ed-af05-e9930cb14f79",
                "subnet_id": "531dec0f-3116-411b-a21b-e612e42349fd",
                "tenant_id": "8b7e35ad379141fc9df3e178bd64f55c",
                "device_owner": "",
                "ip_address": "192.168.1.12"
            }
        ]
    }

Status Codes

For details, see section Status Codes.