華為云計算 云知識 查詢云服務(wù)器網(wǎng)卡信息ListServerInterfaces
查詢云服務(wù)器網(wǎng)卡信息ListServerInterfaces

 

功能介紹

查詢 云服務(wù)器 網(wǎng)卡信息。

調(diào)試

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

URI

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

參數(shù)說明請參見表1。
表1 參數(shù)說明

參數(shù)

是否必選

描述

project_id

項目ID。

獲取方法請參見獲取項目ID。

server_id

云服務(wù)器ID。

請求消息

響應(yīng)消息

響應(yīng)參數(shù)如表2所示。
表2 響應(yīng)參數(shù)

參數(shù)

參數(shù)類型

描述

interfaceAttachments

Array of objects

云服務(wù)器網(wǎng)卡信息列表,詳情請參見表3。

attachableQuantity

Object

云服務(wù)器可掛載網(wǎng)卡數(shù),詳情請參見表4

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

參數(shù)

參數(shù)類型

描述

port_state

String

網(wǎng)卡端口狀態(tài)。

fixed_ips

Array of objects

網(wǎng)卡私網(wǎng)IP信息列表,詳情請參見表5。

net_id

String

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

port_id

String

網(wǎng)卡端口ID。

mac_addr

String

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

delete_on_termination

Boolean

卸載網(wǎng)卡時,是否刪除網(wǎng)卡。

true: 刪除; false: 不刪除

driver_mode

String

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

min_rate

Integer

網(wǎng)卡帶寬下限。

multiqueue_num

Integer

隊列個數(shù)。

取值范圍為 1, 2, 4, 8, 16,28。

pci_address

String

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

說明:

網(wǎng)卡不支持時,返回為空。

表4 attachableQuantity字段數(shù)據(jù)結(jié)構(gòu)說明

參數(shù)

參數(shù)類型

描述

free_nic

Integer

云服務(wù)器剩余可掛載網(wǎng)卡數(shù)量

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

參數(shù)

參數(shù)類型

描述

subnet_id

String

網(wǎng)卡私網(wǎng)IP對應(yīng)子網(wǎng)信息。

ip_address

String

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

請求示例

查詢云服務(wù)器網(wǎng)卡信息。

GET https://{endpoint}/v1/{project_id}/cloudservers/{server_id}/os-interface

響應(yīng)示例

{
    "interfaceAttachments": [
        {
            "port_state": "ACTIVE",
            "fixed_ips": [
                {
                    "subnet_id": "ba31e1f5-fa76-4530-862c-5176fad033cf",
                    "ip_address": "192.168.0.33"
                }
            ],
            "net_id": "610a4af2-1d90-4d2b-8057-dc238b26febf",
            "port_id": "04819c0a-6a07-44b6-945e-fb932071888e",
            "mac_addr": "fa:16:3e:45:65:c4"
        }
    ]
}

返回值

請參考通用請求返回值。