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 rate plan

Create a rate plan

Creates a new rate plan.

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

Resource URL

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

Request

Parameters

None

Content-Type

application/xml

Body

The rate plan to create, as XML text with root element ratePlan or JAXB type com.cloudcruiser.server.webservices.v2.dto.rateplan.RatePlan. The rate plan'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 service, as XML text with the root element ratePlan or JAXB type com.cloudcruiser.server.webservices.v2.dto.rateplan.RatePlan.

Schema

Same as for the request, above.

Example

URL invocation

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

Java invocation
Request body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ratePlan xmlns="http://www.cloudcruiser.com/webservices/v2/Rateplan">
  <planName>test-plan-15</planName>
  <description>test plan 15</description>
  <revision>
    <startDate year="2014" month="1" day="1"/>
    <endDate year="2014" month="6" day="30"/>
    <serviceRate>
      <service serviceName="Network Traffic In"/>
      <priceDecimals>4</priceDecimals>
      <rateItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BasicRateItem">
        <rate>0.25</rate>
      </rateItem>
    </serviceRate>
    <serviceRate>
      <service serviceName="Small VM"/>
      <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>
  <revision>
    <startDate year="2014" month="7" day="1"/>
    <endDate year="2099" month="12" day="31"/>
    <serviceRate>
      <service serviceName="Small VM"/>
      <priceDecimals>0</priceDecimals>
      <rateItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BasicRateItem">
        <rate>65.0</rate>
      </rateItem>
    </serviceRate>
    <serviceRate>
      <service serviceName="test-svc-2"/>
      <priceDecimals>2</priceDecimals>
      <rateItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="PerTierRateItem">
        <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="PerTierRateItem">
        <rate>15.0</rate>
        <tierName>t-2</tierName>
        <lowRange>200.0</lowRange>
      </rateItem>
    </serviceRate>
  </revision>
</ratePlan>
Response body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ratePlan xmlns="http://www.cloudcruiser.com/webservices/v2/Rateplan" id="10302">
  <planName>test-plan-15</planName>
  <description>test plan 15</description>
  <defaultPlan>false</defaultPlan>
  <costPlan>false</costPlan>
  <valid>true</valid>
  <revision id="10507">
    <ratePlan name="test-plan-15" id="10302"/>
    <startDate year="2014" month="1" day="1"/>
    <endDate year="2014" month="6" day="30"/>
    <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.25</rate>
      </rateItem>
    </serviceRate>
  </revision>
  <revision id="10508">
    <ratePlan name="test-plan-15" id="10302"/>
    <startDate year="2014" month="7" 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>65.0</rate>
      </rateItem>
    </serviceRate>
    <serviceRate>
      <service serviceName="test-svc-2" groupName="testGrp-1" id="10600"/>
      <priceDecimals>2</priceDecimals>
      <rateItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="PerTierRateItem">
        <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="PerTierRateItem">
        <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.25</rate>
      </rateItem>
    </serviceRate>
  </revision>
</ratePlan>
Last modified

Tags

Classifications

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