ServerMania logo

Add Network

To add a new network, use the following request:

POST /settings/networks.xml
POST /settings/networks.json

XML Request Example

curl -i -X POST -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<network><label>Network API test 34</label><network_group_id>15</network_group_id><vlan>34</vlan><type>Networking::Network</type></network>' --url http://test/settings/networks.xml

JSON Request Example

curl -i -X POST -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"network":{"label":"Network API TEST 2","network_group_id":3,"vlan":43,"type":"Networking::Network"}}' --url http://test/settings/networks.json

Where:

label* - the network name

vlan - the number of a VLAN this network belongs to

network_group_id - the ID of the network zone to which this network is attached

type - the type of the network, set Networking::Network for this parameter. This API request creates a shared network - the default type of network in where a user receives an IP address on the network they have access to


Page History

v. 5.4

  • added type parameter