I want to add a resource so that it counts the number of firewalls used.
I see in the Chargeback Api that you can add computing Resources, but how does it know which resource to base the calculaton.
I want to create a "Firewall Count" to count all used firewalls. Currently I see that "FIREWALL Service" just says 1 or 0 to know if a firewall(s) are used.
Here is the doc on adding Computing Resources
Add Computing Resource
This API enables you to add a computing resource with the specified name, description, unit, and attributes.
Syntax
The syntax for calling this method is:
POST <Base_Url>/computingResource
A sample API call is as follows:
POST https://123.123.123.123/vCenter-CB/api/computingResource
User Privilege Required
You must have the Super User role.
Request Body Parameters
The request XML for this API contains the parameters described in the following table.
XPath | Type | Min Occurs | Max occurs | Description |
---|---|---|---|---|
ComputingResources/ComputingResource/Name | xs:string | 1 | 1 | Name of the computing resource that you want to add. The computing resource name must be unique and not exceed 255 characters. The name must contain only alphanumeric characters and can contain spaces. |
ComputingResources/ComputingResource/Description | xs:string | 0 | 1 | An optional description of the computing resource. The description must not exceed |
ComputingResources/ComputingResource/Unit | xs:string | 1 | 1 | Unit in which the computing resource is measured. |
ComputingResources/ComputingResource/ConversionFactor | xs:double | 0 | 1 | Specifies the conversion factor for the data collected for a particular computing resource. Default value of 1.0 is used in case no conversion factor is explicitly specified. |
ComputingResources/ComputingResource/RollUpType | xs:string | 0 | 1 | Specifies the computation method for the computing resource. Possible values are: ‘Average’(Computation is based upon Timed Average of usage); ‘Sum’(Computation is based upon summation of usage). |
ComputingResources/ComputingResource/Enabled | xs:boolean | 0 | 1 | Specifies whether the computing resource is enabled in vCenter Chargeback Manager. Default value is true. |
ComputingResources/ComputingResource/Attributes/Attribute | 1 | unbounded | Attributes based on which the computing resource will be calculated. | |
ComputingResources/ComputingResource/Attributes/Attribute/Name | xs:string | 1 | 1 | Name of the attribute based on which the computing resource will be calculated. For custom computing resources, only ‘allocation’ is supported. |