ServerMania logo

Add Network Interface to VS

To add a new network interface, use the following request:

POST /virtual_machines/:virtual_machine_id/network_interfaces.xml
POST /virtual_machines/:virtual_machine_id/network_interfaces.json

XML Request Example

curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<network_interface><label>qwert</label><rate_limit>64</rate_limit><network_join_id>3</network_join_id><primary>1</primary></network_interface>' --url http://test/virtual_machines/518/network_interfaces.xml

JSON Request Example

curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"network_interface":{"label":"qwert","rate_limit":"64","network_join_id":"3", "primary":"1"}}' --url http://test/virtual_machines/518/network_interfaces.json


Where:

label* - give the label of a network interface you wish to attach

rate_limit* - set the port speed of a network interface you wish to attach

network_join_id* - set the ID of a physical network used to attach this network interface

primary* - set 1 if the interface is primary. Otherwise false.

After adding the network interface, the virtual server should be power cycled for the change to take effect.