Description
Specify the port which status is "Dettached".
You can attach an additional port up to one.
For local network, you can attach two port at most.
The VM should not be running when being attached.
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 Token | header | |
| tenant_id | URI | ||
| server_id | URI | ||
| port_id |
Request Json
{
"interfaceAttachment": {
"port_id": "ce531f90-199f-48c0-816c-13e38010b442"
}
}
Normal response codes
200
Example
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.cloud.z.com/v2/1864e71d2deb46f6b47526b69c65a45d/servers/e25b3611-96df-4514-a54b-7729aec48dc1/os-interface
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"
}
}