更新端口-九游平台
功能介绍
更新端口。
此接口可用于更改ecs的安全组,其中port_id是ecs的网卡id。
调试
您可以在中调试该接口。
uri
put /v1/{project_id}/ports/{port_id}
名称 |
是否必选 |
说明 |
---|---|---|
port_id |
是 |
端口的唯一标识。 |
project_id |
是 |
项目id,请参见获取项目id。 |
请求参数
名称 |
是否必选 |
参数类型 |
说明 |
---|---|---|---|
port |
是 |
object |
端口对象,请参见。 更新操作时至少指定一项属性。 |
名称 |
是否必选 |
参数类型 |
说明 |
---|---|---|---|
name |
否 |
string |
|
security_groups |
否 |
array of strings |
|
allowed_address_pairs |
否 |
array of objects |
|
extra_dhcp_opts |
否 |
array of objects |
dhcp的扩展option(扩展属性),请参见。 |
名称 |
是否必选 |
参数类型 |
说明 |
---|---|---|---|
ip_address |
是 |
string |
|
mac_address |
否 |
string |
mac地址。默认使用当前端口的mac地址。 |
名称 |
是否必选 |
参数类型 |
说明 |
---|---|---|---|
opt_name |
否 |
string |
dhcp选项名称,目前仅支持填写“51”,表示dhcp租约时间。 |
opt_value |
否 |
string |
|
请求示例
- 更新id为7204e0da-40de-4207-a536-6f59b84f6f0e的端口,名称更新为abc。
put https://{endpoint}/v1/{project_id}/ports/7204e0da-40de-4207-a536-6f59b84f6f0e { "port": { "name": "abc" } }
响应参数
名称 |
参数类型 |
说明 |
---|---|---|
port |
object |
端口对象,请参见。 |
名称 |
参数类型 |
说明 |
---|---|---|
id |
string |
端口唯一标识。 |
name |
string |
|
network_id |
string |
说明:
网络id的获取方式:
|
admin_state_up |
boolean |
|
mac_address |
string |
|
fixed_ips |
array of objects |
|
device_id |
string |
|
device_owner |
string |
|
tenant_id |
string |
项目id。 |
status |
string |
|
security_groups |
array of strings |
安全组的uuid(扩展属性)。 |
allowed_address_pairs |
array of objects |
|
extra_dhcp_opts |
array of objects |
dhcp的扩展option(扩展属性),请参见。 |
binding:vif_details |
object |
vif的详细信息,参见。 |
binding:profile |
object |
扩展属性:提供用户设置自定义信息。 【使用说明】
|
binding:vnic_type |
string |
|
dns_assignment |
array of objects |
|
dns_name |
string |
|
instance_id |
string |
|
instance_type |
string |
|
port_security_enabled |
boolean |
|
zone_id |
string |
端口所属的可用分区。 |
enable_efi |
boolean |
|
ipv6_bandwidth_id |
string |
|
名称 |
参数类型 |
说明 |
---|---|---|
subnet_id |
string |
|
ip_address |
string |
端口ip地址。 |
名称 |
参数类型 |
说明 |
---|---|---|
ip_address |
string |
|
mac_address |
string |
mac地址。默认使用本端口的mac地址。 |
名称 |
参数类型 |
说明 |
---|---|---|
opt_name |
string |
dhcp选项名称,目前仅支持填写“51”,表示dhcp租约时间。 |
opt_value |
string |
|
名称 |
参数类型 |
说明 |
---|---|---|
primary_interface |
boolean |
取值为true,表示是虚拟机的主网卡。 |
port_filter |
boolean |
表示该网络服务提供端口过滤特性,如安全组和反mac/ip欺骗。 |
ovs_hybrid_plug |
boolean |
用于通知像nova这样的api消费者,应该使用ovs的混合插入策略。 |
名称 |
参数类型 |
说明 |
---|---|---|
hostname |
string |
端口hostname。 |
ip_address |
string |
端口ip地址。 |
fqdn |
string |
端口内网fqdn。 |
响应示例
{ "port": { "id": "7204e0da-40de-4207-a536-6f59b84f6f0e", "name": "abc", "status": "down", "admin_state_up": "true", "fixed_ips": [ { "subnet_id": "689156ca-038f-4478-b265-fd26aa8bbe31", "ip_address": "192.168.0.9" } ], "mac_address": "fa:16:3e:d7:f2:6c", "network_id": "b4152e98-e3af-4e49-bb7f-7766e2b5ec63", "tenant_id": "caa6cf4337ea47fb823b15709ebe8591", "device_id": "", "device_owner": "", "security_groups": [ "59b39002-e79b-4bac-8e27-aa884ab1beb6" ], "extra_dhcp_opts": [], "allowed_address_pairs": [], "binding:vnic_type": "normal", "enable_efi": false } }
状态码
请参见状态码。
错误码
请参考错误码。
相关文档
意见反馈
文档内容是否对您有帮助?
如您有其它疑问,您也可以通过华为云社区问答频道来与我们联系探讨