MENU
ポートアタッチ - Compute API v2
Description
Dettached状態のポートを指定してください。
追加IPのポートは1つまでアタッチできます。
ローカルネットワークのポートは2つまでアタッチできます。
DBサーバー接続用ネットワークのポートは1つまでアタッチできます。
アタッチするVMは停止状態である必要があります。
Request URL
Compute API v2.0 POST /v2/{tenant_id}/servers/{server_id}/os-interface
Request Paramters
Parameter | Value | Style | Description |
---|---|---|---|
X-Auth-Token | Userトークン | header | トークンID |
tenant_id | URI | テナントID | |
server_id | URI | サーバーID | |
port_id | ポートID |
Request Json
{ "interfaceAttachment": { "port_id": "ce531f90-199f-48c0-816c-13e38010b442" } }
Normal response codes
200
Example
※エンドポイントURLにつきましては、お客様環境によって異なりますので、コントロールパネルにてご確認の上ご利用ください。
- REQ
curl -i -X POST \ -H "Accept: application/json" \ -H "X-Auth-Token: 35941e7df872405d84e5b026dba8323c" \ -d '{"interfaceAttachment": {"port_id": "8af5ffad-0ac1-471e-a157-ac0503222249"}}' \ https://compute.tyo1.conoha.io/v2/1864e71d2deb46f6b47526b69c65a45d/servers/e25b3611-96df-4514-a54b-7729aec48dc1/os-interface
- RES
HTTP/1.1 200 OK Date: Wed, 10 Dec 2014 06:47:37 GMT Server: Apache Content-Length: 282 Content-Type: text/html; charset=UTF-8 { "interfaceAttachment": { "port_state": "DOWN", "fixed_ips": [ { "subnet_id": "dd8b5b89-7ae3-474c-8270-a983cb79643b", "ip_address": "192.168.2.xxx" } ], "port_id": "c35a9a4a-8003-4c9f-8403-d9ad35ff1c64", "net_id": "dff999a4-afa1-4766-9525-f31f1fde750e", "mac_addr": "fa:16:3e:88:8f:2e" } }