Add vCenter Resource Pool

To create a new vCenter resource pool, use the following request:

1
2
POST /vcenter/resource_pools.xml
POST /vcenter/resource_pools.json

XML Request Example

1
curl -i -X POST -H 'Accept: application/xml' -H 'Content-type: application/xml' -u user:userpass --url http://onapp.test/vcenter/resource_pools.xml -d '<vcenter_resource_pool><label>new_resource_pool_via_api</label><hypervisor_id>3</hypervisor_id></vcenter_resource_pool>'

JSON Request Example

1
curl -i -X POST http://onapp.test/vcenter/resource_pools.json -d '{"vcenter_resource_pool": {"label": "resource_pool_label", "hypervisor_id": 3}}' -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json'

XML Output Example

1
2
3
4
5
6
7
8
<vcenter_resource_pool>
  <id type="integer">43</id>
  <label>new_resource_pool_via_api</label>
  <identifier>yfbbqbriebulai</identifier>
  <cluster_id type="integer">4</cluster_id>
  <parent_id type="integer">17</parent_id>
  <user_id type="integer">1</user_id>
</vcenter_resource_pool>

Where:

id - the resource pool ID

label - the name of a new resource pool

identifier - the resource pool identifier

cluster_id - ID of the cluster the resource pool is based on

parent_id - ID of the default resource pool

user_id - user ID in Control Panel