Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating a Supplementary Network Interface

Updated on 2025-02-06 GMT+08:00

Function

This API is used to create a supplementary network interface.

URI

POST /v3/{project_id}/vpc/sub-network-interfaces

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

For details about how to obtain a project ID, see Obtaining a Project ID.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

dry_run

No

Boolean

  • Whether to only send the check request.

  • The value can be one of the following:

    • true: A check request will be sent and the supplementary network interface will not be created. Check items include mandatory parameters, request format, and constraints. If the check fails, the system returns an error. If the check succeeds, response code 202 will be returned.

    • false (default value): A request will be sent and a supplementary network interface will be created.

sub_network_interface

Yes

CreateSubNetworkInterfaceOption object

Request body for creating a supplementary network interface.

Table 3 CreateSubNetworkInterfaceOption

Parameter

Mandatory

Type

Description

virsubnet_id

Yes

String

  • ID of the virtual subnet.

  • The value must be in standard UUID format.

vlan_id

No

String

  • VLAN ID of the supplementary network interface.

  • The value ranges from 1 to 4094.

  • Each supplementary network interface has a unique VLAN ID.

parent_id

Yes

String

  • ID of the elastic network interface.

  • The value must be in standard UUID format.

  • The value must be an existing port ID.

description

No

String

  • Description about the supplementary network interface.

  • The value can contain up to 255 characters and cannot contain angle brackets (< or >).

ipv6_enable

No

Boolean

  • Whether to enable IPv6 for the supplementary network interface.

  • The value can be true (enabled) or false (disabled).

  • The default value is false.

private_ip_address

No

String

  • Private IPv4 address of the supplementary network interface.

  • The value must be within the virtual subnet. If this parameter is left blank, an IP address will be randomly assigned.

ipv6_ip_address

No

String

  • IPv6 address of the supplementary network interface.

  • If this parameter is left blank, an IP address will be randomly assigned.

security_groups

No

Array of strings

  • Security group IDs, for example, "security_groups": ["a0608cbf-d047-4f54-8b28-cd7b59853fff"].

  • The default value is the default security group.

project_id

No

String

  • Project ID of the supplementary network interface.

  • The value must be in standard UUID format.

  • Only administrators have permissions to specify project IDs.

allowed_address_pairs

No

Array of AllowAddressPair objects

  • IP address and MAC address pairs. For details, see the AllowAddressPair table.

  • Note:

    • The IP address cannot be 0.0.0.0.

    • Configure a dedicated security group for the port if allowed_address_pairs has a CIDR block with a netmask length less than 24.

    • ip_address cannot be set to a CIDR block in a hardware SDN environment.

Table 4 AllowAddressPair

Parameter

Mandatory

Type

Description

ip_address

No

String

  • IP address.

    • You cannot set it to 0.0.0.0.

    • Configure a dedicated security group for the port if allowed_address_pairs has a CIDR block with a netmask length less than 24.

mac_address

No

String

  • MAC address.

Response Parameters

Status code: 201

Table 5 Response body parameters

Parameter

Type

Description

request_id

String

Request ID.

sub_network_interface

SubNetworkInterface object

Response body of a supplementary network interface.

Table 6 SubNetworkInterface

Parameter

Type

Description

id

String

  • Supplementary network interface ID, which uniquely identifies the supplementary network interface.

  • The value is in UUID format with hyphens (-).

virsubnet_id

String

  • ID of the virtual subnet.

  • The value must be in standard UUID format.

private_ip_address

String

  • Private IPv4 address of the supplementary network interface.

  • The value must be within the virtual subnet. If this parameter is left blank, an IP address will be randomly assigned.

ipv6_ip_address

String

  • IPv6 address of the supplementary network interface.

mac_address

String

  • MAC address of the supplementary network interface.

  • The value is a valid MAC address assigned by the system randomly.

parent_device_id

String

  • Device ID.

  • The value must be in standard UUID format.

parent_id

String

  • ID of the elastic network interface.

  • The value must be in standard UUID format.

description

String

  • Description about the supplementary network interface.

  • The value can contain up to 255 characters and cannot contain angle brackets (< or >).

vpc_id

String

  • VPC ID of the supplementary network interface.

  • The value must be in standard UUID format.

vlan_id

Integer

  • VLAN ID of the supplementary network interface.

  • The value ranges from 1 to 4094.

  • Each supplementary network interface has a unique VLAN ID.

security_groups

Array of strings

  • Security group IDs, for example, "security_groups": ["a0608cbf-d047-4f54-8b28-cd7b59853fff"].

  • The default value is the default security group.

tags

Array of ResourceTag objects

  • Tags of the supplementary network interface.

project_id

String

  • Project ID of the supplementary network interface.

created_at

String

  • Time when the supplementary network interface was created.

  • The value is a UTC time in the format of yyyy-MM-ddTHH:mm:ssZ.

allowed_address_pairs

Array of AllowAddressPair objects

  • IP address and MAC address pairs. For details, see the AllowAddressPair table.

  • Note:

    • The IP address cannot be 0.0.0.0.

    • Configure a dedicated security group for the port if allowed_address_pairs has a CIDR block with a netmask length less than 24.

    • ip_address cannot be set to a CIDR block in a hardware SDN environment.

state

String

  • Status of the supplementary network interface.

instance_id

String

  • ID of the instance that is attached to the supplementary network interface, for example, the RDS instance ID.

instance_type

String

  • Type of the instance that is attached to the supplementary network interface, for example, an RDS instance.

scope

String

  • Public network egress information of the site where the supplementary network interface works.

security_enabled

Boolean

  • Whether the security option is enabled for the supplementary network interface. If the option is not enabled, the security group does not take effect.

Table 7 ResourceTag

Parameter

Type

Description

key

String

  • Tag key

  • Tag keys must be unique for each resource.

Minimum: 1

Maximum: 128

value

String

  • Tag value.

Maximum: 255

Table 8 AllowAddressPair

Parameter

Type

Description

ip_address

String

  • IP address.

    • You cannot set it to 0.0.0.0.

    • Configure a dedicated security group for the port if allowed_address_pairs has a CIDR block with a netmask length less than 24.

mac_address

String

  • MAC address.

Example Requests

Create a supplementary network interface. Set its virtual subnet ID to 08278e6c-61ca-46c1-9fc3-0d4f6c12f193, elastic network interface ID to 637748df-2986-4350-8303-95d259580fb3, and associated security group to 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" ]
  }
}

Example Responses

Status code: 201

Normal response to the POST operation. For more status codes, see Status Codes.

{
  "sub_network_interface" : {
    "id" : "2be868f2-f7c9-48db-abc0-eea0b9105b0d",
    "project_id" : "8c6fb137a48a428aaf9a0229dca4edb3",
    "virsubnet_id" : "08278e6c-61ca-46c1-9fc3-0d4f6c12f193",
    "private_ip_address" : "10.0.0.225",
    "mac_address" : "fa:16:3e:48:f8:6f",
    "parent_device_id" : "1ab01f1d-4ef7-4d83-82be-802b3aca0223",
    "security_groups" : [ "6727c950-9f01-47a2-a7aa-7d3686c4c95b" ],
    "allowed_address_pairs" : [ ],
    "vpc_id" : "63b97e6b-3598-430f-9eb8-1caf06937be8",
    "parent_id" : "637748df-2986-4350-8303-95d259580fb3",
    "vlan_id" : 2787,
    "instance_type" : "",
    "instance_id" : "",
    "tags" : [ ],
    "created_at" : "2020-05-19T01:16:25.000+00:00"
  },
  "request_id" : "ceb6273e-1ec9-4168-ac11-3dfeaacfc889"
}

Status Codes

Status Code

Description

201

Normal response to the POST operation. For more status codes, see Status Codes.

Error Codes

See Error Codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback