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 > Administering > Managing services > Importing services and rates together

Importing services and rates together

You can import services and their rates into HPE Consumption Analytics Portal in two ways: by running the ccimport utility against a comma-delimited (CSV) file in the defined format or by using an ETL workbook to collect the service and rate data from a data source, transform it as necessary, and publish it as services and rates. This article explains how to do both.

Importing using an ETL workbook

Before you begin

Ensure that you have service and rate data available to be collected and published in HPE Consumption Analytics Portal.

To import services and rates using an ETL workbook

  1. Go to Data > Workbooks.
  2. Create a new workbook for your ETL process.
    See Creating workbooks for more information. By default, the flow of the new workbook contains an Import Collections step, which is required.
  3. Create a collection to map your source service and rate data to HPE Consumption Analytics Portal, as described in Creating collections.
    For example, if you export your your service and rate information from its source service catalog to a CSV file, build a CSV collection.
  4. If needed, create a Transformation step with one or more processors to modify the imported data before publishing.
    For more information about transformation steps, see Working with flows.
  5. Create a Publish as Service and Rate step in your flow to publish collected service and rate data to HPE Consumption Analytics Portal:
    1. Right-click the flow area, and select Publish Config > As Service and Rate.
      The Publish as Service and Rates dialog box appears. For more information about the fields available to publish, see the CSV format section of this topic.
    2. Provide Map To Worksheet Column values for data you want to publish.
      Schema fields with checkboxes are required. You can enter values in quotation marks to publish a literal value, or you can select from the columns available in your collected data to publish collected values.
    3. Enter or select a Map To Worksheet Column value for the Rate Plan: Fixed charge amount and Rate Plan: Rate schema fields, else you will have no rates in your published rate plan.
    4. Consider entering a  Map To Worksheet Column value for the Rate plan name schema field.
      If you do not provide a value, your rates are added to the Default rate plan.
    5. Click OK.
      In the following example, the step creates metered services from Microsoft Azure data using the collected ComputedServiceName measure as the service name. Usage for services is charged according to the collected ComputedServiceName measure, with the units of measurement defined by the collected ServiceResource measure (which might be Compute Hours, Data Transfer Out in GB,and so on).
      PublishServicesRates.bmp
  6. Click Save to save your workbook.
  7. Test your workbook, as described in Testing collection and deleting data loads, and correct errors as needed.
    When the workbook runs without errors, verify that your rate plan and services appear as expected in HPE Consumption Analytics Portal on the Financial > Services and Financial > Rate Plans pages.
  8. Schedule regular collection for this workbook to ensure that HPE Consumption Analytics Portal always contains your current services and rate plan information, as described in Scheduling jobs to run.

Importing with ccimport

The following ccimport behaviors took effect with version 4.0.1 and supercede the defaultStartDate parameter:

  • When updating existing services and rates:
    • When a record in the input file contains no effective_date, the date range currently in effect in the rate plan is updated.
    • You cannot create an effective date range with a start date earlier than a date range that has been used for existing charges.

When importing new services and rates, when a new service with no effective_date is added to a rate plan that has been used for existing charges, its rates are added to the date range currently in effect.

Before you begin

Create a CSV file on the HPE Consumption Analytics Portal server in the required CSV format.

To import services

  • Enter the command ccimport -t servicerate -f <filename> [-u] [-D <parameter> ...]

    The table below lists the parameters you can use when importing services. You must precede each parameter with -D. For example, to import from the file cloud_services.csv with incomplete service definitions and update duplicate entries:

    ccimport -t servicerate -f cloud_services.csv -u -D enforceValidation=false

 

Parameter

Description

ignoreActiveFlag

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.

defaultActiveFlag

Whether new services are active when no value is specified for active_flag. The default is true.

enforceValidation

Whether to enforce validation of imported services, rejecting incompletely defined services. The default is true.

defaultServiceGroupName

The service group in which to place new services when no value is specified for group_name. The default is Default.
defaultStartDate New in version 4.0.1. The start date to use when a row in the input file does not include an effective_date value. The default is 20000101.

CSV format

Each row in the file represents a measure in a service and a rate for that service in an effective date range of a rate plan. It contains attributes of the measure, of the service, and of the rate. This means that multiple rows are required to define a service made up of more than one measure or a rate with tiers. When an input file contains more than one row for a given service and those rows have different values for a service-level attribute, the result of the import is the value in the last of those rows.

The first line of the file is a header row that defines the format of the subsequent rows. The following table describes the valid field names for the header row, some of which also have short names that you can use instead. In the full field names, you can substitute dots (.) for underscores (_).

CSV rows beginning with a pound sign (#) are treated as comments and ignored by the importer.

Handling special characters

 

Field Name

Short Name

Attribute of

Description

Required

service_name service Service Name of the service to import or update Yes
service_desc desc Service Description of the service No
measurement_type (none) Measure

How measure_name is measured. Valid values: M (Metered), A (Allocated and counting every instance), D (Allocated and counting unique/distinct instances). The default is M.

No
group_name group Service Group of which the service is a member No
active_flag active Service Whether the service is active. Valid values: 1/true or 0/false. The default is true. No
proration_type proration Service

How to prorate an allocated serviceValid values: N (none), P (partial/forward), F (full)

Default value: F

No
charge_interval interval Service

Valid values: 0 (daily), 1 (hourly), 2 (monthly), 3 (weekly), 4 (yearly)

Default value: 2

No
unit_decimals unit_dec Service Unit decimal positions No
unit_desc unit Service Unit description Yes
tag_name tag.name Service Name of the tag No
tag_value tag.value Service Value for the named tag No
schema_name schema Measure Schema name No
measure_name measure Measure Measure name No
measure_quantity_operator quantity_operator Measure

Operator specifying exact quantity value or range of values.

Valid values:

  • * any quantity
  • = exact quantity (= measure_quantity)
  • ​< range (measure_quanity < n < measure_quantity_high)
  • R range (measure_quanity < n <= measure_quantity_high)
  • L range (measure_quanity <= n < measure_quantity_high)​
  • E range (measure_quanity <= n <= measure_quantity_high)​​
No
measure_quantity quantity Measure

Quantity of the measure in the service or lower bound quantity if specifying a range

No
measure_quantity_high quantity_high Measure Upper bound of the measure quantity in the service No
conversion_operator operator Measure

Unit conversion operator.

Valid values: * (multi), / (div), null

Default value: null

No
conversion_operand operand Measure Unit conversion factor or divisor No
dimension_filter_type filter_type Service Name of a dimension to use as a service filter No
dimension_filter_value filter_value Service Value of the named dimension to use as a service filter No

rate_plan_name

plan

Rate

Rate plan name. If not specified, use the "Default" rate plan.

Yes

rate_plan_desc

plan_desc

Rate

Rate plan description

No

service_rate_desc svc.rate.desc Rate

The description of the service when charged under the rate plan. This text appears in place of the service name on standard reports when the Allow unique service descriptions for customers option is enabled in Administration > Configuration > General > System.

When the option is disabled, this field is ignored by ccimport and ccexport.

No
svc_rate_tag_name rate.tag.name Rate A rate plan field passed as metadata to the HPE Consumption Analytics Portal database. No
svc_rate_tag_value rate.tag.value Rate The value for a svc_rate_tag_name field. No

effective_date

date

Rate

The beginning date of the effective date range to create or update in the rate plan, in the format of yyyymmdd. In version 4.0.1 and later the default is the value of the defaultStartDate parameter. In version 4.0 the default is today.

No

end_date end Rate The ending date for the effective date range of the rate plan, in the format yyyymmdd. No

rate_type

model Rate

Valid values: B (basic), T (Sticky Tiers), H (Final Tier), P (passthrough), S (State)

Default value: B

No

rate_decimals

rate_dec

Rate

The decimal precision of the rate

No

min_commitment_value min.value Rate The amount of a service customers are obligated to purchase regardless of their actual usage of that service No
min_commitment_interval min.interval Rate Defines how often the min_commit_value obligation is applied (Daily, Hourly, or Monthly) No

minimum_units

min_units

Rate

Minimum units to charge, if this is Basic price model

No

state_name

state

Rate

State name when the rate type is State

Yes

state_desc

state.desc

Rate

State description when the rate type is State

No

tier_name

tier

Rate

Tier name when the rate type is Sticky Tiers or Final Tier

No

tier_low_range

low

Rate

Lowest value in a tier when the rate type is Sticky Tiers or Final Tier.

No

tier_target_account_field

tier_target

Rate The level of your account structure at which usage is aggregated for tiers when the rate type is Sticky Tiers or Final Tier

No

fixed_charge_amount fixed Rate One-time, or fixed, rate No
rate unit.price Rate Per-unit, or variable, rate No
Last modified

Tags

Classifications

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