MENU

Description

Nameの変更を行うことはできません。

指定したパラメータの値のみ更新されます。
(例:fixed_ipsのみ変更したい場合は、リクエストにfixed_ipsのみ指定して実行)

Request URL

Network API v2.0

PUT /v2.0/ports/{port_id}

Request Paramters

Parameter Value Style Description
X-Auth-Token Userトークン header トークンID
port_id Port ID URI ポートID
security_groups(Optional) Array セキュリティグループID
fixed_ips(Optional) plain IPアドレスを指定したい時に利用する。空の配列([])を明示的に指定することはできません。
allowed_address_pairs(Optional) plain VIPを利用する際に指定する. 自分所有のVIPアドレス以外を指定した場合は適用されません。

以下の表のように、指定したネットワークによって受け入れるパラメータが異なりますのでご注意ください。

add ip net local net PaaS net External net
security_groups Optional Optional Optional Optional
fixed_ips Optional Optional x x
allowed_address_pairs Optional x x Optional

Request Json

{
    "port": {
        "fixed_ips": [
            {
                "ip_address": "157.7.80.144",
                "subnet_id": "1ef2a905-9a0e-4845-bf3a-8723df3e72d0"
            },
            {
                "ip_address": "157.7.80.145",
                "subnet_id": "1ef2a905-9a0e-4845-bf3a-8723df3e72d0"
            }
        ],
        "allowed_address_pairs": [
            {
                "ip_address": "157.7.80.32"
            },
            {
                "ip_address": "157.7.80.33"
            }
        ],
        "security_groups": [
            "359710a9-ce31-40d0-9548-32d4f9f2a56a",
            "038f84be-0431-4691-a87c-d846436ea354"
        ]
    }
}

Request Json (External PortにVIPアドレスを結び付けたいときの例)

IPv6アドレスは自動で割り当てられますので、紐付けたいVIPアドレスのみ指定してください。

{
    "port": {
        "allowed_address_pairs": [
            {
                "ip_address": "157.7.80.144"
            }
        ]
    }
}

Request Json (allowed_address_pairs削除時の例)

{
    "port": {
        "allowed_address_pairs": []
    }
}

Request Json (security_groups削除時の例)

{
    "port": {
        "security_groups": []
    }
}

Normal response codes

200

Example
※エンドポイントURLにつきましては、お客様環境によって異なりますので、コントロールパネルにてご確認の上ご利用ください。

  • REQ
curl -i -X PUT -H "Accept: application/json" -H "X-Auth-Token: 0925897a3d4543218ff0dcd2bb378a8e" -d '{"port": {"security_groups": ["bda5122c-81bc-4dc5-b353-2d349c3e2063"]}}' https://networking.tyo1.conoha.io/v2.0/ports/490f1e4f-5a60-4df9-88b1-953de
ebdf139
  • RES
HTTP/1.1 200 OK
Server: openresty/1.7.10.1
Date: Fri, 08 May 2015 10:48:20 GMT
Content-Type: application/json
Content-Length: 564
Connection: keep-alive

{
    "port": {
        "status": "ACTIVE",
        "name": "PORT_NAME",
        "allowed_address_pairs": [],
        "admin_state_up": true,
        "network_id": "7d9e6cbf-9473-4e16-a501-284b59300f3f",
        "tenant_id": "22394afc818d471ca2f0308c06ae7460",
        "extra_dhcp_opts": [],
        "binding:vnic_type": "normal",
        "device_owner": "compute:None",
        "mac_address": "fa:16:3e:79:c8:30",
        "fixed_ips": [
            {
                "subnet_id": "6c480943-b1e9-4b52-8048-8bf1df550503",
                "ip_address": "10.10.8.1"
            }
        ],
        "id": "490f1e4f-5a60-4df9-88b1-953deebdf139",
        "security_groups": [
            "bda5122c-81bc-4dc5-b353-2d349c3e2063"
        ],
        "device_id": "8ae928f5-238e-4b67-9861-eca74312d897"
    }
}