Home > Cloud Cruiser 3 > REST API reference > Resources > Get a resource by ID

Get a resource by ID

Retrieves detailed resource information by the resource’s headerId .

URL syntax

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

HTTP method

GET

Request

URL path parameters (required)

headerId (type: int)

Request body

None

Response

Content-Type
application/xml
Response body

XML text with root element resourceInfo 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="resourceInfo" type="tns:ResourceInfo"/>
  <xs:complexType name="ResourceInfo">
    <xs:sequence>
      <xs:element name="name" type="xs:string"/>
      <xs:element name="group">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="name" type="xs:string"/>
          </xs:sequence>
          <xs:attribute name="id" type="xs:int"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="active" type="xs:boolean"/>
      <xs:element name="hidden" type="xs:boolean"/>
      <xs:element name="allocated" type="xs:boolean"/>
      <xs:element default="STANDARD" name="resourceType" type="resourceType"/>
      <xs:element default="PRICE" name="rateType" type="rateType"/>
      <xs:element minOccurs="0" name="comments" type="xs:string"/>
      <xs:element default="4" name="unitsDecimals" type="xs:short"/>
      <xs:element default="4" name="rateDecimals" type="xs:short"/>
      <xs:element minOccurs="0" name="alternativeCode" type="xs:string"/>
      <xs:element default="INTEGER" name="numericType" type="numericType"/>
      <xs:element minOccurs="0" name="unitDesc" type="xs:string"/>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="ratePlan" type="tns:RatePlan"/>
    </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:simpleType name="rateType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="COGS"/>
      <xs:enumeration value="PRICE"/>
    </xs:restriction>
  </xs:simpleType>
 
  <xs:simpleType name="numericType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="INTEGER"/>
      <xs:enumeration value="FRAC"/>
    </xs:restriction>
  </xs:simpleType>
 
  <xs:complexType name="RatePlan">
    <xs:sequence>
      <xs:element name="name" type="xs:string"/>
      <xs:element name="description" type="xs:string"/>
      <xs:element maxOccurs="unbounded" minOccurs="0" ref="tns:revision"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:int"/>
  </xs:complexType>
</xs:schema>

JAXB type

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

Example

URL
http://localhost:8080/rest/v1/resource/resource/10011
Response body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<resourceInfo xmlns="http://www.cloudcruiser.com/webservices/v1/Resource" id="10011">
  <name>vcenter.cpu.used</name>
  <group id="1">
    <name>VMware vCenter</name>
  </group>
  <active>true</active>
  <hidden>false</hidden>
  <allocated>false</allocated>
  <resourceType>STANDARD</resourceType>
  <rateType>PRICE</rateType>
  <unitsDecimals>0</unitsDecimals>
  <rateDecimals>4</rateDecimals>
  <numericType>INTEGER</numericType>
  <unitDesc>ms</unitDesc>
  <ratePlan id="1">
    <name>default</name>
    <description>CPU Used</description>
    <revision id="10015">
      <ratePlanName>default</ratePlanName>
      <startDate year="2000" month="1" day="1"/>
      <endDate year="2999" month="12" day="31"/>
      <detailType>BASIC</detailType>
      <detail id="10015">
        <rate id="10015" currencyCode="usd">
          <variableCharge>1.0E-4</variableCharge>
        </rate>
      </detail>
    </revision>
  </ratePlan>
</resourceInfo>
Java
ResourceInfo resourceInfo = resourceServiceProxy.getResourceById(10011);
Last modified

Tags

This page has no custom tags.

Classifications

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