CreateNetworkInterface
Description
call CreateNetworkInterface to create an elastic network card (ENI).
Request Method
POST
Request Path
/apsara/route/Ecs/CreateNetworkInterface
Request Parameters Common Parameters
Name | Location | Type | Required | Sample value | Description |
---|---|---|---|---|---|
Tag.N.Key | BODY | string | No | test | the 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://. |
Description | BODY | string | No | test | description information of elastic network card. 2 to 256 English or Chinese characters in length and cannot start with http:// or https. default value: empty. |
ResourceGroupId | BODY | string | No | rg-bp67acfmxazb4ph*** | resource group ID. |
SecondaryPrivateIpAddressCount | BODY | integer | No | 1 | specify the number of private IP addresses and let ECS automatically create IP addresses for you. |
VSwitchId | BODY | string | Yes | vsw-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. |
SecurityGroupId | BODY | string | No | sg-bp1fg655nh68xyz9i*** | join a security group. The security group and ENI must be in the same VPC. |
NetworkInterfaceName | BODY | string | No | eni-eniname | ENI 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. |
PrimaryIpAddress | BODY | string | No | 172.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. |
version | BODY | string | No | 2016-01-01 | version of api |
regionId | BODY | string | Yes | No sample value for this parameter. | region id |
Tag.N.Value | BODY | string | No | api | the 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.N | BODY | repeatlist | No | 172.***.***.177 | Select 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.N | BODY | repeatlist | No | sg-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. |
RegionId | BODY | string | Yes | cn-qingdao-env17-d01 | ID of the region where the instance is located. You can call the DescribeRegions to view the latest Alibaba Cloud region list. |
ClientToken | BODY | string | No | 123e4567-e89b-12d3-a456-426655440000 | Ensure 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
Name | Type | Sample value | Description |
---|---|---|---|
RequestID | string | 1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC | Request id |
Example
Successful Response example
{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}
Failed Response example
{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}
}