Chapter 3. REST API Quick Start Example
- 3.1. REST API Quick Start Introduction
- 3.2. Example: Access API Entry Point
- 3.3. Example: List Data Center Collection
- 3.4. Example: List Host Cluster Collection
- 3.5. Example: List Logical Networks Collection
- 3.6. Example: List Host Collection
- 3.7. Example: Approve Host
- 3.8. Example: Create NFS Data Storage
- 3.9. Example: Create NFS ISO Storage
- 3.10. Example: Attach Storage Domains to Data Center
- 3.11. Example: Activate Storage Domains
- 3.12. Example: Create Virtual Machine
- 3.13. Example: Create Virtual Machine NIC
- 3.14. Example: Create Virtual Machine Storage Disk
- 3.15. Example: Attach ISO Image to Virtual Machine
- 3.16. Example: Start Virtual Machine
- 3.17. Example: Check System Events
3.1. REST API Quick Start Introduction
This chapter provides an example to demonstrate the REST API's ability to setup a basic Red Hat Enterprise Virtualization environment and create a virtual machine.
In addition to the standard prerequisites, this example requires the following:
- A networked and configured host containing Red Hat Enterprise Virtualization Hypervisor;
- An ISO file containing a desired virtual machine operating system to install. This chapter uses Red Hat Enterprise Linux Server 6 for our installation ISO example; and
- Red Hat Enterprise Virtualization's engine-iso-uploader tool to upload your chosen operating system ISO file.
This example uses cURL to demonstrate REST requests with a client application. Note that any application capable of HTTP requests can substitute for cURL.
Important
For simplicity, the HTTP request headers in this example omit the
Host: and Authorization: fields. However, these fields are mandatory and require data specific to your installation of Red Hat Enterprise Virtualization Manager.
Important
All cURL examples include placeholders for authentication details (
USER:PASS) and certificate location (CERT). Ensure all requests performed with cURL fulfill certification and authentication requirements.
Note
Red Hat Enterprise Virtualization Manager generates a globally unique identifier (GUID) for the
id attribute for each resource. Identifier codes in this example might appear different to the identifier codes in your Red Hat Enterprise Virtualization environment.