Create Virtual Network Card - CreateNetworkInterface
Overview
Create Virtual Network Card
Definition
Public Parameters
Parameter Name | Type | Description Information | Required |
---|---|---|---|
Action | string | Corresponding API command name, the current API is CreateNetworkInterface . | Yes |
PublicKey | string | The user's public key can be obtained from Console (opens in a new tab) | Yes |
Signature | string | User signature generated based on public key and API command, see Signature Algorithm | Yes |
Request Parameters
Parameter Name | Type | Description Information | Required |
---|---|---|---|
Region | string | Region. See List of Regions and Availability Zones | Yes |
ProjectId | string | Project ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the GetProjectList interface. | Yes |
VPCId | string | Belonging VPCID | Yes |
SubnetId | string | Subnet ID | Yes |
Name | string | Name of the virtual network card, default is NetworkInterface | No |
PrivateIp.N | string | Specify the private network IP. Currently, a network card only supports binding to one private network IP. | No |
SecurityGroupId | string | Firewall GroupId, default: Web recommended firewall Can be obtained from GroupId in DescribeSecurityGroupResponse | No |
Tag | string | Business Group | No |
Remark | string | Note | No |
Response Field
Field Name | Type | Description Information | Required |
---|---|---|---|
RetCode | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. | Yes |
Action | string | Operation command name. | Yes |
Message | string | Returns an error message, providing detailed description when RetCode is non-zero. | No |
NetworkInterface | NetworkInterfaceInfo | If creation is successful, the information of the virtual network card will be returned. If creation fails, this parameter does not exist. | No |
Data Model
NetworkInterfaceInfo
Field Name | Type | Description Information | Required |
---|---|---|---|
InterfaceId | string | Virtual Network Card Resource ID | Yes |
VPCId | string | Belonging VPC | Yes |
SubnetId | string | Subnet Ownership | Yes |
PrivateIpSet | array[string] | Associate with the internal network IP. Currently, a network card only supports binding with one internal network IP. | Yes |
MacAddress | string | Associate Mac | Yes |
Status | int | Binding Status | Yes |
Name | string | Virtual Network Card Name | No |
Netmask | string | Private Network IP Mask | No |
Gateway | string | Default Gateway | No |
AttachInstanceId | string | Bind Instance Resource ID | No |
Default | boolean | Is it the default network card bound to the instance? false: No true: Yes | No |
CreateTime | int | Creation Time | No |
Remark | string | Note | No |
Tag | string | Business Group | No |
Example
Request Example
{
"Action": "CreateNetworkInterface",
"Region": "cn-bj2",
"ProjectId": "org-test",
"VPCId": "uvnet-331hnn",
"SubnetId": "subnet-hlfs4x",
"Name": "helloucloud",
"Tag": "test",
"Remark": "test",
"PrivateIp.0": "10.21.11.11",
"SecurityGroupId": "0"
}
Response Example
{
"Action": "CreateNetworkInterfaceResponse",
"NetworkInterface": {
"AttachInstanceId": "",
"CreateTime": 1513745006,
"Default": false,
"Gateway": "10.99.2.1",
"InterfaceId": "uni-wbybfs",
"MacAddress": "52:54:00:1F:A7:F7",
"Name": "helloucloud",
"Netmask": "255.255.255.0",
"PrivateIpSet": [
"10.99.2.81"
],
"Remark": "test",
"Status": 0,
"SubnetId": "subnet-hlfs4x",
"Tag": "test",
"VPCId": "uvnet-331hnn"
},
"RetCode": 0
}