Examples

POST /api/compute_resources
{
  "compute_resource": {
    "name": "libvirt_compute",
    "provider": "libvirt",
    "organization_ids": [
      114267492
    ],
    "location_ids": [
      447626471,
      447626472,
      447626473
    ],
    "url": "qemu+ssh://root@libvirt.example.com/system"
  }
}
201
{
  "description": null,
  "url": "qemu+ssh://root@libvirt.example.com/system",
  "created_at": "2019-02-20 13:25:44 UTC",
  "updated_at": "2019-02-20 13:25:44 UTC",
  "id": 980190966,
  "name": "libvirt_compute",
  "provider": "Libvirt",
  "provider_friendly_name": "Libvirt",
  "display_type": "vnc",
  "set_console_password": true,
  "images": [],
  "compute_attributes": [],
  "locations": [
    {
      "id": 447626471,
      "name": "loc146",
      "title": "loc146",
      "description": null
    },
    {
      "id": 447626472,
      "name": "loc147",
      "title": "loc147",
      "description": null
    },
    {
      "id": 447626473,
      "name": "loc148",
      "title": "loc148",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 114267492,
      "name": "Empty Organization",
      "title": "Empty Organization",
      "description": null
    }
  ]
}

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organizations

Validations:

  • Must be a Integer

compute_resource
required

Validations:

  • Must be a Hash

compute_resource[name]
required

Validations:

  • Must be a String

compute_resource[provider]
optional , nil allowed

Providers include Libvirt, Ovirt, EC2, Vmware, Openstack, Rackspace, GCE

Validations:

  • Must be a String

compute_resource[url]
optional , nil allowed

URL for Libvirt, oVirt, OpenStack and Rackspace

Validations:

  • Must be a String

compute_resource[description]
optional , nil allowed

Validations:

  • Must be a String

compute_resource[user]
optional , nil allowed

Username for oVirt, EC2, VMware, OpenStack. Access Key for EC2.

Validations:

  • Must be a String

compute_resource[password]
optional , nil allowed

Password for oVirt, EC2, VMware, OpenStack. Secret key for EC2

Validations:

  • Must be a String

compute_resource[uuid]
optional , nil allowed

Deprecated, please use datacenter

Validations:

  • Must be a String

compute_resource[datacenter]
optional , nil allowed

for oVirt, VMware Datacenter

Validations:

  • Must be a String

compute_resource[use_v4]
optional , nil allowed

for oVirt only

Validations:

  • Must be one of: true, false, 1, 0.

compute_resource[ovirt_quota]
optional , nil allowed

for oVirt only

Validations:

  • Must be a String

compute_resource[public_key]
optional , nil allowed

for oVirt only

Validations:

  • Must be a String

compute_resource[region]
optional , nil allowed

for EC2 only, use ‘us-gov-west-1’ for GovCloud region

Validations:

  • Must be a String

compute_resource[tenant]
optional , nil allowed

for OpenStack only

Validations:

  • Must be a String

compute_resource[domain]
optional , nil allowed

for OpenStack only

Validations:

  • Must be a String

compute_resource[server]
optional , nil allowed

for VMware

Validations:

  • Must be a String

compute_resource[set_console_password]
optional , nil allowed

for Libvirt and VMware only

Validations:

  • Must be one of: true, false, 1, 0.

compute_resource[display_type]
optional , nil allowed

for Libvirt only

Validations:

  • Must be one of: VNC, SPICE.

compute_resource[caching_enabled]
optional , nil allowed

enable caching, for VMware only

Validations:

  • Must be one of: true, false, 1, 0.

compute_resource[location_ids]
optional , nil allowed

REPLACE locations with given ids

Validations:

  • Must be an array of any type

compute_resource[organization_ids]
optional , nil allowed

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type