如何使用RED HAT CLOUDFORMS REST API 简述

181 阅读1分钟

点击打开链接 access.redhat.com/documentati…

\

Provision RequestPOST/api/provision_requests 
Provision RequestsPOST/api/provision_requests

\

举例说明,结合使用文档简述:

POST=> cfme.ose.org/api/provisi…

      
POST  clone_vm_restapi                
    
    
https://cfme.ose.org/api/provision_requests
          
        
HEADERS
                  
X-Auth-Token      /  61564cce0a16cd53b9243826dae44a5e
Content-Type     /   application/x-www-form-urlencoded
Authorization    /   Basic YWRtaW46c21hcnR2bQ==          
      
              
BODY

\

   {"version": "1.1",
    "template_fields": {
        "guid": "8bba4394-e05f-11e6-8900-0050568176b3",
        "request_type": "template"
    }, 
    "vm_fields": { --哪此字段放在这里,文档都有说明,并且字段类型,默认值都有说明
        "sysprep_server_license_mode": "perServer",
        "sysprep_identification": "domain",
        "sysprep_per_server_max_connections": "5",
        "sysprep_workgroup_name": "WORKGROUP",
        "addr_mode": "dhcp",
        "sysprep_change_sid": true,
        "sysprep_auto_logon": true,
        "sysprep_enabled": "disabled",
        "sysprep_auto_logon_count": 1,
        "placement_auto": true,
        "number_of_vms": 1,
        "vm_name": "01test-shl-lei",
        "provision_type": "vmware",
        "vm_auto_start": true,
        "retirement": 0,
        "retirement_warn": 604800,
        "vlan": "VM Network",
        "disk_format": "thin",
        "cpu_limit": -1,
        "memory_limit": -1,
        "number_of_sockets": 1,
        "cores_per_socket": 1,
        "cpu_reserve": 0,
        "vm_memory": "2048",
        "memory_reserve": 0,
        "network_adapters": 1,
        "schedule_type": "immediately"
    }, 
    "requester": {
        "owner_first_name": "d",
        "owner_last_name": "b",
        "owner_email": "db@test.com",
        "auto_approve": true,
        "placement_auto": false
    },
    "tags": {},
    "additional_values": {
    	"placement_dc_name": 200000000000012,
        "placement_cluster_name": 200000000000001,
        "placement_rp_name": 200000000000001,
        "placement_folder_name": 200000000000010,
        "placement_host_name": 200000000000004,
        "placement_ds_name": 200000000000019
    },
    "ems_custom_attributes": null,
    "miq_custom_attributes": null
}



\

\