Here is a lab I put together for a recent event, it was well received and I think it is very valuable to the ManageIQ and CloudForms user bases.
In the lab you will GET and POST RESTapi actions. Its a basic look at some common use cases such as,
- Query a VM’s hardware inventory.
- Query the VMS for any who are tagged with “Function/Database”
- Show the tags on a specific VM
- Create new Category and Tag in the appliance
- Assign a Category/Tag to a VM
- Provision a VM
- Query the status of the Provision request.
The lab expects you to have an appliance provisioned and connected to a provider (the lab uses AMAZON EC2) Therefore when querying attributes of a vm/instance the return list is specific to the provider. CPU’s are not available on AWS EC2, whereas availability zones are.
Note : Cut and Pasting the code from the slides can introduce ASCII translation errors depending on platform. Take care to ensure quotes are “.
I will do another post in the future to cover off “PUT, PATCH and DELETE” actions.
The slides are here in PDF format – https://www.dropbox.com/s/14vwhd1fcb97prg/RESTapi.pdf?dl=0