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 4 > REST API reference > Discounts and surcharges > Get discounts

Get discounts

Retrieves detailed information for discounts and surcharges. If you specify no query parameters, all discounts and surcharges are retrieved.

This method is available in HPE Consumption Analytics Portal version 4.1 and later.

Resource URL

GET http://<ccServerURL>/rest/v2/discounts

Request

Parameters

Use the following parameters:

  Name Type Description
URL query parameters (optional) discountName string The name of the discount or surcharge to retrieve.
type string The type of discounts or surcharges to retrieve. Valid values are discount or surcharge.
unitsType string The type of units used for the discounts and surcharges to retrieve. Valid values are percentage and fixed.
allServices boolean Specify whether to retrieve discounts and surcharges that apply to all services (true) or specific services (false).
Body

None

Response

Content-Type

application/xml

Body

Details for discounts and surcharges, as XML text with the root element discount or JAXB type com.cloudcruiser.server.webservices.v2.dto.discount.Discount.

Schema

This XML schema describes a discount or surcharge.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://www.cloudcruiser.com/webservices/v2/Common" xmlns:tns="http://www.cloudcruiser.com/webservices/v2/Discount"attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.cloudcruiser.com/webservices/v2/Discount">
  <xs:import/>
  <xs:import namespace="http://www.cloudcruiser.com/webservices/v2/Common"/>
  <xs:element name="discount" type="tns:Discount"/>
  <xs:element name="discountList">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" minOccurs="0" ref="tns:discount"/>
      </xs:sequence>
      <xs:attribute name="totalCount" type="xs:int"/>
      <xs:attribute name="retrievedCount" type="xs:int"/>
    </xs:complexType>
  </xs:element>
  <xs:complexType name="Discount">
    <xs:sequence>
      <xs:element name="name" type="xs:string"/>
      <xs:element minOccurs="0" name="description" type="xs:string"/>
      <xs:element default="DISCOUNT" name="type" type="xs:string"/>
      <xs:element default="PERCENTAGE" name="unitsType" type="xs:string"/>
      <xs:element name="value" type="xs:double"/>
      <xs:element default="true" name="allServices" type="xs:boolean"/>
      <xs:element minOccurs="0" name="appliedServices">
        <xs:complexType>
          <xs:sequence>
            <xs:element maxOccurs="unbounded" minOccurs="0" name="service" type="ns1:Service"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="id" type="xs:int"/>
  </xs:complexType>
</xs:schema>

Example

URL invocation

GET http://localhost:8080/rest/v2/discounts​​?type=discount

Java invocation
Response body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<discountList xmlns="http://www.cloudcruiser.com/webservices/v2/Discount" totalCount="2" retrievedCount="2">
    <discount id="10000">
        <name>New_Account_Discount</name>
        <description>A 5% discount for new accounts</description>
        <type>DISCOUNT</type>
        <unitsType>PERCENTAGE</unitsType>
        <value>5.0</value>
        <allServices>true</allServices>
    </discount>
    <discount id="10001">
        <name>Extended_Discount</name>
        <description>A 7% discount for all services</description>
        <type>DISCOUNT</type>
        <unitsType>PERCENTAGE</unitsType>
        <value>7.0</value>
        <allServices>true</allServices>
    </discount>
</discountList>
Last modified

Tags

This page has no custom tags.

Classifications

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