Page tree
Skip to end of metadata
Go to start of metadata

Cloud Warehouse RESTful service provides access to entities and resources. The resource represents a cloud service which we are monitoring in cloud warehouse and entity represents an event, alert, node, storage, system resource, and so on, which is related to a particular resource.

 

The RESTful service provides following methods for 3rd party clients:

 

Retrieving an XML or JSON containing a single entity

Retrieving an XML or JSON containing a list of entities

Retrieving an XML or JSON containing a single resource which is representing a cloud service

Retrieving an XML or JSON containing a list of resource which is representing a list of available cloud services


Simple Example How to Connect to REST API

The following URI corresponds to a cloud warehouse instance:

http://localhost:8080/rest/api/cloud/warehouse/entity


Protocol – HTTP://

We are running RESTful service on the HTTP protocol. This is the most commonly used protocol used with RESTful services.

Host – localhost:8080

Running cloud warehouse instance.

Service URI - /rest/api/cloud/warehouse/entity

Retrieves an XML or JSON containing a list of entities

 

In following sample you can find easy way how to test RESTful service for a cloud warehouse instance.

Example of a RESTful client in Java
String uri = "http://localhost:8080/rest/api/cloud/warehouse/entity/1/1";
URL url = new URL(uri);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setRequestProperty("Accept", "application/xml");
             
JAXBContext jc = JAXBContext.newInstance(Entity.class);
InputStream xml = connection.getInputStream();
Entity entity = (Entity) jc.createUnmarshaller().unmarshal(xml);
             
connection.disconnect();
  • No labels