doc-exports/docs/ecs/api-ref/en-us_topic_0031169059.html
Zaoxu, Li 4edaa4a4cc ECS API 20231016 version
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com>
Co-authored-by: Zaoxu, Li <lizaoxu@huawei.com>
Co-committed-by: Zaoxu, Li <lizaoxu@huawei.com>
2024-04-29 11:04:13 +00:00

12 KiB

Querying the Specified Network of an ECS

Function

This API is used to query the specified network of an ECS.

Constraints

None

URI

GET /v2.1/{project_id}/servers/{server_id}/ips/{networkName}

GET /v2/{project_id}/servers/{server_id}/ips/{networkName}

Table 1 describes the parameters in the URI.
Table 1 Path parameters

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

Table 2 Request parameters

Parameter

Mandatory

Type

Description

server_id

Yes

String

Specifies the ECS ID.

networkName

Yes

String

Specifies the ECS network name.

Request

None

Response

Table 3 describes the response parameters.

Table 3 Response parameters

Parameter

Type

Description

Network address of the ECS

List(Dict)

Specifies the network where the ECS accesses. For details about the network, see Table 4.

Table 4 ECS network parameter structure description

Attribute

Type

CRUD

Default Value

Constraint

Remarks

version

Integer

R

N/A

4 or 6

Specifies the IP address version. The value of this parameter can be 4 or 6.

addr

String

R

N/A

IP address format

Specifies the IP address.

Example Request

Query the specified network of a specified ECS.

GET https://{endpoint}/v2/{project_id}/servers/{server_id}/ips/{networkName}
GET https://{endpoint}/v2.1/{project_id}/servers/{server_id}/ips/{networkName}

Example Response

{
    "Network address of the ECS": [
        {
            "version": 4,
            "addr": "10.0.0.4"
        },
        {
            "version": 4,
            "addr": "192.150.73.132"
        }
    ]
}