Error "TypeError:Failed to fetch" when exporting a bill from Chargeback API in Aria Operations
search cancel

Error "TypeError:Failed to fetch" when exporting a bill from Chargeback API in Aria Operations

book

Article ID: 412960

calendar_today

Updated On:

Products

VCF Operations/Automation (formerly VMware Aria Suite)

Issue/Introduction

  • VMware Cloud Director(VCD) OrgVDC bills are created Aria Operations via the Generating Bills process.
  • Attempting to export the bill from Swagger using the following API fails with error " TypeError: Failed to fetch" and a test bill is exported:





Environment

Aria Operations 8.18.x

Cause

This issue occurs when the Bill Id provided in the API is not valid.

Resolution

To export the Bills from API, perform the following actions:

  1. Access Aria Operations Swagger - https://Aria-operations_ip_or_fqdn/suite-api
  2. Locate the API  'POST /api/chargeback/bills/query' under 'Chargeback Billing' :




    Note: In 'Request body', we can use any one of the following 'key' and 'value': 




  3. In this example, we will use the key as ''RESOURCE_NAME' and the value as 'VCD OrgVDC name':

    Required fields: Bill start, end timestamp in Unix EPOCH format, key and value. 



  4. The API(in step.3)  will respond with a detailed list of all the Bills associated with the OrgVDC, including their Bill Ids for reference.
  5. Using the Bill Id captured in step.4,  export a detailed bill using the API 'GET /api/chargeback/bills/Id' below: