Skip to content

Latest commit

 

History

History
61 lines (39 loc) · 1.73 KB

File metadata and controls

61 lines (39 loc) · 1.73 KB

HyperstackApi.CalculateApi

All URIs are relative to https://infrahub-api.nexgencloud.com/v1

Method HTTP request Description
calculateResourceBillingRate GET /pricebook/calculate/resource/{resource_type}/{id} Retrieve Billing Rate for Resource

calculateResourceBillingRate

ResourceBillingResponseForCustomer calculateResourceBillingRate(resourceType, id)

Retrieve Billing Rate for Resource

Calculate the hourly billing rate of a specified resource by including the resource ID in the path.

Example

import HyperstackApi from '@nexgencloud/hyperstack-sdk-javascript';
let defaultClient = HyperstackApi.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

let apiInstance = new HyperstackApi.CalculateApi();
let resourceType = "resourceType_example"; // String | 
let id = 56; // Number | 
apiInstance.calculateResourceBillingRate(resourceType, id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
resourceType String
id Number

Return type

ResourceBillingResponseForCustomer

Authorization

apiKey

HTTP request headers

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