All URIs are relative to https://infrahub-api.nexgencloud.com/v1
| Method | HTTP request | Description |
|---|---|---|
| createEnvironment | POST /core/environments | Create environment |
| deleteEnvironment | DELETE /core/environments/{id} | Delete environment |
| fetchEnvironmentNameAvailability | GET /core/environments/name-availability/{name} | Fetch environment name availability |
| getEnvironment | GET /core/environments/{id} | Retrieve environment |
| getEnvironmentVMQuota | GET /core/environments/{id}/vm-quota | Get environment VM quota |
| listEnvironments | GET /core/environments | List environments |
| updateEnvironment | PUT /core/environments/{id} | Update environment |
Environment createEnvironment(payload)
Create environment
Creates an environment—a container to organize your resources, including SSH key pairs, virtual machines, and volumes. To create your environment, provide your desired environment name, and region in the request body.
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.EnvironmentApi();
let payload = new HyperstackApi.CreateEnvironment(); // CreateEnvironment |
apiInstance.createEnvironment(payload).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| payload | CreateEnvironment |
- Content-Type: application/json
- Accept: application/json
ResponseModel deleteEnvironment(id)
Delete environment
Deletes an environment permanently. Provide the environment ID in the path to remove the specified environment.
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.EnvironmentApi();
let id = 56; // Number |
apiInstance.deleteEnvironment(id).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| id | Number |
- Content-Type: Not defined
- Accept: application/json
NameAvailableModel fetchEnvironmentNameAvailability(name)
Fetch environment name availability
Check if a Environment 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.EnvironmentApi();
let name = "name_example"; // String |
apiInstance.fetchEnvironmentNameAvailability(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
Environment getEnvironment(id)
Retrieve environment
Retrieves details about a specific environment. Provide the environment ID in the path and the new environment `name` in the request body to modify the specified environment.
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.EnvironmentApi();
let id = 56; // Number |
apiInstance.getEnvironment(id).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| id | Number |
- Content-Type: Not defined
- Accept: application/json
VMQuota getEnvironmentVMQuota(id)
Get environment VM quota
Retrieves VM quota information for a specific environment, including current VM count, maximum VMs allowed, available VMs, and percentage used in an environment before reaching the subnet IP limit.
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.EnvironmentApi();
let id = 56; // Number |
apiInstance.getEnvironmentVMQuota(id).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| id | Number |
- Content-Type: Not defined
- Accept: application/json
Environments listEnvironments(opts)
List environments
Returns a list of your existing environments, providing the following details for each; environment ID, name, region, and the date and time of creation. For more information on environments, 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.EnvironmentApi();
let opts = {
'page': "page_example", // String | Page Number
'pageSize': "pageSize_example", // String | Data Per Page
'search': "search_example" // String | Search By ID or Name or Region
};
apiInstance.listEnvironments(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 | Search By ID or Name or Region | [optional] |
- Content-Type: Not defined
- Accept: application/json
Environment updateEnvironment(id, payload)
Update environment
Updates the name of an existing environment. Provide the environment ID in the path and the new environment `name` in the request body to modify the specified environment.
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.EnvironmentApi();
let id = 56; // Number |
let payload = new HyperstackApi.UpdateEnvironment(); // UpdateEnvironment |
apiInstance.updateEnvironment(id, payload).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});| Name | Type | Description | Notes |
|---|---|---|---|
| id | Number | ||
| payload | UpdateEnvironment |
- Content-Type: application/json
- Accept: application/json