Skip to content

Latest commit

 

History

History
223 lines (142 loc) · 6.37 KB

File metadata and controls

223 lines (142 loc) · 6.37 KB

\CustomerContractAPI

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

GetContractGPUAllocationGraph

ContractGPUAllocationGraphResponse GetContractGPUAllocationGraph(ctx, contractId).StartDate(startDate).EndDate(endDate).Execute()

Retrieve GPU Allocation Graph for Contract

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)

func main() {
	contractId := int32(56) // int32 | 
	startDate := "startDate_example" // string | Date should be formatted in YYYY-MM-DDTHH:MM:SS (optional)
	endDate := "endDate_example" // string | Date should be formatted in YYYY-MM-DDTHH:MM:SS (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.CustomerContractAPI.GetContractGPUAllocationGraph(context.Background(), contractId).StartDate(startDate).EndDate(endDate).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `CustomerContractAPI.GetContractGPUAllocationGraph``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetContractGPUAllocationGraph`: ContractGPUAllocationGraphResponse
	fmt.Fprintf(os.Stdout, "Response from `CustomerContractAPI.GetContractGPUAllocationGraph`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
contractId int32

Other Parameters

Other parameters are passed through a pointer to a apiGetContractGPUAllocationGraphRequest struct via the builder pattern

Name Type Description Notes

startDate | string | Date should be formatted in YYYY-MM-DDTHH:MM:SS | endDate | string | Date should be formatted in YYYY-MM-DDTHH:MM:SS |

Return type

ContractGPUAllocationGraphResponse

Authorization

apiKey

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListCustomerContracts

GetCustomerContractsListResponseModel ListCustomerContracts(ctx).Page(page).PerPage(perPage).Execute()

List Contracts

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)

func main() {
	page := int32(56) // int32 |  (optional)
	perPage := int32(56) // int32 |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.CustomerContractAPI.ListCustomerContracts(context.Background()).Page(page).PerPage(perPage).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `CustomerContractAPI.ListCustomerContracts``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListCustomerContracts`: GetCustomerContractsListResponseModel
	fmt.Fprintf(os.Stdout, "Response from `CustomerContractAPI.ListCustomerContracts`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiListCustomerContractsRequest struct via the builder pattern

Name Type Description Notes
page int32
perPage int32

Return type

GetCustomerContractsListResponseModel

Authorization

apiKey

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RetrieveContract

CustomerContractDetailResponseModel RetrieveContract(ctx, contractId).Execute()

Retrieve Contract Details

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/NexGenCloud/hyperstack-sdk-go/hyperstack"
)

func main() {
	contractId := int32(56) // int32 | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.CustomerContractAPI.RetrieveContract(context.Background(), contractId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `CustomerContractAPI.RetrieveContract``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `RetrieveContract`: CustomerContractDetailResponseModel
	fmt.Fprintf(os.Stdout, "Response from `CustomerContractAPI.RetrieveContract`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
contractId int32

Other Parameters

Other parameters are passed through a pointer to a apiRetrieveContractRequest struct via the builder pattern

Name Type Description Notes

Return type

CustomerContractDetailResponseModel

Authorization

apiKey

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]