Home > Cloud Cruiser 4 > REST API reference > Rate plans > Import services and rate plans

Import services and rate plans

Imports CSV-formatted service definitions and rates.

Resource URL

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

Request

Parameters
  Name Type Description
Request header parameters (optional) defaultActiveFlag boolean Whether new services are active when no value is specified for active_flag. The default is true.
defaultServiceGroupName string The service group in which to place new services when no value is specified for group_name. The default is Default.
defaultStartDate string The start date to apply when an imported rate is missing an effective_date and no current effective date range exists for the rate plan. The format is yyyyMMdd, and the default is 20000101.
enforceValidation boolean Whether to enforce validation of imported services, rejecting incompletely defined services. The default is true.
ignoreActiveFlag boolean Whether to ignore the active_flag values in the import file and instead set all services' Active flag to the value of defaultActiveFlag. The default is false.
updateDuplicates boolean Whether to update an existing service and rate when the source data contains a duplicate. When false, the duplicate source row is ignored. The default is false.
Content-Type

text/csv

Body

The services and rates to import, in Service and rate CSV file format.

Response

Content-Type

application/xml

Body

Details for the result of the import, as XML text with the root element itemImportResult or JAXB type com.cloudcruiser.server.webservices.v2.dto.common.ItemImportResult.

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>

Example

URL invocation

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

Request header parameters

Content-Type: text/csv

updateDuplicates: true

Java invocation
Request body
service_name,service_desc,measurement_type,group_name,active_flag,proration_type,charge_interval,unit_decimals,unit_desc,tag_name,tag_value,schema_name,measure_name,measure_quantity_operator,measure_quantity,measure_quantity_high,conversion_operator,conversion_operand,dimension_filter_type,dimension_filter_value,rate_plan_name,rate_plan_desc,effective_date,rate_type,rate_decimals,minimum_units,state_name,state_desc,tier_name,tier_low_range,tier_target_account_field,fixed_charge_amount,rate
test-svc-12,,distinct,testGrp-1,1,none,daily,4,units,,,Network,IP Address,=,1,,none,,,,Default,Default rate plan for all services,20000101,basic,4,,,,,,,,
test-svc-12,,distinct,testGrp-1,1,none,daily,4,units,,,Network,IP Address,=,1,,none,,,,Cost,Cost plan for all services,20000101,basic,4,,,,,,,,
test-svc-13,,allocated,testGrp-1,1,none,daily,4,units,,,Network,IP Address,=,1,,none,,,,Default,Default rate plan for all services,20000101,basic,4,,,,,,,,
test-svc-13,,allocated,testGrp-1,1,none,daily,4,units,,,Network,IP Address,=,1,,none,,,,Cost,Cost plan for all services,20000101,basic,4,,,,,,,,
Response body
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<itemImportResult xmlns="http://www.cloudcruiser.com/webservices/v2/Common">
  <importedSummary>
    <totalItems>6</totalItems>
    <newItems>0</newItems>
    <duplicateItems>2</duplicateItems>
    <updatedItems>4</updatedItems>
  </importedSummary>
  <duplicateItemNames>
    <duplicateItemName>test-svc-12</duplicateItemName>
    <duplicateItemName>test-svc-13</duplicateItemName>
  </duplicateItemNames>
  <updatedItemNames>
    <updatedItemName>(rate plan: Default, service: test-svc-12)</updatedItemName>
    <updatedItemName>(rate plan: Cost, service: test-svc-12)</updatedItemName>
    <updatedItemName>(rate plan: Default, service: test-svc-13)</updatedItemName>
    <updatedItemName>(rate plan: Cost, service: test-svc-13)</updatedItemName>
  </updatedItemNames>
</itemImportResult>
Last modified

Tags

Classifications

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