Skip to main content

CreateNetworkInterface

Description

call CreateNetworkInterface to create an elastic network card (ENI).

Request Method

POST

Request Path

/apsara/route/Ecs/CreateNetworkInterface

Request Parameters Common Parameters

NameLocationTypeRequiredSample valueDescription
Tag.N.KeyBODYstringNotestthe tag key of the elastic network card. The value range of n is 1~20. Once the value is passed in, an empty string is not allowed. it can be up to 128 characters in length. it cannot start with aliyun or acs: and cannot contain http:// or https://.
DescriptionBODYstringNotestdescription information of elastic network card. 2 to 256 English or Chinese characters in length and cannot start with http:// or https. default value: empty.
ResourceGroupIdBODYstringNorg-bp67acfmxazb4ph***resource group ID.
SecondaryPrivateIpAddressCountBODYintegerNo1specify the number of private IP addresses and let ECS automatically create IP addresses for you.
VSwitchIdBODYstringYesvsw-bp1s5fnvk4gn2tws03***specify the switch ID of the VPC. The private IP address of the ENI is selected from the idle address in the IP address segment of the switch.
SecurityGroupIdBODYstringNosg-bp1fg655nh68xyz9i***join a security group. The security group and ENI must be in the same VPC.
NetworkInterfaceNameBODYstringNoeni-eninameENI name. The length is 2~128 English or Chinese characters. It must start with a letter or Chinese, and cannot start with http:// or https. It can contain numbers, colons (:), underscores (_), or hyphens (-). default value: empty.
PrimaryIpAddressBODYstringNo172.17.**.***the primary private IP address of the flexible network card. specifies that the IP must be an idle address in the address segment of the switch to which it belongs. if it is not specified, the idle address in the switch will be randomly assigned by default.
versionBODYstringNo2016-01-01version of api
regionIdBODYstringYesNo sample value for this parameter.region id
Tag.N.ValueBODYstringNoapithe tag value of the flexible network card. The value range of n is 1~20. Once the value is passed in, it can be an empty string. it can be up to 128 characters and cannot start with acs: and cannot contain http:// or https://.
PrivateIpAddress.NBODYrepeatlistNo172.***.***.177Select one or more secondary private IP addresses from the free addresses in the CIDR address segment of the switch to which the ENI belongs. The value range of n:[0,10] description when assigning a secondary private IP address, you cannot specify parameters PrivateIpAddress.N and parameters SecondaryPrivateIpAddressCount.
SecurityGroupIds.NBODYrepeatlistNosg-bp1fg655nh68xyz9i***join one or more security groups. The security group and ENI must be in the same VPC. The value range of N is related to the ability of the ENI to join the security group quota. description simultaneous SecurityGroupId and SecurityGroupIds.N.
RegionIdBODYstringYescn-qingdao-env17-d01ID of the region where the instance is located. You can call the DescribeRegions to view the latest Alibaba Cloud region list.
ClientTokenBODYstringNo123e4567-e89b-12d3-a456-426655440000Ensure request idempotence. Generate a parameter value from your client to ensure that the parameter value is unique between different requests. ClientToken only supports ASCII characters and cannot exceed 64 characters. For more details, please refer to the section on how to ensure idempotence in the cloud server ECS development guide.

Return data

NameTypeSample valueDescription
RequestIDstring1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DCRequest id

Example

Successful Response example

{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}

Failed Response example

{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}

}