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 > Budgets and alerts > Get budgets for a customer

Get budgets for a customer

Retrieves customer budgets for a customer specified by account ID.

Resource URL

GET http://<ccServerURL>/rest/v1/budgets/budget/accountId/<accountId>

Request

Parameters
  Name Type Description
URL path parameters (required) accountId string The customer account for which to retrieve budgets
URL query parameters (optional) budgetType string

Valid values are COST, RESOURCE, and ALL. Default is ALL.

The RESOURCE type is reserved for use by future releases and is not used in the current release. Specify either COST or ALL for this parameter.

accountingYear number The accounting year for which to retrieve budgets. Default is the current accounting year.
resourceid string This parameter is reserved for use by future releases and is not used in the current release. Do not include it in your request.
Body

None

Response

Content-Type

application/xml

Body

One or more budgets, as XML text with the root element budgets or JAXB type com.cloudcruiser.server.webservices.v1.dto.budgets.Budgets.​

Schema

​This XML schema describes a list of customer budgets.

<xs:complexType name="Budgets">
  <xs:sequence>
    <xs:element maxOccurs="unbounded" minOccurs="0" ref="tns:customerBudget"/>
  </xs:sequence>
  <xs:attribute name="count" type="xs:int"/>
</xs:complexType>

<xs:element name="customerBudget" type="tns:CustomerBudget"/>

<xs:complexType name="CustomerBudget">
  <xs:sequence>
    <xs:element name="customer" type="tns:Customer"/>
    <xs:element minOccurs="0" name="resource" type="tns:Resource"/>
    <xs:element name="accountingYear" type="xs:short"/>
    <xs:element name="currencyCode" type="xs:string"/>
    <xs:element name="description" type="xs:string"/>
    <xs:element name="standardAlertsEnabled" type="xs:boolean"/>
    <xs:element name="projectedAlertsEnabled" type="xs:boolean"/>
    <xs:element name="useDefaultThresholds" type="xs:boolean"/>
    <xs:element minOccurs="0" name="threshold1Percent" type="xs:short"/>
    <xs:element minOccurs="0" name="threshold2Percent" type="xs:short"/>
    <xs:element minOccurs="0" name="threshold3Percent" type="xs:short"/>
    <xs:element name="costPeriods" type="tns:BudgetPeriods"/>
    <xs:element minOccurs="0" name="unitsPeriods" type="tns:BudgetPeriods"/>
  </xs:sequence>
  <xs:attribute name="budgetId" type="xs:int"/>
  <xs:attribute name="budgetType" type="tns:BudgetAlertType" use="required"/>
</xs:complexType>

<xs:simpleType name="BudgetAlertType">
  <xs:restriction base="xs:string">
    <xs:enumeration value="COST"/>
    <xs:enumeration value="RESOURCE"/>
    <xs:enumeration value="ALL"/>
  </xs:restriction>
</xs:simpleType>

<xs:complexType name="Customer">
  <xs:attribute name="id" type="xs:int"/>
  <xs:attribute name="accountId" type="xs:string"/>
  <xs:attribute name="accountingDay" type="xs:short"/>
</xs:complexType>

<xs:complexType name="Resource">
  <xs:attribute name="headerId" type="xs:int"/>
  <xs:attribute name="resourceid" type="xs:string" use="required"/>
</xs:complexType>

Example

URL invocation

GET http://localhost:8080/rest/v1/budgets/budget/accountId/B-AA

Java invocation

Budgets custBudgets = budgetsServiceProxy.getCustomerBudgets(“B-AA”);

Response body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<budgets xmlns="http://www.cloudcruiser.com/webservices/v1/Budget" count="1">
  <customerBudget budgetId="5010" budgetType="COST">
    <customer id="7" accountId="B-AA" accountingDay="1"/>
    <accountingYear>2013</accountingYear>
    <currencyCode>usd</currencyCode>
    <standardAlertsEnabled>true</standardAlertsEnabled>
    <projectedAlertsEnabled>true</projectedAlertsEnabled>
    <useDefaultThresholds>true</useDefaultThresholds>
    <threshold1Percent>80</threshold1Percent>
    <threshold2Percent>100</threshold2Percent>
    <threshold3Percent>120</threshold3Percent>
    <costPeriods>
      <period accountingPeriod="1" budgetValue="40000.0"/>
      <period accountingPeriod="2" budgetValue="40000.0"/>
      <period accountingPeriod="3" budgetValue="40000.0"/>
      <period accountingPeriod="4" budgetValue="40000.0"/>
      <period accountingPeriod="5" budgetValue="40000.0"/>
      <period accountingPeriod="6" budgetValue="40000.0"/>
      <period accountingPeriod="7" budgetValue="40000.0"/>
      <period accountingPeriod="8" budgetValue="40000.0"/>
      <period accountingPeriod="9" budgetValue="40000.0"/>
      <period accountingPeriod="10" budgetValue="40000.0"/>
      <period accountingPeriod="11" budgetValue="40000.0"/>
      <period accountingPeriod="12" budgetValue="40000.0"/>
    </costPeriods>
  </customerBudget>
</budgets>
Last modified

Tags

Classifications

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