All URIs are relative to https://infrahub-api.nexgencloud.com/v1
| Method | HTTP request | Description |
|---|---|---|
| getContractGPUAllocationGraph | GET /pricebook/contracts/{contract_id}/gpu_allocation_graph | Retrieve GPU Allocation Graph for Contract |
| listCustomerContracts | GET /pricebook/contracts | List Contracts |
| retrieveContract | GET /pricebook/contracts/{contract_id} | Retrieve Contract Details |
ContractGPUAllocationGraphResponse getContractGPUAllocationGraph(contractId, opts)
Retrieve GPU Allocation Graph for Contract
Retrieve GPU allocation count graph for a specific contract by providing the contract ID in the path. The endpoint returns the GPU allocation count graph for the contract within the specified date range.
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.CustomerContractApi();
let contractId = 56; // Number |
let opts = {
'startDate': "startDate_example", // String | Date should be formatted in YYYY-MM-DDTHH:MM:SS
'endDate': "endDate_example" // String | Date should be formatted in YYYY-MM-DDTHH:MM:SS
};
apiInstance.getContractGPUAllocationGraph(contractId, opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| contractId | Number | ||
| startDate | String | Date should be formatted in YYYY-MM-DDTHH:MM:SS | [optional] |
| endDate | String | Date should be formatted in YYYY-MM-DDTHH:MM:SS | [optional] |
ContractGPUAllocationGraphResponse
- Content-Type: Not defined
- Accept: application/json
GetCustomerContractsListResponseModel listCustomerContracts(opts)
List Contracts
Retrieves a list of contracts and their details, including the terms of each contract and the discounts applied to all resources under each contract. Pagination can be controlled using the `page` and `per_page` query parameters. For additional information about contracts, click here.
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.CustomerContractApi();
let opts = {
'page': 56, // Number |
'perPage': 56 // Number |
};
apiInstance.listCustomerContracts(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| page | Number | [optional] | |
| perPage | Number | [optional] |
GetCustomerContractsListResponseModel
- Content-Type: Not defined
- Accept: application/json
CustomerContractDetailResponseModel retrieveContract(contractId)
Retrieve Contract Details
Retrieve details of a specific contract by providing the contract ID in the path. The endpoint returns the contract object along with its associated discount plans. For more information, click here.
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.CustomerContractApi();
let contractId = 56; // Number |
apiInstance.retrieveContract(contractId).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| contractId | Number |
CustomerContractDetailResponseModel
- Content-Type: Not defined
- Accept: application/json