All URIs are relative to https://infrahub-api.nexgencloud.com/v1
| Method | HTTP request | Description |
|---|---|---|
| createVolume | POST /core/volumes | Create volume |
| deleteVolume | DELETE /core/volumes/{volume_id} | Delete volume |
| fetchVolumeNameAvailability | GET /core/volume/name-availability/{name} | Fetch volume name availability |
| getVolume | GET /core/volumes/{volume_id} | Fetch Volume Details |
| listVolumeTypes | GET /core/volume-types | List volume types |
| listVolumes | GET /core/volumes | List volumes |
| updateVolume | PATCH /core/volumes/{volume_id} | Update volume fields |
Volume createVolume(payload)
Create volume
Creates a volume that can be attached to a virtual machine, expanding its storage capacity. Specify the volume type and custom configuration in the request body. For additional details on volumes, 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.VolumeApi();
let payload = new HyperstackApi.CreateVolumePayload(); // CreateVolumePayload |
apiInstance.createVolume(payload).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| payload | CreateVolumePayload |
- Content-Type: application/json
- Accept: application/json
ResponseModel deleteVolume(volumeId)
Delete volume
Deletes a volume permanently. Provide the volume ID in the path to specify the volume to be deleted.
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.VolumeApi();
let volumeId = 56; // Number |
apiInstance.deleteVolume(volumeId).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| volumeId | Number |
- Content-Type: Not defined
- Accept: application/json
NameAvailableModel fetchVolumeNameAvailability(name)
Fetch volume name availability
Check if a Volume name is available
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.VolumeApi();
let name = "name_example"; // String |
apiInstance.fetchVolumeNameAvailability(name).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| name | String |
- Content-Type: Not defined
- Accept: application/json
Volume getVolume(volumeId)
Fetch Volume Details
Fetch volume details for specific volume. This endpoint returns id, name, volume size, volume type, status, description, image_id, os_image, created_at, updated_at etc.
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.VolumeApi();
let volumeId = 56; // Number |
apiInstance.getVolume(volumeId).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| volumeId | Number |
- Content-Type: Not defined
- Accept: application/json
VolumeTypes listVolumeTypes()
List volume types
Retrieves a list of available volume types that can be used in the creation of a new volume.
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.VolumeApi();
apiInstance.listVolumeTypes().then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
Volumes listVolumes(opts)
List volumes
Returns a list of your existing volumes, providing details for each. For more information on volumes, 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.VolumeApi();
let opts = {
'page': "page_example", // String | Page Number
'pageSize': "pageSize_example", // String | Data Per Page
'search': "search_example", // String |
'environment': "environment_example" // String | Filter Environment ID or Name
};
apiInstance.listVolumes(opts).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| page | String | Page Number | [optional] |
| pageSize | String | Data Per Page | [optional] |
| search | String | [optional] | |
| environment | String | Filter Environment ID or Name | [optional] |
- Content-Type: Not defined
- Accept: application/json
UpdateVolumeResponse updateVolume(volumeId, payload)
Update volume fields
Update volume properties. Currently supports updating the environment by providing 'environment_name'. The volume must not be attached to any instance when changing environments, and the target environment must be in the same region.
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.VolumeApi();
let volumeId = 56; // Number |
let payload = new HyperstackApi.UpdateVolumePayload(); // UpdateVolumePayload |
apiInstance.updateVolume(volumeId, payload).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| volumeId | Number | ||
| payload | UpdateVolumePayload |
- Content-Type: application/json
- Accept: application/json