createNetworkInterface

Prev Next

Available in VPC

Create a network interface.

Request

This section describes the request format. The method and URI are as follows:

Method URI
GET | POST /vserver/v2/createNetworkInterface
Note

This guide is based on the GET method. POST method call tests can be performed through Swagger in the API Gateway service of the NAVER Cloud Platform console.

Request headers

For information about the headers common to all Server APIs, see Server request headers.

Request query parameters

You can use the following query parameters with your request:

Field Type Required Description
regionCode String Optional Region code
vpcNo String Required VPC number
subnetNo String Required Subnet number
networkInterfaceName String Optional Network interface name
  • Enter 3 to 30 characters using a combination of lowercase English letters, numbers, and the special character "-".
  • The string must start with a lowercase English letter and end with a lowercase English letter or a number.
  • Auto-generated on no input (default)
accessControlGroupNoList.N Array Required ACG number list
  • See getAccessControlGroupList.
  • Between 1 and 3 can be entered.
  • Example: accessControlGroupNoList.1=1234&accessControlGroupNoList.2=2345
serverInstanceNo String Optional Server instance number
  • See getServerInstanceList.
  • Can be assigned to the server only if it is a network interface on a private subnet.
ip String Optional Primary IP address
  • Enter in the subnet IP's address range.
  • Subnet's 0-5th and last IP addresses can't be used.
  • Can't duplicate IP addresses within the subnet range.
  • Auto-assigned on no input (default)
  • Example: 192.168.0.6
isBareMetal Boolean Optional Whether it is a network interface for bare metal servers
  • true | false (default)
    • true: for bare metal servers (serverInstanceNo required)
    • false: general
  • Network interfaces for bare metal servers can't be created on general subnets.
secondaryIpList.N Array Optional Secondary IP list
  • Enter in the subnet IP's address range.
  • Up to 5 can be entered including secondaryIpCount.
  • Can't duplicate IP addresses within the subnet range.
  • Explicit reassignments are available through assignSecondaryIps.
  • Example: secondaryIpList.1=192.168.0.1&secondaryIpList.2=192.168.0.2
secondaryIpCount Integer Optional Number of auto-assigned secondary IPs
  • 0-5
  • Automatically assign private IPs sequentially.
  • Up to 5 can be entered including secondaryIpList.
networkInterfaceDescription String Optional Network interface description (byte)
  • 0-1000
responseFormatType String Optional Format of the response data
  • xml (default) | json

Request example

The request example is as follows:

curl --location --request GET 'https://ncloud.apigw.ntruss.com/vserver/v2/createNetworkInterface
?regionCode=KR
&vpcNo=4**5
&subnetNo=3***5
&networkInterfaceName=mynic
&accessControlGroupNoList.1=1***1
&isBareMetal=false
&secondaryIpCount=0
&responseFormatType=json' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'

Response

This section describes the response format.

Response body

The response body includes the following data:

Field Type Required Description
createNetworkInterfaceResponse Object - Response result
createNetworkInterfaceResponse.requestId String - ID for the request
  • UUID format
createNetworkInterfaceResponse.returnCode String - Response code
createNetworkInterfaceResponse.returnMessage String - Response message

Response status codes

For information about the response status codes common to all Server APIs, see Server response status codes.

Response example

The response example is as follows:

{
  "createNetworkInterfaceResponse": {
    "totalRows": 1,
    "networkInterfaceList": [
      {
        "networkInterfaceNo": "70***0",
        "networkInterfaceName": "mynic",
        "subnetNo": "3***5",
        "deleteOnTermination": false,
        "isDefault": false,
        "deviceName": "",
        "networkInterfaceStatus": {
          "code": "NOTUSED",
          "codeName": "Not used"
        },
        "ip": "10.0.20.6",
        "macAddress": "F2:**:**:**:**:A3",
        "enableFlowLog": false,
        "accessControlGroupNoList": [
          "1***1"
        ],
        "networkInterfaceDescription": "",
        "secondaryIpList": []
      }
    ],
    "requestId": "b201fd9f-****-****-****-7610442de046",
    "returnCode": "0",
    "returnMessage": "success"
  }
}