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

Update a rate plan

Updates a rate plan specified by its ID.

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

Resource URL

PUT http://<ccServerURL>/rest/v2/ratePlans/<id>

Request

Parameters
  Name Type Description
URL path parameters (required) id integer The ID of the rate plan to update
Content-Type

application/xml

Body

The rate plan to apply, as XML text with root element ratePlan or JAXB type com.cloudcruiser.server.webservices.v2.dto.rateplan.RatePlan. The value of the id attribute, if set, must be the same as the id 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 rate plan, 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

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

Java invocation
Request body
<ratePlan xmlns="http://www.cloudcruiser.com/webservices/v2/Rateplan" id="10101">
  <planName>test-plan-11</planName>
  <description>test plan 11</description>
  <defaultPlan>false</defaultPlan>
  <costPlan>false</costPlan>
  <valid>true</valid>
  <revision id="10104">
    <ratePlan name="test-plan-11" id="10101"/>
    <startDate year="2014" month="1" day="1"/>
    <endDate year="2015" month="12" day="31"/>
    <serviceRate>
      <service name="Network Traffic In" group="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"/>
      <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 name="Small VM" group="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>
</ratePlan>
Response body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ratePlan xmlns="http://www.cloudcruiser.com/webservices/v2/Rateplan" id="10101">
  <planName>test-plan-11</planName>
  <description>test plan 11</description>
  <defaultPlan>false</defaultPlan>
  <costPlan>false</costPlan>
  <valid>true</valid>
  <revision id="10104">
    <ratePlan name="test-plan-11" id="10101"/>
    <startDate year="2014" month="1" day="1"/>
    <endDate year="2015" month="12" day="31"/>
    <serviceRate>
      <service name="test-svc-1" group="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 name="Network Traffic In" group="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 name="Small VM" group="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>
</ratePlan>
Last modified

Tags

Classifications

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