VMware Cloud Community
amurty
Enthusiast
Enthusiast

Hyperic RESTFul services - How to?

I am trying to write a simple Perl script that uses the Hyperic RESTFul api.
___________________________________________
Example -
hitting this URL -
https://<server-hostname>:<port>/hqu/hqapi1/group/get.hqu?name=<group-name>;

gives you a xml response that has a list of all the elements in that 'group-name' -
<GroupResponse>
<Status>Success</Status>
<Group id="99999" resourceId="22222" name="XYZ" description="" location="">
<Resource id="88888" name="ABC"/>
<Resource id="77777" name="EFG"/>
<Role id="55555" name="AdminX"/>
<Role id="11111" name="UserX"/>
</Group>
</GroupResponse>
___________________________________________

Now, if you look at the URL, it has elements from the HQApi 'group' command list as shown on this page - http://support.hyperic.com/display/DOC/HQApi+3.2+group+command

My Question -
What is the format of the URL that is used in RESTFul api calls?
OR
How to formulate RESTFul api-call URL from the commands listed in the 'Web Services API ' documentation here - http://support.hyperic.com/display/DOC/HQApi+maintenance+command

Example - What URL should i used to list all servers of type 'Linux'

The only available documentation for RESTFul api is a Perl script on this page - http://support.hyperic.com/display/DOC/HQApi+maintenance+command

So, Help!!

Message was edited by: ajt2010

Message was edited by: ajt2010
3 Replies
amurty
Enthusiast
Enthusiast

anyone ?
a link to some decent documentation will work as well.
0 Kudos
jerrypearson
Contributor
Contributor

The "HQApi WebService Documentation" is part of the installed utility and contained in the file: HQApi1.wadl

vFabric Hyperic 4.6
http://pubs.vmware.com/vfabric5/index.jsp?topic=/com.vmware.vfabric.hyperic.4.6/vFabric_Hyperic_Web_...

Construct a URL which looks like this:

http://:7080/hqu/hqapi1/resource/find.hqu?prototype=Linux&children=true

From the
<wadl:resources base="http://localhost:8080/hqu/hqapi1/">

<wadl:resource path="resource/find.hqu">

<wadl:param name="prototype" style="query" required="false"
type="xs:string">
<wadl:doc>
Find Resources of the given ResourcePrototype
</wadl:doc>
</wadl:param>

<wadl:param name="children" style="query" required="false"
type="xs:boolean" default="false">
<wadl:doc>
If set to true, return child Resources of the
returned Resource.
</wadl:doc>
</wadl:param>

This is the equivalent of the command line:

hqapi.sh resource list --prototype=Linux --children

(hqapi.sh resource list --prototype=Linux --children=true)

HQApi Command-Line Tools

http://pubs.vmware.com/vfabric5/index.jsp?topic=/com.vmware.vfabric.hyperic.4.6/vFabric_Hyperic_Web_...
admin
Immortal
Immortal

I actually wouldn't recommend using the wadl files as a reference. They are a bit outdated and may be removed in the future (this is yet to be determined). The XSD files are a better reference.

Documenting the REST api is on the todo list.
0 Kudos