创建辅助弹性网卡
功能介绍
创建辅助弹性网卡。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。
URI
POST /v3/{project_id}/vpc/sub-network-interfaces
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
项目ID。 获取方式请参见获取项目ID。 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
dry_run |
否 |
Boolean |
|
sub_network_interface |
是 |
创建辅助弹性网卡请求体对象。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
virsubnet_id |
是 |
String |
|
vlan_id |
否 |
String |
|
parent_id |
是 |
String |
|
description |
否 |
String |
|
ipv6_enable |
否 |
Boolean |
|
private_ip_address |
否 |
String |
|
ipv6_ip_address |
否 |
String |
|
security_groups |
否 |
Array of strings |
|
project_id |
否 |
String |
|
allowed_address_pairs |
否 |
Array of AllowAddressPair objects |
|
响应参数
状态码:201
参数 |
参数类型 |
描述 |
---|---|---|
request_id |
String |
请求ID。 |
sub_network_interface |
SubNetworkInterface object |
辅助弹性网卡的响应体。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
|
virsubnet_id |
String |
|
private_ip_address |
String |
|
ipv6_ip_address |
String |
|
mac_address |
String |
|
parent_device_id |
String |
|
parent_id |
String |
|
description |
String |
|
vpc_id |
String |
|
vlan_id |
Integer |
|
security_groups |
Array of strings |
|
tags |
Array of ResourceTag objects |
|
project_id |
String |
|
created_at |
String |
|
allowed_address_pairs |
Array of AllowAddressPair objects |
|
state |
String |
|
instance_id |
String |
|
instance_type |
String |
|
scope |
String |
|
security_enabled |
Boolean |
|
请求示例
创建辅助弹性网卡,虚拟子网id为08278e6c-61ca-46c1-9fc3-0d4f6c12f193,宿主网络接口id为637748df-2986-4350-8303-95d259580fb3,关联安全组6727c950-9f01-47a2-a7aa-7d3686c4c95b。
POST https://{Endpoint}/v3/8c6fb137a48a428aaf9a0229dca4edb3/vpc/sub-network-interfaces
{
"sub_network_interface" : {
"virsubnet_id" : "08278e6c-61ca-46c1-9fc3-0d4f6c12f193",
"parent_id" : "637748df-2986-4350-8303-95d259580fb3",
"security_groups" : [ "6727c950-9f01-47a2-a7aa-7d3686c4c95b" ]
}
}
响应示例
状态码:201
POST操作正常返回,更多状态码请参见状态码。
{
"sub_network_interface" : {
"id" : "1f5fca65-6a75-47c8-942b-db1bbb81a22a",
"project_id" : "6b32266bded64091a138e9ec19cff361",
"virsubnet_id" : "3c15c3b0-0df4-4115-9c18-e67a8a0d7702",
"private_ip_address" : "192.168.0.219",
"ipv6_ip_address" : "2407:c080:1200:2038:53a4:ad1c:ef34:f4ef",
"mac_address" : "fa:16:3e:26:7e:59",
"parent_device_id" : "285b2e45-2968-4f4c-8992-54e0d4c8da1d",
"security_enabled" : false,
"security_groups" : [ ],
"allowed_address_pairs" : [ ],
"vpc_id" : "c10e1e02-9db2-4bd0-89ef-52536952627e",
"instance_id" : "",
"instance_type" : "",
"description" : "",
"parent_id" : "00336617-4552-48c5-9856-f539f4e9aca2",
"vlan_id" : 551,
"state" : "NORMAL",
"tags" : [ ],
"scope" : "center",
"created_at" : "2025-02-10T08:17:16Z"
},
"request_id" : "f0893730b622bf32beea6fa5b387a5dc"
}
状态码
状态码 |
描述 |
---|---|
201 |
POST操作正常返回,更多状态码请参见状态码。 |
错误码
请参见错误码。