assignSecondaryIps

Prev Next

Can be used in a VPC environment.

Overview

Assigns secondary IPs to network interfaces.

Request

Request parameter

Parameter name Requirement status Type Restrictions Description
regionCode No String - Region code
Decides the region of the network interface to assign secondary IPs to.
regionCode can be obtained through the getRegionList action.
Default: Selects the first region of the getRegionList search results.
networkInterfaceNo Yes String - Number of network interface to assign secondary IP to
networkInterfaceNo can be obtained through the getNetworkInterfaceList action.
secondaryIpList.N Conditional List Min: 0, Max: 5 - List of secondary IPs to assign
Adds private IPs that are included in the IP address range of the subnet where the network interface is located as secondary IPs.
Up to 5 secondary IPs per network interface can be added.
At least one secondary IP must be specified, which is counted by adding the numbers of secondaryIpList and secondaryIpCount.
ex) secondaryIpList.1=192.168.0.1&secondaryIpList.2=192.168.0.2
secondaryIpCount Conditional Integer Min : 0, Max 5 - Number of automatically assigned secondary IPs
A specified number of secondary IPs can be assigned automatically.
Private IPs not being used in the subnet where the selected network interface is located are assigned in sequence.
Up to 5 secondary IPs per network interface can be added.
At least one secondary IP must be specified, which is counted by adding the numbers of secondaryIpList and secondaryIpCount.
allowReassign No Boolean - Whether the explicit reassignment is allowed
When set to true, it removes any secondary IPs being used by other network interfaces, and reassigns them to the selected network interface.
When set to false, an error occurs if there are secondary IPs being used by other network interfaces.
The error will not occur if all the selected secondary IPs are not in use or already assigned to the selected network interface.
It is only applicable for the IPs specified with secondaryIpList.
Options : true | false
Default : false

Response

Response data type

  • NetworkInterfaceList type
NetworkInterfaceList extends CommonResponse
private Integer totalRows;
private List<NetworkInterface> networkInterfaceList = new ArrayList<>();
NetworkInterface
private String networkInterfaceNo;
private String networkInterfaceName;
private String subnetNo;
private Boolean deleteOnTermination;
private Boolean isDefault;
private String deviceName;
private CommonCode networkInterfaceStatus;
private CommonCode instanceType;
private String instanceNo;
private String ip;
private String macAddress;
private AccessControlGroupNoList accessControlGroupNoList;
private String networkInterfaceDescription;
private SecondaryIpList secondaryIpList;
SecondaryIpList
private List<String> secondaryIpList = new ArrayList<>();

Examples

Request examples

ncloud vserver assignSecondaryIps --regionCode KR --networkInterfaceNo ***87 --secondaryIpList ***.***.1.7 --secondaryIpCount 1

Response examples

<assignSecondaryIpsResponse>
  <requestId>73caedc4-073d-4001-a363-efedd90831be</requestId>
  <returnCode>0</returnCode>
  <returnMessage>success</returnMessage>
  <totalRows>1</totalRows>
  <networkInterfaceList>
    <networkInterface>
      <networkInterfaceNo>***87</networkInterfaceNo>
      <networkInterfaceName>test-***</networkInterfaceName>
      <subnetNo>***43</subnetNo>
      <deleteOnTermination>true</deleteOnTermination>
      <isDefault>true</isDefault>
      <deviceName>eth0</deviceName>
      <networkInterfaceStatus>
        <code>USED</code>
        <codeName>used </codeName>
      </networkInterfaceStatus>
      <instanceType>
        <code>VSVR</code>
        <codeName>Server (VPC)</codeName>
      </instanceType>
      <instanceNo>***4299</instanceNo>
      <ip>***.***.1.6</ip>
      <macAddress>F2:20:***:***:8A:F5</macAddress>
      <accessControlGroupNoList>
        <accessControlGroupNo>***63</accessControlGroupNo>
      </accessControlGroupNoList>
      <networkInterfaceDescription></networkInterfaceDescription>
      <secondaryIpList>
        <secondaryIp>***.***.1.7</secondaryIp>
        <secondaryIp>***.***.1.8</secondaryIp>
      </secondaryIpList>
    </networkInterface>
  </networkInterfaceList>
</assignSecondaryIpsResponse>