| Method | URI | Description |
|---|---|---|
| POST | /v2/{tenant_id}/servers/{server_id}/os-attach-interfaces | Creates and uses a port interface to attach the port to a server instance. |
Normal response codes: 202
This table shows the URI parameters for the create interface request:
| Name | Type | Description |
|---|---|---|
| String | The ID for the tenant or account in a multi-tenancy cloud. |
| UUID | The UUID for the server of interest to you. |
Example 3.139. Create interface: JSON request
{
"interfaceAttachment": {
"port_id": "ce531f90-199f-48c0-816c-13e38010b442"
}
}
Example 3.140. Create interface: XML request
<?xml version="1.0" encoding="UTF-8"?> <interfaceAttachment> <port_id>ce531f90-199f-48c0-816c-13e38010b442</port_id> </interfaceAttachment>
This operation does not require a request body.
Example 3.141. Create interface: JSON response
{
"interfaceAttachment":{
"fixed_ips":[
{
"ip_address":"192.168.1.1",
"subnet_id":"f8a6e8f8-c2ec-497c-9f23-da9616de54ef"
}
],
"mac_addr":"fa:16:3e:4c:2c:30",
"net_id":"3cb9bc59-5699-4588-a4b1-b87f96708bc6",
"port_id":"ce531f90-199f-48c0-816c-13e38010b442",
"port_state":"ACTIVE"
}
}
Example 3.142. Create interface: XML response
<?xml version='1.0' encoding='UTF-8'?>
<interfaceAttachment>
<net_id>3cb9bc59-5699-4588-a4b1-b87f96708bc6</net_id>
<port_id>ce531f90-199f-48c0-816c-13e38010b442</port_id>
<fixed_ips>
<fixed_ip>
<subnet_id>f8a6e8f8-c2ec-497c-9f23-da9616de54ef</subnet_id>
<ip_address>192.168.1.3</ip_address>
</fixed_ip>
</fixed_ips>
<port_state>ACTIVE</port_state>
<mac_addr>fa:16:3e:4c:2c:30</mac_addr>
</interfaceAttachment>This operation does not return a response body.

