-
Notifications
You must be signed in to change notification settings - Fork 6
Using_the_RHEV M_API
The RHEV-M API exposes several features useful to those configuring Aeolus. This guide is meant as a quick walkthrough.
The REST API can be accessed via a web browser, or using command-line tools like curl. When prompted for credentials, the user field is in the format of ‘username@rhevm_domain’.
aeolus-configure requires a RHEV data center UUID for configuration. You can access this at /api/datacenters. Here is an example of the XML returned:
<data_centers>
<data_center id="4c96c74b-f8b6-4c8f-aa84-a55770839b85" href="/api/datacenters/4c96c74b-f8b6-4c8f-aa84-a55770839b85">
<name>blade27</name>
<description/>
</data_center>
</data_centers>
In this example, the data center named “blade27” has a UUID of “4c96c74b-f8b6-4c8f-aa84-a55770839b85”. Search is supported, as shown in the second example below.
Here are a few sample queries:
- Accessing a list of all data centers:
curl https://rhevm.example.com:8443/api/datacenters --user user
rhevm_domain:password@\ - Searching data centers for a name matching raleigh
curl https://rhevm.example.com:8443/api/datacenters?search=name%3Draleigh --user user
rhevm_domain:password@
Importing an image from RHEV, using either the aeolus-image command-line tool or with the Conductor web UI, requires knowing the image’s template UUID. Unfortunately, this information is not currently presented in the RHEVM GUI, but it can be easily obtained via the REST API by accessing /api/templates. Here is an example of the returned XML:
<templates>
<template id="05618eb5-23e2-4d62-97c5-1d97fc9ab2d5" href="/api/templates/05618eb5-23e2-4d62-97c5-1d97fc9ab2d5">
<name>rhel_6.2</name>
</template>
</templates>
Search is also supported, as shown in the example below.
- Retrieving a template list:
curl https://rhevm.example.com:8443/api/templates --user user
rhevm_domain:password@ - Search for “rhel_6.2” in the template list:
curl https://rhevm.example.com:8443/api/templates?search=name%3Drhel_6.2 --user user
rhevm_domain:password@
Instances on RHEV follow the same pattern, but are accessed at /api/vms.