示例

POST /api/compute_resources
{
  "compute_resource": {
    "name": "Ovirt-create-test",
    "url": "https://myovirt/api",
    "provider": "ovirt",
    "datacenter": "8c30ea90-9bc8-4a90-867b-1a8ccdef44e8",
    "user": "user@example.com",
    "password": "secret"
  }
}
201
{
  "description": null,
  "url": "https://myovirt/api",
  "created_at": "2019-09-11 14:37:28 UTC",
  "updated_at": "2019-09-11 14:37:28 UTC",
  "id": 980190963,
  "name": "Ovirt-create-test",
  "provider": "Ovirt",
  "provider_friendly_name": "oVirt",
  "user": "user@example.com",
  "datacenter": "8c30ea90-9bc8-4a90-867b-1a8ccdef44e8",
  "use_v4": false,
  "ovirt_quota": null,
  "display_type": "vnc",
  "keyboard_layout": "en-us",
  "images": [],
  "compute_attributes": [],
  "locations": [],
  "organizations": []
}

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

compute_resource
必填

Validations:

  • Must be a Hash

compute_resource[name]
必填

Validations:

  • Must be a String

compute_resource[provider]
选填 , 允许空值

提供者包括 Libvirt, Ovirt, EC2, Vmware, Openstack, Rackspace, GCE

Validations:

  • Must be a String

compute_resource[url]
选填 , 允许空值

Libvirt、oVirt、OpenStack 和 Rackspace 的 URL

Validations:

  • Must be a String

compute_resource[description]
选填 , 允许空值

Validations:

  • Must be a String

compute_resource[user]
选填 , 允许空值

oVirt、EC2、VMware、OpenStack 的用户名。EC2 的访问密钥。

Validations:

  • Must be a String

compute_resource[password]
选填 , 允许空值

oVirt、EC2、VMware、OpenStack 的密码。EC2 的访问密钥。

Validations:

  • Must be a String

compute_resource[uuid]
选填 , 允许空值

已弃用,请使用 datacenter

Validations:

  • Must be a String

compute_resource[datacenter]
选填 , 允许空值

用于 oVirt、VMware 数据库

Validations:

  • Must be a String

compute_resource[use_v4]
选填 , 允许空值

只用于 oVirt

Validations:

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

compute_resource[ovirt_quota]
选填 , 允许空值

for oVirt only, ID of quota to use

Validations:

  • Must be a String

compute_resource[public_key]
选填 , 允许空值

只用于 oVirt

Validations:

  • Must be a String

compute_resource[region]
选填 , 允许空值

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

Validations:

  • Must be a String

compute_resource[tenant]
选填 , 允许空值

仅用于 OpenStack

Validations:

  • Must be a String

compute_resource[domain]
选填 , 允许空值

for OpenStack (v3) only

Validations:

  • Must be a String

compute_resource[project_domain_name]
选填 , 允许空值

for OpenStack (v3) only

Validations:

  • Must be a String

compute_resource[project_domain_id]
选填 , 允许空值

for OpenStack (v3) only

Validations:

  • Must be a String

compute_resource[server]
选填 , 允许空值

用于 VMware

Validations:

  • Must be a String

compute_resource[set_console_password]
选填 , 允许空值

仅用于 Libvirt 和 VMware

Validations:

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

compute_resource[display_type]
选填 , 允许空值

for Libvirt and oVirt only

Validations:

  • Must be one of: VNC, SPICE.

compute_resource[keyboard]
选填 , 允许空值

只用于 oVirt

Validations:

  • Must be one of: ar, de-ch, es, fo, fr-ca, hu, ja, mk, no, pt-br, sv, da, en-gb, et, fr, fr-ch, is, lt, nl, pl, ru, th, de, en-us, fi, fr-be, hr, it, lv, nl-be, pt, sl, tr.

compute_resource[caching_enabled]
选填 , 允许空值

启用缓存,仅适用于 VMware

Validations:

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

compute_resource[project]
选填 , 允许空值

Project id for GCE only

Validations:

  • Must be a String

compute_resource[email]
选填 , 允许空值

Email for GCE only

Validations:

  • Must be a String

compute_resource[key_path]
选填 , 允许空值

Certificate path for GCE only

Validations:

  • Must be a String

compute_resource[zone]
选填 , 允许空值

for GCE only

Validations:

  • Must be a String

compute_resource[location_ids]
选填 , 允许空值

使用给定 id 替换位置

Validations:

  • Must be an array of any type

compute_resource[organization_ids]
选填 , 允许空值

使用给定 id 替换机构

Validations:

  • Must be an array of any type