Skip to content

Latest commit

 

History

History
322 lines (210 loc) · 10.5 KB

File metadata and controls

322 lines (210 loc) · 10.5 KB

HyperstackApi.CallbacksApi

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

Method HTTP request Description
attachCallbackToVM POST /core/virtual-machines/{vm_id}/attach-callback Attach callback to virtual machine
attachCallbackToVolume POST /core/volumes/{volume_id}/attach-callback Attach callback to volume
deleteVMCallback DELETE /core/virtual-machines/{vm_id}/delete-callback Delete virtual machine callback
deleteVolumeCallback DELETE /core/volumes/{volume_id}/delete-callback Delete volume callback
updateVMCallback PUT /core/virtual-machines/{vm_id}/update-callback Update virtual machine callback
updateVolumeCallback PUT /core/volumes/{volume_id}/update-callback Update volume callback

attachCallbackToVM

AttachCallbackResponse attachCallbackToVM(vmId, payload)

Attach callback to virtual machine

Creates a callback URL for a specified virtual machine, enabling the posting of action events executed on the virtual machine to the specified URL. Provide the callback URL in the request body and the ID of the virtual machine to which it is being attached in the path. For more details on virtual machine callback URLs, 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.CallbacksApi();
let vmId = 56; // Number | 
let payload = new HyperstackApi.AttachCallbackPayload(); // AttachCallbackPayload | 
apiInstance.attachCallbackToVM(vmId, payload).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
vmId Number
payload AttachCallbackPayload

Return type

AttachCallbackResponse

Authorization

apiKey

HTTP request headers

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

attachCallbackToVolume

AttachCallbackResponse attachCallbackToVolume(volumeId, payload)

Attach callback to volume

Creates a callback URL for a specified volume, enabling the posting of action events executed on the volume to the specified URL. Provide the callback URL in the request body and the ID of the volume to which it is being attached in the path. For more details on volume callback URLs, 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.CallbacksApi();
let volumeId = 56; // Number | 
let payload = new HyperstackApi.AttachCallbackPayload(); // AttachCallbackPayload | 
apiInstance.attachCallbackToVolume(volumeId, payload).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
volumeId Number
payload AttachCallbackPayload

Return type

AttachCallbackResponse

Authorization

apiKey

HTTP request headers

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

deleteVMCallback

ResponseModel deleteVMCallback(vmId)

Delete virtual machine callback

Permanently deletes the callback URL associated with a specified virtual machine by providing the virtual machine ID in the request path. For additional information on virtual machine callback URLs, 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.CallbacksApi();
let vmId = 56; // Number | 
apiInstance.deleteVMCallback(vmId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
vmId Number

Return type

ResponseModel

Authorization

apiKey

HTTP request headers

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

deleteVolumeCallback

ResponseModel deleteVolumeCallback(volumeId)

Delete volume callback

Permanently deletes the callback URL associated with a specified volume by providing the volume ID in the request path. For additional information on volume callback URLs, 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.CallbacksApi();
let volumeId = 56; // Number | 
apiInstance.deleteVolumeCallback(volumeId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
volumeId Number

Return type

ResponseModel

Authorization

apiKey

HTTP request headers

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

updateVMCallback

AttachCallbackResponse updateVMCallback(vmId, payload)

Update virtual machine callback

Updates the callback URL for a specified virtual machine. Provide the new callback URL in the request body, along with the ID of the associated virtual machine in the path. For additional information on virtual machine callback URLs, 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.CallbacksApi();
let vmId = 56; // Number | 
let payload = new HyperstackApi.AttachCallbackPayload(); // AttachCallbackPayload | 
apiInstance.updateVMCallback(vmId, payload).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
vmId Number
payload AttachCallbackPayload

Return type

AttachCallbackResponse

Authorization

apiKey

HTTP request headers

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

updateVolumeCallback

AttachCallbackResponse updateVolumeCallback(volumeId, payload)

Update volume callback

Updates the callback URL for a specified volume. Provide the new callback URL in the request body, along with the ID of the associated volume in the path. For additional information on volume callback URLs, 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.CallbacksApi();
let volumeId = 56; // Number | 
let payload = new HyperstackApi.AttachCallbackPayload(); // AttachCallbackPayload | 
apiInstance.updateVolumeCallback(volumeId, payload).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
volumeId Number
payload AttachCallbackPayload

Return type

AttachCallbackResponse

Authorization

apiKey

HTTP request headers

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