Skip to content

Latest commit

 

History

History
168 lines (111 loc) · 4.47 KB

CostsApi.md

File metadata and controls

168 lines (111 loc) · 4.47 KB

Vantage.CostsApi

All URIs are relative to https://api.vantage.sh

Method HTTP request Description
getCosts GET /v1/reports/{report_id}/costs
getReport GET /v1/reports/{report_id}
getReports GET /v1/reports

getCosts

Costs getCosts(reportId, opts)

Return available Costs for the specified Cost Report and optional time period. If no time period is specified it will return all available costs for the report.

Example

import {Vantage} from 'vantage';
let defaultClient = Vantage.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Vantage.CostsApi();

let reportId = "reportId_example"; // String | 

let opts = { 
  'startDate': "startDate_example", // String | Query costs by the first date you would like to filter from. ISO 8601 Formatted - 2021-07-15 or 2021-07-15T19:20:48+00:00.
  'endDate': "endDate_example", // String | Query costs by the last date you would like to filter to. ISO 8601 Formatted - 2021-07-15 or 2021-07-15T19:20:48+00:00.
  'page': 2, // Number | The page of results to return.
  'limit': 500 // Number | The amount of results to return. The maximum is 1000
};
apiInstance.getCosts(reportId, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
reportId String
startDate String Query costs by the first date you would like to filter from. ISO 8601 Formatted - 2021-07-15 or 2021-07-15T19:20:48+00:00. [optional]
endDate String Query costs by the last date you would like to filter to. ISO 8601 Formatted - 2021-07-15 or 2021-07-15T19:20:48+00:00. [optional]
page Number The page of results to return. [optional]
limit Number The amount of results to return. The maximum is 1000 [optional]

Return type

Costs

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getReport

Report getReport(reportId)

Return a Cost Report.

Example

import {Vantage} from 'vantage';
let defaultClient = Vantage.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Vantage.CostsApi();

let reportId = "reportId_example"; // String | 

apiInstance.getReport(reportId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
reportId String

Return type

Report

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getReports

Reports getReports(opts)

Return all Cost Reports.

Example

import {Vantage} from 'vantage';
let defaultClient = Vantage.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Vantage.CostsApi();

let opts = { 
  'page': 56, // Number | The page of results to return.
  'limit': 56 // Number | The amount of results to return. The maximum is 1000
};
apiInstance.getReports(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
page Number The page of results to return. [optional]
limit Number The amount of results to return. The maximum is 1000 [optional]

Return type

Reports

Authorization

oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json