Home > Cloud Cruiser 4 > REST API reference > Rate plans > Update a date range for a rate plan

Update a date range for a rate plan

Updates an effective date range for a rate plan specified by the ID of the date range.

This method is available in Cloud Cruiser version 4.1 and later.

Resource URL

PUT http://<ccServerURL>/rest/v2/ratePlans/<planId>/revisions/<revId>

or

PUT http://<ccServerURL>/rest/v2/ratePlans/revisions/<revId>

Request

Parameters
  Name Type Description
URL path parameters revId integer (required) The ID of the date range to update
planId integer (optional) The ID of the rate plan that contains the date range to update
Content-Type

application/xml

Body

The date range to apply, as XML text with root element revision or JAXB type com.cloudcruiser.server.webservices.v2.dto.rateplan.Revision. The value of the id attribute, if set, must be the same as the revId URL path parameter.

Schema

Version 4.0
Version 4.1 and later

For Cloud Cruiser 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 updated 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

PUT http://localhost:8080/rest/v2/ratePlans/10101/revisions/10104

Java invocation
Request body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<revision xmlns="http://www.cloudcruiser.com/webservices/v2/Rateplan" id="10104">
  <ratePlan name="test-plan-11" id="10101"/>
  <startDate year="2014" month="5" day="1"/>
  <endDate year="2014" month="8" day="31"/>
  <serviceRate>
    <service serviceName="test-svc-2"/>
    <priceDecimals>2</priceDecimals>
    <rateItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="PerTierRateItem">
      <rate>21.0</rate>
      <tierName>t1</tierName>
      <lowRange>0.0</lowRange>
      <highRange>100.0</highRange>
    </rateItem>
    <rateItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="PerTierRateItem">
      <rate>20.0</rate>
      <tierName>t2</tierName>
      <lowRange>100.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.35</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>50.0</rate>
      <fixedCharge>1.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="10104">
  <ratePlan name="test-plan-11" id="10101"/>
  <startDate year="2014" month="5" day="1"/>
  <endDate year="2014" month="8" day="31"/>
  <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.35</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>50.0</rate>
      <fixedCharge>1.0</fixedCharge>
    </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>21.0</rate>
      <tierName>t1</tierName>
      <lowRange>0.0</lowRange>
      <highRange>100.0</highRange>
    </rateItem>
    <rateItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="PerTierRateItem">
      <rate>20.0</rate>
      <tierName>t2</tierName>
      <lowRange>100.0</lowRange>
    </rateItem>
  </serviceRate>
</revision>
Last modified

Tags

Classifications

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