華為云計(jì)算 云知識(shí) 查詢裸金屬服務(wù)器網(wǎng)卡信息ShowBaremetalServerInterfaceAttachments
查詢裸金屬服務(wù)器網(wǎng)卡信息ShowBaremetalServerInterfaceAttachments

 

功能介紹

查詢 裸金屬服務(wù)器 的網(wǎng)卡信息,比如網(wǎng)卡的IP地址、MAC地址。

調(diào)試

您可以在API Explorer中調(diào)試該接口。

URI

GET /v1/{project_id}/baremetalservers/{server_id}/os-interface

參數(shù)說(shuō)明請(qǐng)參見(jiàn)表1。
表1 參數(shù)說(shuō)明

參數(shù)

是否必選

描述

project_id

項(xiàng)目ID。

獲取方式請(qǐng)參見(jiàn)獲取項(xiàng)目ID。

server_id

裸金屬服務(wù)器ID。

可以從裸金屬服務(wù)器控制臺(tái)查詢,或者通過(guò)調(diào)用查詢裸金屬服務(wù)器列表(OpenStack原生)API獲取。

請(qǐng)求參數(shù)

無(wú)

請(qǐng)求示例

查詢ID為95bf2490-5428-432c-ad9b-5e3406f869dd的裸金屬服務(wù)器的網(wǎng)卡信息。
GET https://{BMS Endpoint}/v1/c685484a8cc2416b97260938705deb65/baremetalservers/95bf2490-5428-432c-ad9b-5e3406f869dd/os-interface

響應(yīng)參數(shù)

參數(shù)

參數(shù)類型

描述

interfaceAttachments

Array of objects

裸金屬服務(wù)器網(wǎng)卡信息列表,詳情請(qǐng)參見(jiàn)表2 interfaceAttachments字段數(shù)據(jù)結(jié)構(gòu)說(shuō)明。

表2 interfaceAttachments字段數(shù)據(jù)結(jié)構(gòu)說(shuō)明

參數(shù)

參數(shù)類型

描述

port_state

String

網(wǎng)卡端口狀態(tài)。取值為:ACTIVE、BUILD、DOWN

fixed_ips

Array of objects

網(wǎng)卡私網(wǎng)IP信息列表,詳情請(qǐng)參見(jiàn)表3 fixed_ips字段數(shù)據(jù)結(jié)構(gòu)說(shuō)明。

net_id

String

網(wǎng)卡端口所屬子網(wǎng)的網(wǎng)絡(luò)ID(network_id)。

port_id

String

網(wǎng)卡端口ID。

mac_addr

String

網(wǎng)卡MAC地址信息。

driver_mode

String

從guest os中,網(wǎng)卡的驅(qū)動(dòng)類型??蛇x值為virtio和hinic,默認(rèn)為virtio。

pci_address

String

彈性網(wǎng)卡在Linux GuestOS里的BDF號(hào)。

表3 fixed_ips字段數(shù)據(jù)結(jié)構(gòu)說(shuō)明

參數(shù)

參數(shù)類型

描述

subnet_id

String

網(wǎng)卡私網(wǎng)IP對(duì)應(yīng)子網(wǎng)的子網(wǎng)ID(subnet_id)。

ip_address

String

網(wǎng)卡私網(wǎng)IP信息。

響應(yīng)示例

{
    "interfaceAttachments": [
        {
            "port_state": "ACTIVE",
            "fixed_ips": [
                {
                    "subnet_id": "a5052101-11e1-4f3d-a5fa-f6ba6791219c",
                    "ip_address": "192.168.1.147"
                }
            ],
            "net_id": "ad0fadbf-4bc1-472c-a030-5310e53b3818",
            "port_id": "bb585b04-f2a2-4528-9064-fd0aeb4e15a9",
            "mac_addr": "fa:16:3e:3b:58:fc"
        }
    ]
}

返回值

正常返回值:

返回值

說(shuō)明

200

服務(wù)器已成功處理了請(qǐng)求。

其他返回值請(qǐng)參考狀態(tài)碼

錯(cuò)誤碼

請(qǐng)參考錯(cuò)誤碼