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 3 > Batch XML Reference > Transform processors > CalculateResource

CalculateResource

Table of contents
No headers

Creates a new resource calculated from existing resource values. Any resource already in the record can be used in a free form algebraic expression to compute a value for the target resource. If the target resource already exists, then it will be updated with the calculated value. For more information on expression syntax and supported variables, see Expression parser.

Resources that are charged for based on state can be computed for a particular state. Since state is an identifier on the record, a state conflict is resolved by creating a new record with all identifiers from the old record except for state, then adding the target resource with the calculation result and the target state to the new record.

Class

<bean class="com.cloudcruiser.batch.transform.CalculateResource">

Properties

<property name="expression" value="expression" />

Sets an algebraic expression using resource names as variables where needed. Use parenthesis for explicit order of operations.

<property name="targetResource" value="targetResource" />

Sets a resource Id that will have its value set from the result.

<property name="targetState" value="targetState" />

(Optional) Sets a resource state for the target resource. This might result in a cloned record (identifiers only) in order to add the resource when another state is already defined.

Spring Batch XML Example

<batch:step id="transform" next="charge">
  <batch:tasklet>
    <bean class="com.cloudcruiser.batch.CCRecordTransformTasklet">
      <property name="processors">
        <list>
          <bean class="com.cloudcruiser.batch.transform.CalculateResource">
            <property name="active" value="true" />
            <property name="targetResource" value="IPSpaceNumAddress" />
            <property name="expression" value="(2^(32 - IPSpaceCidrMask)) - 2" />
          </bean>
        </list>
      </property>
    </bean>
  </batch:tasklet>
</batch:step>
Last modified

Tags

This page has no custom tags.

Classifications

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