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

VPC環境で利用できます。

パブリック IPアドレスインスタンスをサーバインスタンスに割り当てます。

構文

associatePublicIpWithServerInstance構文は次の通りです。

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

オプション

associatePublicIpWithServerInstanceの実行時に指定できるオプションについて説明します。

必須オプション

associatePublicIpWithServerInstanceの必須オプションです。

オプション タイプ 必須の有無 説明
--publicIpInstanceNo String Required パブリック IPアドレスインスタンス番号
--serverInstanceNo String Required サーバインスタンス番号

共通オプション

vserverコマンドで共通して使用するオプションについては、Server (VPC)のオプションをご参照ください。

パブリック IPアドレスの割り当てリクエストが成功すると、パブリック IPアドレスの構成情報と割り当てられたサーバ情報が返されます。

コマンド

コマンドの例は次の通りです。

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

出力

出力の例は次の通りです。

{
  "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": "実行中"
        },
        "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"
  }
}