Documentation Index

Fetch the complete documentation index at: https://cli.ncloud-docs.com/llms.txt

Use this file to discover all available pages before exploring further.

associatePublicIpWithServerInstance

Prev Next

Available in VPC

Assign public IP instances to server instances.

Syntax

The associatePublicIpWithServerInstance syntax is as follows:

./ncloud vserver associatePublicIpWithServerInstance \
    --publicIpInstanceNo <public-ip-no> \
    --serverInstanceNo <server-instance-no> \
    [--regionCode <KR|SGN|JPN>] \
    [--output <json|xml>]

Options

This section describes the options available when running associatePublicIpWithServerInstance.

Required options

The following options are required for associatePublicIpWithServerInstance.

Options Type Required Description
--publicIpInstanceNo String Required Public IP instance number
--serverInstanceNo String Required Server instance number

Common options

For information about the options common to all vserver subcommands, see Server (VPC) options.

Examples

If the request to assign a public IP address is successful, the configuration information for the public IP address and the details of the assigned server are returned.

Command

The command example is as follows:

./ncloud vserver associatePublicIpWithServerInstance \
    --publicIpInstanceNo 78901234 \
    --serverInstanceNo 34567892 \
    --regionCode KR \
    --output json

Output

The output example is as follows:

{
  "associatePublicIpWithServerInstanceResponse": {
    "totalRows": 1,
    "publicIpInstanceList": [
      {
        "publicIpInstanceNo": "78901234",
        "publicIp": "203.0.113.10",
        "publicIpDescription": "Test public IP",
        "createDate": "2026-05-14T19:53:38+0900",
        "publicIpInstanceStatusName": "Configuring",
        "publicIpInstanceStatus": {
          "code": "RUN",
          "codeName": "In operation"
        },
        "serverInstanceNo": "34567892",
        "serverName": "public-test-server",
        "privateIp": "192.0.2.6",
        "publicIpInstanceOperation": {
          "code": "SET",
          "codeName": "SETTING OP"
        }
      }
    ],
    "requestId": "d4e5f678-9012-3456-def0-456789012345",
    "returnCode": "0",
    "returnMessage": "success"
  }
}