Cloud Cruiser became HPE Consumption Analytics on Nov. 1st. You'll still see the old name in places while we update this site.

 

 

Consumption Analytics Documentation

Home > Cloud Cruiser 3 > REST API reference > Projecting charges

Projecting charges

Calculates the projected charges for a set of resources based on the name and quantity of each resource, start date, duration (DAILY, HOURLY or MONTHLY), and optionally other information such as account ID or rate plan.

URL syntax
http://<ccServerURL
>/rest/v1/charge/projection
HTTP method

POST

Request
Content-Type
application/xml
Request body

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

<xs:element name="chargeProjectionInput" xmlns:tns="http://www.cloudcruiser.com/webservices/v1/Charge">
  <xs:complexType>
    <xs:sequence>
      <!-- acctId should have the same length as the default structure required -->
      <xs:element minOccurs="0" name="accountId" type="xs:string"/>
      <xs:element minOccurs="0" name="tierCode" type="xs:short"/>
      <xs:element minOccurs="0" name="shiftCode" type="xs:short"/>
      <xs:element minOccurs="0" name="stateName" type="xs:string"/>
      <xs:element minOccurs="0" name="ratePlan" type="xs:string"/>
      <xs:element name="startDate" type="ns1:StartOfDay"/>
      <xs:element name="duration" type="tns:DurationType"/>
      <xs:element maxOccurs="unbounded" name="resourceUsage" type="tns:ResourceUsage"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>
 
<xs:complexType name="ResourceUsage">
  <xs:sequence/>
  <xs:attribute name="resourceName" type="xs:string" use="required"/>
  <xs:attribute name="quantity" type="xs:double"/>
</xs:complexType>
 
<xs:simpleType name="DurationType">
  <xs:restriction base="xs:string">
    <xs:enumeration value="DAILY"/>
    <xs:enumeration value="HOURLY"/>
    <xs:enumeration value="MONTHLY"/>
  </xs:restriction>
</xs:simpleType>
JAXB type
com.cloudcruiser.server.webservices.v1.dto.charge.ChargeProjectionInput
Response
Content-Type
application/xml
Response body

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

<chargeProjection xmlns:tns="http://www.cloudcruiser.com/webservices/v1/Charge">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="currencyCode" type="xs:string"/>
      <xs:element name="totalCharge" type="xs:double"/>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="resourceCharge" type="tns:ResourceCharge"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>
 
<xs:complexType name="ResourceCharge">
  <xs:sequence>
    <xs:element name="resourceName" type="xs:string"/>
    <xs:element minOccurs="0" name="variableCharge" type="xs:double"/>
    <xs:element minOccurs="0" name="fixedCharge" type="xs:double"/>
    <xs:element name="totalCharge" type="xs:double"/>
  </xs:sequence>
</xs:complexType>
JAXB type
com.cloudcruiser.server.webservices.v1.dto.charge.ChargeProjection
WADL document

For the request and response XML schema and API description, use
http://< ccServerURL >/rest/v1/charge?_wadl

Example
URL
http://localhost:8080/rest/v1/charge/projection
Request body
<?xml version="1.0" encoding="UTF-8"?>
<chargeProjectionInput xmlns="http://www.cloudcruiser.com/webservices/v1/Charge">
  <accountId>L-AA-KKKk-11-vm000</accountId>
  <stateName>ONLINE</stateName>
  <ratePlan>default</ratePlan>
  <startDate year="2013" month="5" day="1"/>
  <duration>DAILY</duration>
  <resourceUsage resourceName="test-res-1" quantity="2.0"/>
  <resourceUsage resourceName="test-6#" quantity="10.0"/>
  <resourceUsage resourceName="myTest-1" quantity="1000.0"/>
</chargeProjectionInput>
Response body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<chargeProjection xmlns="http://www.cloudcruiser.com/webservices/v1/Charge">
  <currencyCode>usd</currencyCode>
  <totalCharge>55.77</totalCharge>
  <resourceCharge>
    <resourceName>test-res-1</resourceName>
    <variableCharge>0.15</variableCharge>
    <fixedCharge>0.03</fixedCharge>
    <totalCharge>0.18</totalCharge>
  </resourceCharge>
  <resourceCharge>
    <resourceName>test-6#</resourceName>
    <variableCharge>32.0</variableCharge>
    <fixedCharge>0.16</fixedCharge>
    <totalCharge>32.16</totalCharge>
  </resourceCharge>
  <resourceCharge>
    <resourceName>myTest-1</resourceName>
    <variableCharge>2.62</variableCharge>
    <fixedCharge>20.81</fixedCharge>
    <totalCharge>23.43</totalCharge>
  </resourceCharge>
</chargeProjection>
Last modified

Tags

This page has no custom tags.

Classifications

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