Skip to content

Latest commit

 

History

History
208 lines (133 loc) · 5.68 KB

File metadata and controls

208 lines (133 loc) · 5.68 KB

HyperstackApi.ProfileApi

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

Method HTTP request Description
createProfile POST /core/profiles Create profile
deleteProfile DELETE /core/profiles/{id} Delete profile
getProfile GET /core/profiles/{id} Retrieve profile details
listProfiles GET /core/profiles List profiles

createProfile

CreateProfileResponse createProfile(payload)

Create profile

Creates a provisioning profile to save the configuration of a virtual machinefor future use. Include the profile name, description, and virtual machine configuration details in the request body. For more information about virtual machine profiles,click here.

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.ProfileApi();
let payload = new HyperstackApi.CreateProfilePayload(); // CreateProfilePayload | 
apiInstance.createProfile(payload).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
payload CreateProfilePayload

Return type

CreateProfileResponse

Authorization

apiKey

HTTP request headers

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

deleteProfile

ResponseModel deleteProfile(id)

Delete profile

Permanently deletes a provisioning profile. Supply the profile ID in the path to delete the specified profile.

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.ProfileApi();
let id = 56; // Number | 
apiInstance.deleteProfile(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number

Return type

ResponseModel

Authorization

apiKey

HTTP request headers

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

getProfile

CreateProfileResponse getProfile(id)

Retrieve profile details

Retrieves details for an existing provisioning profile by supplying the profile ID in the request path. For more information about profiles, click here.

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.ProfileApi();
let id = 56; // Number | 
apiInstance.getProfile(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number

Return type

CreateProfileResponse

Authorization

apiKey

HTTP request headers

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

listProfiles

ProfileListResponse listProfiles()

List profiles

Returns a list of your existing provisioning profiles, providing virtual machine configuration details for each. For additional information about profiles,click here.

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.ProfileApi();
apiInstance.listProfiles().then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

ProfileListResponse

Authorization

apiKey

HTTP request headers

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