功能介紹
更新端口。
調(diào)試
您可以在API Explorer中調(diào)試該接口。
URI
PUT /v2.0/ports/{port_id}
請(qǐng)求參數(shù)
參數(shù)名稱 |
類型 |
必選 |
說明 |
---|---|---|---|
port |
是 |
更新操作時(shí)至少指定一項(xiàng)屬性。 |
屬性 |
是否必選 |
類型 |
說明 |
---|---|---|---|
name |
否 |
String |
端口的名稱 |
security_groups |
否 |
Array of strings |
擴(kuò)展屬性:安全組的UUID,例如:"security_groups": ["a0608cbf-d047-4f54-8b28-cd7b59853fff"] 【使用說明】不支持更新為空。 |
allowed_address_pairs |
否 |
擴(kuò)展屬性:IP/Mac對(duì)列表,allow_address_pair參見表4 【使用說明】
|
|
extra_dhcp_opts |
否 |
||
binding:profile |
否 |
Object |
擴(kuò)展屬性:提供用戶設(shè)置自定義信息 【使用說明】
|
binding:vnic_type |
否 |
String |
綁定的vNIC類型 【使用說明】normal: 軟交換 |
port_security_enabled |
否 |
Boolean |
端口安全使能標(biāo)記,如果不使能則安全組和dhcp防欺騙不生效 |
名稱 |
是否必選 |
參數(shù)類型 |
說明 |
---|---|---|---|
ip_address |
是 |
String |
|
mac_address |
否 |
String |
MAC地址 |
請(qǐng)求示例
更新id為7a9a954a-eb41-4954-a300-11ab17a361a2的端口,名稱更新為port-test02。
PUT https://{Endpoint}/v2.0/ports/7a9a954a-eb41-4954-a300-11ab17a361a2 { "port": { "name": "port-test02" } }
響應(yīng)參數(shù)
屬性 |
類型 |
說明 |
---|---|---|
id |
String |
端口的ID,最大長(zhǎng)度不超過255 【使用說明】在查詢端口列表時(shí)非必選 |
name |
String |
端口的名稱 |
network_id |
String |
所屬網(wǎng)絡(luò)的ID |
admin_state_up |
Boolean |
管理狀態(tài) 【使用說明】默認(rèn)為true |
mac_address |
String |
端口MAC地址,例如:"mac_address": "fa:16:3e:9e:ff:55" 【使用說明】只支持系統(tǒng)動(dòng)態(tài)分配,不支持指定 |
fixed_ips |
端口IP,參見表8。例如:"fixed_ips": [{"subnet_id": "4dc70db6-cb7f-4200-9790-a6a910776bba", "ip_address": "192.169.25.79"}] |
|
device_id |
String |
設(shè)備ID 【使用說明】不支持設(shè)置和更新,由系統(tǒng)自動(dòng)維護(hù),該字段非空的端口不允許刪除 |
device_owner |
String |
設(shè)備所屬(DHCP/Router/ Nova等) 【取值范圍】network:dhcp,network:router_interface_distributed,compute:xxx(xxx對(duì)應(yīng)具體的可用區(qū)名稱,例如compute:aa-bb-cc表示是被可用區(qū)aa-bb-cc上的ECS使用),neutron:VIP_PORT 【使用說明】不支持更新,只允許用戶在創(chuàng)建虛擬IP端口時(shí),為虛擬IP端口設(shè)置device_owner為neutron:VIP_PORT,當(dāng)端口的該字段不為空時(shí),僅支持該字段為neutron:VIP_PORT時(shí)的端口刪除。 該字段非空的端口不允許刪除。 |
tenant_id |
String |
項(xiàng)目ID |
status |
String |
端口狀態(tài),可以為ACTIVE,BUILD,DOWN; 【使用說明】Hana硬直通虛擬機(jī)端口狀態(tài)總為DOWN |
security_groups |
Array of strings |
擴(kuò)展屬性:安全組的UUID,例如:"security_groups": ["a0608cbf-d047-4f54-8b28-cd7b59853fff"] 【使用說明】不支持更新為空。 |
allowed_address_pairs |
擴(kuò)展屬性:IP/Mac對(duì)列表,allow_address_pair參見表9 【使用說明】
|
|
extra_dhcp_opts |
||
binding:vif_details |
||
binding:profile |
Object |
擴(kuò)展屬性:提供用戶設(shè)置自定義信息 【使用說明】
|
binding:vnic_type |
String |
綁定的vNIC類型 normal: 軟交換 |
port_security_enabled |
Boolean |
端口安全使能標(biāo)記,如果不使能則安全組和dhcp防欺騙不生效 |
dns_assignment |
擴(kuò)展屬性:主網(wǎng)卡默認(rèn)內(nèi)網(wǎng)域名信息 【使用說明】不支持設(shè)置和更新,由系統(tǒng)自動(dòng)維護(hù)
|
|
dns_name |
String |
擴(kuò)展屬性:主網(wǎng)卡默認(rèn)內(nèi)網(wǎng)DNS名稱 【使用說明】不支持設(shè)置和更新,由系統(tǒng)自動(dòng)維護(hù),訪問該默認(rèn)內(nèi)網(wǎng)域名前,請(qǐng)確保子網(wǎng)使用當(dāng)前系統(tǒng)提供的DNS |
project_id |
String |
項(xiàng)目ID,請(qǐng)參見獲取項(xiàng)目ID。 |
created_at |
String |
資源創(chuàng)建時(shí)間,UTC時(shí)間 格式y(tǒng)yyy-MM-ddTHH:mm:ss |
updated_at |
String |
資源更新時(shí)間,UTC時(shí)間 格式y(tǒng)yyy-MM-ddTHH:mm:ss |
屬性 |
類型 |
說明 |
---|---|---|
subnet_id |
String |
所屬子網(wǎng)ID 【使用說明】不支持更新 |
ip_address |
String |
端口IP地址 【使用說明】不支持更新 |
屬性 |
類型 |
說明 |
---|---|---|
ip_address |
String |
IP地址 【使用說明】不支持0.0.0.0 |
mac_address |
String |
MAC地址 |
響應(yīng)示例
{ "port": { "id": "a7d98f3c-b42f-460b-96a1-07601e145961", "name": "port-test02", "status": "DOWN", "admin_state_up": true, "fixed_ips": [], "mac_address": "fa:16:3e:01:f7:90", "network_id": "00ae08c5-f727-49ab-ad4b-b069398aa171", "tenant_id": "db82c9e1415a464ea68048baa8acc6b8", "project_id": "db82c9e1415a464ea68048baa8acc6b8", "device_id": "", "device_owner": "", "security_groups": [ "d0d58aa9-cda9-414c-9c52-6c3daf8534e6" ], "extra_dhcp_opts": [], "allowed_address_pairs": [], "binding:vnic_type": "normal", "binding:vif_details": {}, "binding:profile": {}, "port_security_enabled": true, "created_at": "2018-09-20T01:45:26", "updated_at": "2018-09-20T01:48:56" } }
狀態(tài)碼
請(qǐng)參見狀態(tài)碼。
錯(cuò)誤碼
請(qǐng)參見錯(cuò)誤碼。