create_charge_item
Creates a custom charge item for Chargeback based on the properties specified in the referenced file.
Format
emcli create_charge_item -input_file="property_file:filename"
Options
The option [-input_file] is the full path of a file that contains the item properties. The following properties can be defined in the file:
-
target_type
Target type to which the charge item applies.
-
source_data_type
Source data type. Valid values are metric, config, and property.
-
item_name
Name of the item.
-
metric_group
Metric group name as listed in
list_item_candidates
. This is a required property if source_data_type=metric. -
metric_column
Metric column name as listed in
list_item_candidates
. This is a required property if source_data_type=metric. -
config_view
Config view name as listed in
list_item_candidates
. This is a required property if source_data_type=config. -
config_key
Config key name as listed in
list_item_candidates
. This is a required property if source_data_type=config. -
config_column
Config column name as listed in
list_item_candidates
. This is a required property if source_data_type=config. -
config_data_source
Data source of configuration metric. This is a required property if source_data_type=config.
-
property
Property name as listed in
list_item_candidates
. This is a required property if source_data_type=property. -
item_displayname
Item display name.
-
unit
Unit display name.
-
aggregation_type
Type of aggregation to use for this item. Applicable only if data type=number. Valid values are sum and avg. Default value is avg.
-
is_config_condition
Item used conditionally in a charge plan. Valid values are 0, 1. Default value is 0.
-
item_category
Category of item. Default value is instance. Valid values are cpu, storage, memory, network, and instance.
-
data_type
Valid values are string and number. The default value is string for config and property types, and number for metric type.
Examples
Example 1
This example creates a metric custom charge item that bases charges on the average total of processes on a particular host:
emcli create_charge_item -input_file="property_file:/home/user/property_file" Contents of /home/user/property_file: target_type=host source_data_type=metric item_name=total_proc metric_group=Load metric_column=noOfProcs item_displayname=Total Processes unit=process aggregation_type=avg item_category=instance data_type=number
Example 2
This example creates a configuration custom charge item that can charge different rates for various usage charge items based on the instance region:
emcli create_charge_item -input_file="property_file:/home/user/property_file" Contents of /home/user/property_file: target_type=oracle_database source_data_type=config item_name=custom_config config_view=myCustomCCS config_key=region config_column=country config_data_source=regionList.txt item_display_name=Region of Instance item_category=instance data_type=string