Skip to content

Latest commit

 

History

History
112 lines (72 loc) · 3.12 KB

File metadata and controls

112 lines (72 loc) · 3.12 KB

HyperstackApi.VncUrlApi

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

Method HTTP request Description
getVNCURL GET /core/virtual-machines/{vm_id}/console/{job_id} Get VNC Console Link
requestVMConsole GET /core/virtual-machines/{vm_id}/request-console Request Instance Console

getVNCURL

VNCURL getVNCURL(vmId, jobId)

Get VNC Console Link

Retrieves the URL to access the VNC console for a specified virtual machine by providing the virtual machine ID and the job ID in the path. For more information, 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.VncUrlApi();
let vmId = 56; // Number | 
let jobId = 56; // Number | 
apiInstance.getVNCURL(vmId, jobId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
vmId Number
jobId Number

Return type

VNCURL

Authorization

apiKey

HTTP request headers

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

requestVMConsole

RequestConsole requestVMConsole(vmId)

Request Instance Console

Retrieves the path of the VNC console for the given virtual machine ID by providing the virtual machine ID in the path. For more information, 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.VncUrlApi();
let vmId = 56; // Number | 
apiInstance.requestVMConsole(vmId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
vmId Number

Return type

RequestConsole

Authorization

apiKey

HTTP request headers

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