端口插入安全组
功能介绍
端口插入安全组
URI
PUT /v3/{project_id}/ports/{port_id}/insert-security-groups
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
port_id |
是 |
String |
端口的唯一标识 |
project_id |
是 |
String |
项目ID |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
port |
是 |
InsertSecurityGroupOption object |
端口插入安全组请求体 |
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
request_id |
String |
请求ID |
port |
port object |
端口插入安全组的响应体 |
参数 |
参数类型 |
描述 |
---|---|---|
admin_state_up |
Boolean |
|
binding:host_id |
String |
|
binding:profile |
Object |
|
binding:vif_details |
Object |
|
binding:vif_type |
String |
|
binding:vnic_type |
String |
|
created_at |
String |
|
updated_at |
String |
|
description |
String |
|
device_id |
String |
|
device_owner |
String |
|
ecs_flavor |
String |
|
id |
String |
|
instance_id |
String |
|
instance_type |
String |
|
mac_address |
String |
|
name |
String |
|
port_security_enabled |
Boolean |
|
private_ips |
Array of PrivateIpInfo objects |
|
project_id |
String |
|
security_groups |
Array of strings |
|
status |
String |
|
tenant_id |
String |
|
virsubnet_id |
String |
|
vpc_id |
String |
|
vpc_tenant_id |
String |
|
vtep_ip |
String |
|
enable_efi |
Boolean |
|
scope |
String |
|
zone_id |
String |
|
binding:migration_info |
Object |
|
extra_dhcp_opts |
Array of objects |
|
position_type |
String |
|
instance_info |
Object |
|
tags |
Array of strings |
|
allowed_address_pairs |
Array of AllowAddressPair objects |
请求示例
指定端口插入安全组,端口99fd0c77-56b4-4bf6-8365-df352e45d5fc已关联的安全组列表为["567be4e3-d171-46ce-9e8a-c15e91cfe86a", "4940b983-5992-4663-bed9-d1d1e15d1009"],要将新安全组插入到第1个安全组567be4e3-d171-46ce-9e8a-c15e91cfe86a后面,此时新安全组插入的index为1。
PUT https://{Endpoint}/v3/f5dab68cd75740e68c599e9af5fe0aed/ports/99fd0c77-56b4-4bf6-8365-df352e45d5fc/insert-security-groups { "port" : { "security_groups" : [ "8edd3747-ccd4-49a1-82b9-a165eec314b4", "6c2d4540-3b7d-4207-a319-a7231b439995" ], "index" : 1 } }
响应示例
状态码: 200
OK
{ "port" : { "name" : "", "id" : "99fd0c77-56b4-4bf6-8365-df352e45d5fc", "admin_state_up" : true, "status" : "DOWN", "project_id" : "f5dab68cd75740e68c599e9af5fe0aed", "device_id" : "", "mac_address" : "fa:16:3e:1f:17:df", "device_owner" : "", "description" : "", "vpc_id" : null, "zone_id" : "", "scope" : "center", "position_type" : "center", "vtep_ip" : null, "created_at" : "2023-05-10T01:35:02", "updated_at" : "2023-05-10T01:35:02", "port_security_enabled" : true, "tags" : [ ], "security_groups" : [ "567be4e3-d171-46ce-9e8a-c15e91cfe86a", "8edd3747-ccd4-49a1-82b9-a165eec314b4", "6c2d4540-3b7d-4207-a319-a7231b439995", "4940b983-5992-4663-bed9-d1d1e15d1009" ], "allowed_address_pairs" : [ ], "extra_dhcp_opts" : [ ], "instance_info" : null, "instance_id" : "", "instance_type" : "", "ecs_flavor" : "", "enable_efi" : false, "virsubnet_id" : "3847b263-2370-45c0-8236-38a1de568049", "private_ips" : [ { "subnet_cidr_id" : "ffe98087-6d4f-45cd-988b-1c87f75d2d53", "ip_address" : "192.168.158.228" } ], "vpc_tenant_id" : null, "binding:host_id" : "", "binding:vif_type" : "unbound", "binding:vnic_type" : "normal", "binding:vif_details" : { }, "binding:profile" : { }, "binding:migration_info" : { } }, "request_id" : "458691c0-7db2-43d8-9400-053800c5ff53" }
状态码
状态码 |
描述 |
---|---|
200 |
OK |
400 |
Bad Request |
401 |
Unauthorized |
403 |
Forbidden |
404 |
Not Found |
409 |
Conflict |
500 |
Internal Server Error |
错误码
请参见错误码。