Skip to content

Latest commit

 

History

History
867 lines (573 loc) · 22.7 KB

File metadata and controls

867 lines (573 loc) · 22.7 KB

HyperstackApi.ClustersApi

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

Method HTTP request Description
createCluster POST /core/clusters Create Cluster
createNode POST /core/clusters/{cluster_id}/nodes Create Node
createNodeGroup POST /core/clusters/{cluster_id}/node-groups Create a node group in a cluster
deleteCluster DELETE /core/clusters/{id} Delete a cluster
deleteClusterNode DELETE /core/clusters/{cluster_id}/nodes/{node_id} Delete Cluster Node
deleteClusterNodes POST /core/clusters/{cluster_id}/nodes/delete Delete Multiple Cluster Nodes
deleteNodeGroup DELETE /core/clusters/{cluster_id}/node-groups/{node_group_id} Delete a node group
fetchClusterNameAvailability GET /core/clusters/name-availability/{name} Fetch cluster name availability
getClusterMasterFlavors GET /core/clusters/master-flavors Get Cluster Master Flavors
getClusterNodes GET /core/clusters/{cluster_id}/nodes Get Cluster Nodes
getClusterVersions GET /core/clusters/versions List Cluster Versions
getNodeGroup GET /core/clusters/{cluster_id}/node-groups/{node_group_id} Retrieve a node group in a cluster
gettingClusterDetail GET /core/clusters/{id} Getting Cluster Detail
listClusters GET /core/clusters List Clusters
listNodeGroups GET /core/clusters/{cluster_id}/node-groups List node groups for a cluster
reconcileCluster POST /core/clusters/{cluster_id}/reconcile Reconcile a cluster
updateNodeGroup PATCH /core/clusters/{cluster_id}/node-groups/{node_group_id} Update a node group in a cluster

createCluster

ClusterResponse createCluster(payload)

Create Cluster

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

Parameters

Name Type Description Notes
payload CreateClusterPayload

Return type

ClusterResponse

Authorization

apiKey

HTTP request headers

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

createNode

ClusterNodesListResponse createNode(clusterId, payload)

Create Node

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.ClustersApi();
let clusterId = 56; // Number | 
let payload = new HyperstackApi.CreateClusterNodeFields(); // CreateClusterNodeFields | 
apiInstance.createNode(clusterId, payload).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
clusterId Number
payload CreateClusterNodeFields

Return type

ClusterNodesListResponse

Authorization

apiKey

HTTP request headers

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

createNodeGroup

ClusterNodeGroupsCreateResponse createNodeGroup(clusterId, payload)

Create a node group in a cluster

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.ClustersApi();
let clusterId = 56; // Number | 
let payload = new HyperstackApi.CreateClusterNodeGroupPayload(); // CreateClusterNodeGroupPayload | 
apiInstance.createNodeGroup(clusterId, payload).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
clusterId Number
payload CreateClusterNodeGroupPayload

Return type

ClusterNodeGroupsCreateResponse

Authorization

apiKey

HTTP request headers

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

deleteCluster

ResponseModel deleteCluster(id)

Delete a cluster

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.ClustersApi();
let id = 56; // Number | 
apiInstance.deleteCluster(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

deleteClusterNode

ResponseModel deleteClusterNode(clusterId, nodeId)

Delete Cluster Node

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

Parameters

Name Type Description Notes
clusterId Number
nodeId Number

Return type

ResponseModel

Authorization

apiKey

HTTP request headers

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

deleteClusterNodes

ResponseModel deleteClusterNodes(clusterId, payload)

Delete Multiple Cluster Nodes

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.ClustersApi();
let clusterId = 56; // Number | 
let payload = new HyperstackApi.DeleteClusterNodesFields(); // DeleteClusterNodesFields | 
apiInstance.deleteClusterNodes(clusterId, payload).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
clusterId Number
payload DeleteClusterNodesFields

Return type

ResponseModel

Authorization

apiKey

HTTP request headers

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

deleteNodeGroup

ResponseModel deleteNodeGroup(clusterId, nodeGroupId)

Delete a node group

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

Parameters

Name Type Description Notes
clusterId Number
nodeGroupId Number

Return type

ResponseModel

Authorization

apiKey

HTTP request headers

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

fetchClusterNameAvailability

NameAvailableModel fetchClusterNameAvailability(name)

Fetch cluster name availability

Check if a Cluster name is available

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.ClustersApi();
let name = "name_example"; // String | 
apiInstance.fetchClusterNameAvailability(name).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
name String

Return type

NameAvailableModel

Authorization

apiKey

HTTP request headers

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

getClusterMasterFlavors

MasterFlavorsResponse getClusterMasterFlavors()

Get Cluster Master Flavors

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

Parameters

This endpoint does not need any parameter.

Return type

MasterFlavorsResponse

Authorization

apiKey

HTTP request headers

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

getClusterNodes

ClusterNodesListResponse getClusterNodes(clusterId)

Get Cluster Nodes

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

Parameters

Name Type Description Notes
clusterId Number

Return type

ClusterNodesListResponse

Authorization

apiKey

HTTP request headers

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

getClusterVersions

ClusterVersions getClusterVersions(opts)

List Cluster Versions

Lists available Kubernetes versions, optionally filtered by region.

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.ClustersApi();
let opts = {
  'region': "region_example" // String | Filter versions by region name (optional)
};
apiInstance.getClusterVersions(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
region String Filter versions by region name (optional) [optional]

Return type

ClusterVersions

Authorization

apiKey

HTTP request headers

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

getNodeGroup

ClusterNodeGroupsGetResponse getNodeGroup(clusterId, nodeGroupId)

Retrieve a node group in a cluster

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

Parameters

Name Type Description Notes
clusterId Number
nodeGroupId Number

Return type

ClusterNodeGroupsGetResponse

Authorization

apiKey

HTTP request headers

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

gettingClusterDetail

ClusterResponse gettingClusterDetail(id)

Getting Cluster Detail

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

Parameters

Name Type Description Notes
id Number

Return type

ClusterResponse

Authorization

apiKey

HTTP request headers

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

listClusters

ClusterListResponse listClusters(opts)

List Clusters

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.ClustersApi();
let opts = {
  'page': 56, // Number | Page number for pagination
  'pageSize': 56, // Number | Number of items per page
  'environment': "environment_example", // String | Environment Filter
  'search': "search_example" // String | Search query to filter cluster by name
};
apiInstance.listClusters(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
page Number Page number for pagination [optional]
pageSize Number Number of items per page [optional]
environment String Environment Filter [optional]
search String Search query to filter cluster by name [optional]

Return type

ClusterListResponse

Authorization

apiKey

HTTP request headers

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

listNodeGroups

ClusterNodeGroupsListResponse listNodeGroups(clusterId)

List node groups for a cluster

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

Parameters

Name Type Description Notes
clusterId Number

Return type

ClusterNodeGroupsListResponse

Authorization

apiKey

HTTP request headers

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

reconcileCluster

ManualReconciliationModel reconcileCluster(clusterId)

Reconcile a cluster

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

Parameters

Name Type Description Notes
clusterId Number

Return type

ManualReconciliationModel

Authorization

apiKey

HTTP request headers

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

updateNodeGroup

ClusterNodeGroupsCreateResponse updateNodeGroup(clusterId, nodeGroupId, payload)

Update a node group in a cluster

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.ClustersApi();
let clusterId = 56; // Number | 
let nodeGroupId = 56; // Number | 
let payload = new HyperstackApi.UpdateClusterNodeGroupPayload(); // UpdateClusterNodeGroupPayload | 
apiInstance.updateNodeGroup(clusterId, nodeGroupId, payload).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
clusterId Number
nodeGroupId Number
payload UpdateClusterNodeGroupPayload

Return type

ClusterNodeGroupsCreateResponse

Authorization

apiKey

HTTP request headers

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