forked from docs/doc-exports
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com> Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: wanghuijuan738 <wanghuijuan738@huawei.com> Co-committed-by: wanghuijuan738 <wanghuijuan738@huawei.com>
12 KiB
12 KiB
Querying NICs of an ECS
Function
This API is used to query NICs attached to an ECS.
URI
GET /v2.1/{project_id}/servers/{server_id}/os-interface
GET /v2/{project_id}/servers/{server_id}/os-interface
Table 1 describes the parameters in the URI.
Request
None
Response
Table 2 describes the response parameters.
Parameter |
Type |
Description |
|---|---|---|
interfaceAttachments |
Array of objects |
Specifies ECS NICs. For details, see Table 3. |
Parameter |
Type |
Description |
|---|---|---|
port_state |
String |
Specifies the NIC port status. |
fixed_ips |
Array of objects |
Specifies private IP addresses for NICs. For details, see Table 4. |
net_id |
String |
Specifies the network ID (network_id) that the NIC port belongs to. |
port_id |
String |
Specifies the ID of the NIC port. |
mac_addr |
String |
Specifies the MAC address of the NIC. |
Example Request
Query NICs attached to an ECS.
GET https://{endpoint}/v2/{project_id}/servers/{server_id}/os-interface
GET https://{endpoint}/v2.1/{project_id}/servers/{server_id}/os-interface
Example Response
{
"interfaceAttachments": [
{
"port_state": "ACTIVE",
"fixed_ips": [
{
"subnet_id": "f8a6e8f8-c2ec-497c-9f23-da9616de54ef",
"ip_address": "192.168.1.3"
}
],
"net_id": "3cb9bc59-5699-4588-a4b1-b87f96708bc6",
"port_id": "ce531f90-199f-48c0-816c-13e38010b442",
"mac_addr": "fa:16:3e:4c:2c:30"
}
]
}
Returned Values
Parent topic: NIC Management