Export Report

This API sends a request to export a report to a supported format. XML is the only supported format in this release of vCenter Chargeback Manager.

This report request is queued as a task and the API returns the status of this task or the actual report itself when the export task is completed.


User Privilege

To export a report, you need to have Read privilege on the report.

Syntax

The syntax for calling this method is:

GET /<Base_Url>/report/{reportId}/export?exportFormat=XML

For example, GET https://123.123.123.123/vCenter-CB/api/report/15/export?exportFormat=XML

URL Parameters

You can provide the following URL parameters with the API call.

Name

Data Type

Required/Optional

Description

Sample Value

exportFormat

String. Valid value is XML.

Required

Format in which the report needs to be exported

XML

Request Parameters

The API does not need a request XML.

API Response

The API responds with either the status of the queued task or the report output if the report export task is complete.

The following table describes the elements in the Export report XML.

XPath

Type

Min Occurs

Max occurs

Description

Reports/Report/@id

xs:int

1

1

ID of the report.

Reports/Report/MetaData

 

1

1

Represents the report meta data.

Reports/Report/MetaData/Name

xs:string

1

1

Name of the report.

Reports/Report/MetaData/Description

xs:string

0

1

A brief description of the report.

Reports/Report/MetaData/ReportType

xs:string

1

1

Type of the report. The valid report types are COST_REPORT, COST_COMPARISON_REPORT and UTILIZATION_REPORT.

Reports/Report/MetaData/CreatedOn

xs:long

1

1

The date and time (in milliseconds; from January 1, 1970 GMT 00:00) of the creation of the report.

Reports/Report/MetaData/ModifiedOn

xs:long

0

1

The date and time (in milliseconds; from January 1, 1970 GMT 00:00) at which the report was last modified. Modifications will be available only in the contents of the Configuration section of the response XML.

Reports/Report/MetaData/ReportPeriod

 

1

1

Represents the billing period for which the report is to be generated.

Reports/Report/MetaData/ReportPeriod/From

xs:long

1

1

The start time of the duration for which the report is generated (in milliseconds; from January 1, 1970 GMT 00:00).

Reports/Report/MetaData/ReportPeriod/To

xs:long

1

1

The end time of the duration for which the report is generated (in milliseconds; from January 1, 1970 GMT 00:00).

Reports/Report/MetaData/CreatedBy

xs:int

1

1

ID of the user, who has created this report.

Reports/Report/MetaData/CreatedByName

xs:string

1

1

Name of the user who has created the report.

Reports/Report/MetaData/ModifiedBy

xs:int

0

1

ID of the user, who has modified this report.

Reports/Report/MetaData/ModifiedByName

xs:string

0

1

Name of the user who has modified the report.

Reports/Report/MetaData/OwnedByName

xs:string

0

1

Name of the user for whom the report is generated.

Reports/Report/MetaData/Currency/@id

xs:int

1

1

ID of the currency used in the report

Reports/Report/MetaData/Currency/Name

xs:string

1

1

Short name of the currency used in the report.

Reports/Report/MetaData/TotalEntities

xs:int

1

1

Total number of entities in a hierarchy during the report period.

Reports/Report/MetaData/TotalUniqueEntities

xs:int

1

1

The number of unique entities in the hierarchy during the report period. Even if an entity is moved among multiple parent entities during the report period, the element counts only one occurrence of the entity.

Reports/Report/MetaData/TotalCost

xs:double

0

1

The total cost of the report. This element is applicable only to Cost reports.

Reports/Report/MetaData/PageCount

xs:int

0

1

Number of pages in the report. This element is populated if the report is exported to PDF, RTF or CSV format at least once.

Reports/Report/MetaData/Hierarchies/Hierarchy

 

1

1

Represents the hierarchy for which the report is generated.

Reports/Report/MetaData/Hierarchies/Hierarchy/@id

xs:int

1

1

ID of the hierarchy for which the report is generated.

Reports/Report/MetaData/Hierarchies/Hierarchy/Name

xs:string

1

1

Name of the hierarchy for which the report is generated.

Reports/Report/MetaData/Hierarchies/Hierarchy/Description

xs:string

0

1

Description of the hierarchy for which the report is generated.

Reports/Report/MetaData/Hierarchies/Hierarchy/Entities/Entity

 

1

unbounded

Represents the entity included in the report.

Reports/Report/MetaData/Hierarchies/Hierarchy/Entities/Entity/@id

xs:int

1

1

ID of the entity included in the report.

Reports/Report/MetaData/Hierarchies/Hierarchy/Entities/Entity/Name

xs:string

1

1

Name of the entity included in the report.

Reports/Report/MetaData/Hierarchies/Hierarchy/Entities/Entity/Attributes

 

0

1

Represents a complex expression based on custom attribute value pairs that is used to filter entities in the sub-tree under “Entity”.

Reports/Report/MetaData/Hierarchies/Hierarchy/Entities/Entity/Attributes/@operator

xs:string

0

1

Represents operator for the attribute criteria expression. [enum {“OR”, “AND”} ].

Reports/Report/MetaData/Hierarchies/Hierarchy/Entities/Entity/Attributes/Attribute

 

0

unbounded

Represents simple expression using a single attribute value pair.

Reports/Report/MetaData/Hierarchies/Hierarchy/Entities/Entity/Attributes/Attribute/@id

xs:int

1

1

ID of the custom attribute.

Reports/Report/MetaData/Hierarchies/Hierarchy/Entities/Entity/Attributes/Attribute/@criteria

xs:string

0

1

Represents value matching criteria for the attribute value. [enum: { "EQUALS", "STARTS_WITH, ENDS_WITH", "CONTAINS"}].

Reports/Report/MetaData/Hierarchies/Hierarchy/Entities/Entity/Attributes/Attribute/Value

 

1

1

Represents the value of the attribute in the attribute value pair.

Reports/Report/MetaData/Hierarchies/Hierarchy/Entities/Entity/Attributes/Attributes

 

0

unbounded

Attributes can be nested within attributes for complex expression.

Reports/Report/MetaData/Hierarchies/Hierarchy/Entities/Entity/Description

xs:string

0

1

Description of the entity included in the report.

Reports/Report/MetaData/Hierarchies/Hierarchy/Entities/Entity/CostModel/@id

xs:int

0

1

ID of the cost model for which the report is generated.

Reports/Report/MetaData/Hierarchies/Hierarchy/Entities/Entity/CostModel/Name

xs:string

0

1

Name of the cost model for which the report is generated.

Reports/Report/MetaData/Hierarchies/Hierarchy/Entities/Entity/CostModel/Description

xs:string

0

1

Description of the cost model for which the report is generated.

Reports/Report/MetaData/CostModels/CostModel

 

0

2

Represents the cost model for which the report is generated. This element is applicable only for the Cost Comparison report.

Reports/Report/MetaData/CostModels/CostModel/@id

xs:int

1

1

ID of the cost model.

Reports/Report/MetaData/CostModels/CostModel/Name

xs:string

0

1

Name of the cost model for which the report is generated.

Reports/Report/MetaData/CostModels/CostModel/Description

xs:string

0

1

Description of the cost model for which the report is generated.

Reports/Report/MetaData/ComputingResources/ComputingResource

 

1

unbounded

Represents the computing resource for which the report is generated.

Reports/Report/MetaData/ComputingResources/ComputingResource/@id

xs:int

1

1

ID of the computing resource.

Reports/Report/MetaData/ComputingResources/ComputingResource/Name

xs:string

1

1

Name of the computing resource.

Reports/Report/MetaData/ComputingResources/ComputingResource/Description

xs:string

0

1

Description of the computing resource.

Reports/Report/MetaData/ComputingResources/ComputingResource/Unit

xs:string

1

1

Unit of measurement applicable for the computing resource.

Reports/Report/Configuration

xs:complextype

0

1

Elements of this section are used in the vCenter Chargeback Manager UI to customize the look and feel of the report.

Reports/Report/Configuration/Computation

 

0

1

Represents a complex expression that affects the computation logic of the report.

Reports/Report/Configuration/Computation/Settings

 

0

unbounded

Every occurrence of the "Settings" element represents the configuration information for a feature.

Reports/Report/Configuration/Computation/Settings/@type

xs:string

1

1

Type of the setting. The value currently supported is "costVariance".

Reports/Report/Configuration/Computation/Settings/Property

 

1

unbounded

Property element that holds the property name and its value.

Reports/Report/Configuration/Computation/Settings/Property/@name

xs:string

1

1

Represents the name of the property.

Reports/Report/Configuration/Computation/Settings/Property/@value

xs:string

1

1

Represents the value of the property. Following are the valid properties for “costVariance”:

  • Name = enabled Values = true/false
  • Name = granularity Values = DAILY/HOURLY

Reports/Report/ComputedData/EntitySummary/Entity

 

0

unbounded

Represents the entity in the hierarchical path for a given report.

Reports/Report/ComputedData/EntitySummary/Entity/@reportEntityId

xs:int

1

1

Unique ID of the entity in the hierarchical path for a given report.

Reports/Report/ComputedData/EntitySummary/Entity/@parentReportEntityId

xs:int

1

1

Report entity ID of the parent entity for the given entity.

Reports/Report/ComputedData/EntitySummary/Entity/@id

xs:int

1

1

ID of the entity.

Reports/Report/ComputedData/EntitySummary/Entity/Name

xs:string

1

1

Name of the entity.

Reports/Report/ComputedData/EntitySummary/Entity/Type

xs:int

1

1

Entity type. For more information on the entity types, see the Appendix.

Reports/Report/ComputedData/EntitySummary/Entity/Parent

xs:int

1

1

ID of the parent entity

Reports/Report/ComputedData/EntitySummary/Entity/ChildEntityInfos/ChildEntityInfo

 

1

1

Represents the child entity information.

Reports/Report/ComputedData/EntitySummary/Entity/ChildEntityInfos/ChildEntityInfo/@type

xs:string

1

1

Type of the child entity information. Valid values are immediateChildEntityCount and entityCountByType.

If the type is immediateChildEntityCount, the ChildEntityInfo element represents the number of immediate child entities for this entity.

If the type is entityCountByType, the ChildEntityInfo element represents the total number of child entities for this entity. The type of child entities is determined by the entity type ID specified below.

Reports/Report/ComputedData/EntitySummary/Entity/ChildEntityInfos/ChildEntityInfo/@id

xs:int

1

1

ID of the entity type for which the ChildEntityInfo element provides the information. For more information on the entity IDs, refer Appendix.

Reports/Report/ComputedData/EntitySummary/Entity/CostModel

 

1

2

Represents the cost model used to calculate the cost of this entity. In cost comparison reports, this section is repeated for each selected cost model.

Reports/Report/ComputedData/EntitySummary/Entity/CostModel/@id

xs:int

1

1

ID of the cost model used to calculate the cost of this entity.

Reports/Report/ComputedData/EntitySummary/Entity/CostModel/Name

xs:string

1

1

Name of the cost model used to calculate the cost of this entity.

Reports/Report/ComputedData/EntitySummary/Entity/CostModel/EntityCost

xs:double

0

1

Entity’s cost in the hierarchical path. This does not include the child entity’s cost information.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntitySummary/Entity/CostModel/TotalCost

xs:double

0

1

Entity’s cost in the hierarchical path including the rolled up cost of child entities.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntitySummary/Entity/CostModel/Resources/Resource

 

1

unbounded

Represents the summary information for the computing resource for this report entity for the given report duration.

Reports/Report/ComputedData/EntitySummary/Entity/CostModel/Resources/Resource/@id

xs:int

1

1

ID of the computing resource.

Reports/Report/ComputedData/EntitySummary/Entity/CostModel/Resources/Resource/Name

xs:string

1

1

Name of the computing resource.

Reports/Report/ComputedData/EntitySummary/Entity/CostModel/Resources/Resource/Usage

xs:double

1

1

Usage information of the computing resource for this report entity for the given report duration.

Reports/Report/ComputedData/EntitySummary/Entity/CostModel/Resources/Resource/Cost

xs:double

0

1

Cost of the computing resource for this report entity for the given report duration.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntitySummary/Entity/CostModel/FixedCosts/FixedCost

xs:double

0

1

Fixed cost for the report entity for the given report duration.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntitySummary/Entity/CostModel/VarianceData

 

0

1

Represents the cost variance data for the given entity and for the cost model.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntitySummary/Entity/CostModel/VarianceData/Granularity

xs:string

1

1

Granularity of the data. The valid values are "HOURLY" or "DAILY".

Reports/Report/ComputedData/EntitySummary/Entity/CostModel/VarianceData/Time

xs:string

1

1

Coma separated time in milli seconds.

Reports/Report/ComputedData/EntitySummary/Entity/CostModel/VarianceData/Cost

xs:string

1

1

Coma separated cost values.

Reports/Report/ComputedData/EntityDetail/Entity

 

0

unbounded

Represents the details of the entity. If the entity has been attached to different parent entities during the report period, the element groups the details based on the parent entity.

Reports/Report/ComputedData/EntityDetail/Entity/@id

xs:int

1

1

ID of the entity

Reports/Report/ComputedData/EntityDetail/Entity/Name

xs:string

1

1

Name of the entity

Reports/Report/ComputedData/EntityDetail/Entity/Type

xs:int

1

1

Type of the entity. For details on entity types, see the Appendix.

Reports/Report/ComputedData/EntityDetail/Entity/Parents

 

1

unbounded

Represents the parent entities of an entity.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/@id

xs:int

1

1

ID of the parent entity

Reports/Report/ComputedData/EntityDetail/Entity/Parents/Name

xs:string

1

1

Name of the parent entity

Reports/Report/ComputedData/EntityDetail/Entity/Parents/Type

xs:string

1

1

Type of the parent entity. For details on entity types, see the Appendix.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel

 

 

 

Represents the cost model used to calculate the cost of this entity. in cost comparison reports, this section is repeated for each selected cost model.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/@id

xs:int

1

1

ID of the cost model used to calculate the cost of this entity.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Name

xs:string

1

1

Name of the cost model used to calculate the cost of this entity.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/EntityCost

xs:double

0

1

Entity’s cost in the hierarchical path. This does not include the child entities’ cost information.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/TotalCost

xs:double

0

1

Entity’s cost in the hierarchical path including the child entities’ cost information.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Messages

 

0

1

Represents the messages applicable for this entity.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Messages/Message

xs:string

0

unbounded

Human-readable message applicable for this entity.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Messages/Message/@priority

xs:string

1

1

Priority of the message. Can be INFO or CRITICAL.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Resources/Resource

 

1

unbounded

Represents the computing resource.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Resources/Resource/@id

xs:int

1

1

ID of the computing resource

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Resources/Resource/Name

xs:string

1

1

Name of the computing resource

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Resources/Resource/Details/Detail

 

1

unbounded

Represents the details of the computing resource from the given start time to the end time.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Resources/Resource/Details/Detail/StartTime

xs:long

1

1

The start time of the duration for which the Details section is applicable.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Resources/Resource/Details/Detail/EndTime

xs:long

1

1

The end of the duration for which the Details section is applicable.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Resources/Resource/Details/Detail/AttributionPercent

xs:double

1

1

Attribution percent applicable to the computing resource from the given start time to the end time.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Resources/Resource/Details/Detail/Duration/@id

xs:int

0

1

ID of the duration applicable from the given start time to the end time. For more details on the duration, see the Appendix.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Resources/Resource/Details/Detail/Cost

xs:double

0

1

Cost applicable to the computing resource from the given start time to the end time.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Resources/Resource/Details/Detail/Usage

xs:double

1

1

Applicable usage to the computing resource from the given start time to the end time.

This element is not available in cost and cost comparison reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Resources/Resource/Details/Detail/Slabs/Slab

1

2

Represents the base rate, rate factor and usage details for each slab (overage).

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Resources/Resource/Details/Detail/Slabs/Slab/@baseRate

xs:double

1

1

Base rate applicable in this slab.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Resources/Resource/Details/Detail/Slabs/Slab/RateFactor

1

1

Represents the rate factor applicable in this slab.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Resources/Resource/Details/Detail/Slabs/Slab/RateFactor/@value

xs:double

1

1

Value of the rate factor applicable in this slab.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Resources/Resource/Details/Detail/Slabs/Slab/RateFactor/Usage

xs:double

1

1

Usage value applicable in this slab based on the resource type.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/Resources/Resource/Details/Detail/Duration

xs:string

0

1

Duration applicable from the given start time to the end time. For more details on the duration, see the Appendix.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/FixedCosts/FixedCost

 

0

unbounded

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/FixedCosts/FixedCost/BaseRate

xs:double

1

1

Base rate applicable to the fixed cost from the given start time to the end time.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/FixedCosts/FixedCost/RateFactor

xs:double

1

1

Rate factor applicable to the fixed cost from the given start time to the end time.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/FixedCosts/FixedCost/StartTime

xs:long

1

1

The start time of the duration for which the Details section is applicable.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/FixedCosts/FixedCost/EndTime

xs:long

1

1

The end time of the duration for which the Details section is applicable.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/FixedCosts/FixedCost/AttributionPercent

xs:double

1

1

Attribution percent applicable to the fixed cost from the given start time to the end time.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/FixedCosts/FixedCost/Cost

xs:double

1

1

Cost applicable to the fixed cost from the given start time to the end time.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/FixedCosts/FixedCost/Usage

xs:double

1

1

Usage applicable to the fixed cost from the given start time to the end time. This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/FixedCosts/FixedCost/Duration

xs:string

1

1

Duration applicable from the given start time to the end time. For more details on the duration, see the Appendix.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/FixedCosts/FixedCost/Duration/@id

xs:int

1

1

ID of the duration applicable from the given start time to the end time. For more details on the duration, see the Appendix.

For a one time fixed cost, the duration ID is -1, and its value is One Time.

This element is not available in utilization reports.

Reports/Report/ComputedData/EntityDetail/Entity/Parents/CostModel/FixedCosts/FixedCost/Resource

xs:string

1

1

Name of the fixed cost.

This element is not available in utilization reports.

Sample responses are listed here:

Error Response

The following table explains the error codes displayed by the API.

Error code

Description

VCB_ERR_REP_UNSUPPORTED_EXPORT_FORMAT

You have specified an invalid export format.

VCB_ERR_REP_NOT_FOUND

Specified report does not exist.

VCB_ERR_REP_EXPORT_FILE_CLOSE

Could not close the exported report file.

VCB_ERR_REP_EXPORT_FILE_NOT_FOUND

Specified exported report does not exist.