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 > Rate plans > Create a date range for a rate plan

Create a date range for a rate plan

Creates a new effective date range (revision) for a rate plan.

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

Resource URL

POST http://<ccServerURL>/rest/v2/ratePlans/<planId>/revisions

Request

Parameters
  Name Type Description
URL path parameters (required) planId integer The ID of the rate plan in which to create the date range
Content-Type

application/xml

Body

The effective date range to create, as XML text with root element revision or JAXB type com.cloudcruiser.server.webservices.v2.dto.rateplan.Revision. The revision's id attribute must be empty.

Schema

Version 4.0
Version 4.1 and later

For HPE Consumption Analytics Portal 4.1 and later, this XML schema describes rate plans and their contained effective date ranges.

<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/Rateplan" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.cloudcruiser.com/webservices/v2/Rateplan">
  <xs:import namespace="http://www.cloudcruiser.com/webservices/v2/Common"/>
  <xs:import/>
  <xs:element name="ratePlan" type="tns:RatePlan"/>
  <xs:element name="ratePlanList" type="tns:RatePlanList"/>
  <xs:element name="ratePlanSummaryList" type="tns:RatePlanSummaryList"/>
  <xs:element name="revision" type="tns:Revision"/>
  <xs:element name="revisions" type="tns:Revisions"/>
  <xs:element name="serviceRate" type="tns:ServiceRate"/>
  <xs:complexType name="RatePlan">
    <xs:sequence>
      <xs:element name="planName" type="xs:string"/>
      <xs:element minOccurs="0" name="description" type="xs:string"/>
      <xs:element default="false" name="defaultPlan" type="xs:boolean"/>
      <xs:element default="false" name="costPlan" type="xs:boolean"/>
      <xs:element default="true" name="valid" type="xs:boolean"/>
      <xs:element maxOccurs="unbounded" ref="tns:revision"/>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="associatedCustomer" type="tns:AssociatedCustomer"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:int"/>
  </xs:complexType>
  <xs:complexType name="Revision">
    <xs:sequence>
      <xs:element minOccurs="0" name="ratePlan">
        <xs:complexType>
          <xs:sequence/>
          <xs:attribute name="name" type="xs:string"/>
          <xs:attribute name="id" type="xs:int"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="startDate" type="ns1:StartOfDay"/>
      <xs:element name="endDate" type="ns1:EndOfDay"/>
      <xs:element maxOccurs="unbounded" minOccurs="0" ref="tns:serviceRate"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:int"/>
  </xs:complexType>
  <xs:complexType name="ServiceRate">
    <xs:sequence>
      <xs:element name="service" type="ns1:Service"/>
      <xs:element minOccurs="0" name="serviceRateDesc" type="xs:string"/>
      <xs:element default="4" name="priceDecimals" type="xs:short"/>
      <xs:element minOccurs="0" name="minimumCommit">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="value" type="xs:double"/>
            <xs:element name="interval" type="xs:string"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element minOccurs="0" name="targetAccountField" type="xs:string"/>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="tag">
        <xs:complexType>
          <xs:sequence/>
          <xs:attribute name="name" type="xs:string" use="required"/>
          <xs:attribute name="value" type="xs:string" use="required"/>
        </xs:complexType>
      </xs:element>
      <xs:element maxOccurs="unbounded" name="rateItem" type="tns:RateItem"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType abstract="true" name="RateItem">
    <xs:sequence>
      <xs:element minOccurs="0" name="rate" type="xs:double"/>
      <xs:element minOccurs="0" name="fixedCharge" type="xs:double"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="PassthroughRateItem">
    <xs:complexContent>
      <xs:extension base="tns:RateItem">
        <xs:sequence/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="BasicRateItem">
    <xs:complexContent>
      <xs:extension base="tns:RateItem">
        <xs:sequence>
          <xs:element minOccurs="0" name="minUnits" type="xs:double"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType abstract="true" name="TierRateItem">
    <xs:complexContent>
      <xs:extension base="tns:RateItem">
        <xs:sequence>
          <xs:element name="tierName" type="xs:string"/>
          <xs:element name="lowRange" type="xs:double"/>
          <xs:element minOccurs="0" name="highRange" type="xs:double"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PerTierRateItem">
    <xs:complexContent>
      <xs:extension base="tns:TierRateItem">
        <xs:sequence/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="HighTierMeteredRateItem">
    <xs:complexContent>
      <xs:extension base="tns:TierRateItem">
        <xs:sequence/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="HighTierAllocatedRateItem">
    <xs:complexContent>
      <xs:extension base="tns:TierRateItem">
        <xs:sequence/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PerTierAllocatedRateItem">
    <xs:complexContent>
      <xs:extension base="tns:TierRateItem">
        <xs:sequence/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="HighTierRateItem">
    <xs:complexContent>
      <xs:extension base="tns:TierRateItem">
        <xs:sequence/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="PerTierMeteredRateItem">
    <xs:complexContent>
      <xs:extension base="tns:TierRateItem">
        <xs:sequence/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:complexType name="AssociatedCustomer">
    <xs:sequence/>
    <xs:attribute name="id" type="xs:int"/>
    <xs:attribute name="customerid" type="xs:string"/>
  </xs:complexType>
  <xs:complexType name="RatePlanSummaryList">
    <xs:sequence>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="ratePlanSummary" type="tns:RatePlanSummary"/>
    </xs:sequence>
    <xs:attribute name="totalPlans" type="xs:int"/>
    <xs:attribute name="retrievedPlans" type="xs:int"/>
    <xs:attribute name="startFrom" type="xs:int"/>
  </xs:complexType>
  <xs:complexType name="RatePlanSummary">
    <xs:sequence>
      <xs:element name="planName" type="xs:string"/>
      <xs:element minOccurs="0" name="description" type="xs:string"/>
      <xs:element maxOccurs="unbounded" name="revisionSummary">
        <xs:complexType>
          <xs:sequence/>
          <xs:attribute name="id" type="xs:int" use="required"/>
          <xs:attribute name="startDate" type="xs:string" use="required"/>
          <xs:attribute name="endDate" type="xs:string" use="required"/>
          <xs:attribute name="serviceCount" type="xs:int"/>
        </xs:complexType>
      </xs:element>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="associatedCustomer" type="tns:AssociatedCustomer"/>
    </xs:sequence>
    <xs:attribute name="id" type="xs:int" use="required"/>
    <xs:attribute name="defaultPlan" type="xs:boolean"/>
    <xs:attribute name="costPlan" type="xs:boolean"/>
    <xs:attribute name="valid" type="xs:boolean"/>
  </xs:complexType>
  <xs:complexType name="Revisions">
    <xs:sequence>
      <xs:element maxOccurs="unbounded" minOccurs="0" ref="tns:revision"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="RatePlanList">
    <xs:sequence>
      <xs:element maxOccurs="unbounded" minOccurs="0" ref="tns:ratePlan"/>
    </xs:sequence>
    <xs:attribute name="totalPlans" type="xs:int"/>
    <xs:attribute name="retrievedPlans" type="xs:int"/>
  </xs:complexType>
</xs:schema>

Response

Content-Type

application/xml

Body

The new date range, as XML text with the root element revision or JAXB type com.cloudcruiser.server.webservices.v2.dto.rateplan.Revision.

Schema

Same as for the request, above.

Example

URL invocation

POST http://localhost:8080/rest/v2/ratePlans/10101/revisions

Java invocation
Request body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<revision xmlns="http://www.cloudcruiser.com/webservices/v2/Rateplan">
  <ratePlan name="test-plan-11" id="10101"/>
  <startDate year="2014" month="9" day="1"/>
  <endDate year="2099" month="12" day="31"/>
  <serviceRate>
    <service serviceName="test-svc-1" groupName="testGrp-2" id="10400"/>
    <priceDecimals>2</priceDecimals>
    <rateItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="HighTierRateItem">
      <rate>16.0</rate>
      <tierName>t-1</tierName>
      <lowRange>0.0</lowRange>
      <highRange>200.0</highRange>
    </rateItem>
    <rateItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="HighTierRateItem">
      <rate>15.0</rate>
      <tierName>t-2</tierName>
      <lowRange>200.0</lowRange>
    </rateItem>
  </serviceRate>
  <serviceRate>
    <service serviceName="Network Traffic In" groupName="Network" id="10003"/>
    <priceDecimals>4</priceDecimals>
    <rateItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BasicRateItem">
      <rate>0.75</rate>
    </rateItem>
  </serviceRate>
  <serviceRate>
    <service serviceName="Small VM" groupName="Virtual Machines" id="10000"/>
    <priceDecimals>0</priceDecimals>
    <rateItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BasicRateItem">
      <rate>60.0</rate>
      <fixedCharge>2.0</fixedCharge>
    </rateItem>
  </serviceRate>
</revision>
Response body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<revision xmlns="http://www.cloudcruiser.com/webservices/v2/Rateplan" id="10506">
  <ratePlan name="test-plan-11" id="10101"/>
  <startDate year="2014" month="9" day="1"/>
  <endDate year="2999" month="12" day="31"/>
  <serviceRate>
    <service serviceName="Small VM" groupName="Virtual Machines" id="10000"/>
    <priceDecimals>0</priceDecimals>
    <rateItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BasicRateItem">
      <rate>60.0</rate>
      <fixedCharge>2.0</fixedCharge>
    </rateItem>
  </serviceRate>
  <serviceRate>
    <service serviceName="Network Traffic In" groupName="Network" id="10003"/>
    <priceDecimals>4</priceDecimals>
    <rateItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BasicRateItem">
      <rate>0.75</rate>
    </rateItem>
  </serviceRate>
  <serviceRate>
    <service serviceName="test-svc-1" groupName="testGrp-2" id="10400"/>
    <priceDecimals>2</priceDecimals>
    <rateItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="HighTierRateItem">
      <rate>16.0</rate>
      <tierName>t-1</tierName>
      <lowRange>0.0</lowRange>
      <highRange>200.0</highRange>
    </rateItem>
    <rateItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="HighTierRateItem">
      <rate>15.0</rate>
      <tierName>t-2</tierName>
      <lowRange>200.0</lowRange>
    </rateItem>
  </serviceRate>
</revision>
Last modified

Tags

Classifications

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