華為云計(jì)算 云知識(shí) 查詢(xún)指定云服務(wù)器網(wǎng)卡信息NovaShowServerInterface
查詢(xún)指定云服務(wù)器網(wǎng)卡信息NovaShowServerInterface

 

接口說(shuō)明

根據(jù)網(wǎng)卡ID,查詢(xún) 云服務(wù)器 網(wǎng)卡信息。

約束說(shuō)明

無(wú)

URL
GET  https://ecs.cn-north-1.myhuaweicloud.com/v2.1/{project_id}/servers/{server_id}/os-interface/{port_id} 
請(qǐng)求參數(shù)
名稱(chēng) 類(lèi)型 IN 必選 描述
X-Auth-Token
 
string header

用戶(hù)Token。

通過(guò)調(diào)用 IAM 服務(wù)獲取用戶(hù)Token接口獲取(響應(yīng)消息頭中X-Subject-Token的值)。

port_id
 
string path

網(wǎng)卡port id

project_id
 
string path

項(xiàng)目ID。

server_id
 
string path

云服務(wù)器ID。

返回參數(shù)
返回碼: 200

OK

名稱(chēng) 類(lèi)型 必選 描述
interfaceAttachment
 
NovaServerInterfaceDetail object

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

200 interfaceAttachment
名稱(chēng) 類(lèi)型 必選 描述
fixed_ips
 
Array of NovaServerInterfaceFixedIp objects

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

mac_addr
 
string

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

net_id
 
string

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

port_id
 
string

網(wǎng)卡端口ID。

port_state
 
string

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

200 interfaceAttachment.fixed_ips
名稱(chēng) 類(lèi)型 必選 描述
ip_address
 
string

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

subnet_id
 
string

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

請(qǐng)求示例
示例 1
 
"GET https://{endpoint}/v2.1/{project_id}/servers/{server_id}/os-interface/{id}"
返回示例
返回碼:200

OK

示例 1
 
{
"interfaceAttachment": {
"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"
}
}
錯(cuò)誤碼
請(qǐng)參考 錯(cuò)誤碼說(shuō)明。