Home > Cloud Cruiser 3 > REST API reference > Resources > Get all resources

Get all resources

Retrieves summaries of all (or a specified count of) resource groups and their containing resources stored in your Cloud Cruiser system.

URL syntax

http://<ccServerURL
>/rest/v1/resources

HTTP method

GET

Request

URL query parameters (optional)
?startFrom=<x
>&count=<y
>

Default: startFrom=1&count=-1

Request body

None

Response

Content-Type
application/xml
Response body

XML text with root element resources and the following XML schema:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns1="http://www.cloudcruiser.com/webservices/v1/Common"
xmlns:tns="http://www.cloudcruiser.com/webservices/v1/Resource" targetNamespace="http://www.cloudcruiser.com/webservices/v1/Resource">
<xs:element name="resources">
  <xs:complexType>
    <xs:sequence>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="group" type="tns:ResourceGroup"/>
    </xs:sequence>
    <xs:attribute name="totalGroups" type="xs:int"/>
    <xs:attribute name="retrievedGroups" type="xs:int"/>
    <xs:attribute name="startFrom" type="xs:int"/>
  </xs:complexType>
</xs:element>
<xs:complexType name="ResourceGroup">
  <xs:sequence>
    <xs:element name="name" type="xs:string"/>
    <xs:element maxOccurs="unbounded" minOccurs="0" name="resource" type="tns:ResourceSummary"/>
  </xs:sequence>
  <xs:attribute name="id" type="xs:int"/>
  <xs:attribute name="totalResources" type="xs:int"/>
  <xs:attribute name="retrievedResources" type="xs:int"/>
  <xs:attribute name="startFrom" type="xs:int"/>
</xs:complexType>
<xs:complexType name="ResourceSummary">
  <xs:sequence>
    <xs:element name="name" type="xs:string"/>
    <xs:element minOccurs="0" name="description" type="xs:string"/>
    <xs:element name="active" type="xs:boolean"/>
    <xs:element name="hidden" type="xs:boolean"/>
    <xs:element name="resourceType" type="resourceType"/>
  </xs:sequence>
  <xs:attribute name="id" type="xs:int"/>
</xs:complexType>
<xs:simpleType name="resourceType">
  <xs:restriction base="xs:string">
    <xs:enumeration value="STANDARD"/>
    <xs:enumeration value="BUNDLED"/>
    <xs:enumeration value="DISCOUNT_SURCHARGE"/>
    <xs:enumeration value="PASSTHROUGH"/>
  </xs:restriction>
</xs:simpleType>
</xs:schema>

JAXB type

com.cloudcruiser.server.webservices.v1.dto.resource.Resources

Example

URL
localhost:8080/rest/v1/resources?startFrom=3&count=2
Response body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resources xmlns="http://www.cloudcruiser.com/webservices/v1/Resource" totalGroups="20" retrievedGroups="2" startFrom="3">
  <group id="1" totalResources="30">
    <name>VMware vCenter</name>
    <resource id="10011">
      <name>vcenter.cpu.used</name>
      <description>CPU Used</description>
      <active>true</active>
      <hidden>false</hidden>
      <resourceType>STANDARD</resourceType>
    </resource>
    ...
  </group>
  <group id="26" totalResources="6">
    <name>Application Services</name>
    <resource id="10123">
      <name>service.Application.Basic.Windows</name>
      <description>Windows 2012 Server, 1 CPU, 1 GB RAM, 40 GB HD</description>
      <active>true</active>
      <hidden>false</hidden>
      <resourceType>STANDARD</resourceType>
    </resource>
    ...
  </group>
</resources>
Java
import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
import com.cloudcruiser.server.webservices.v1.dto.resource.Resources;
import com.cloudcruiser.server.webservices.v1.services.IResourceWebService;
IResourceWebService resourceProxy = JAXRSClientFactory.create(baseUri, IResourceWebService.class);
Resources resources = resourceServiceProxy.getAllResources();
Last modified

Tags

This page has no custom tags.

Classifications

This page has no classifications.
© Copyright 2018 Hewlett Packard Enterprise Development LP