Skip to content

Latest commit

 

History

History
220 lines (144 loc) · 6.02 KB

File metadata and controls

220 lines (144 loc) · 6.02 KB

HyperstackApi.KeypairApi

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

Method HTTP request Description
deleteKeyPair DELETE /core/keypair/{id} Delete key pair
importKeyPair POST /core/keypairs Import key pair
listKeyPairs GET /core/keypairs List key pairs
updateKeyPairName PUT /core/keypair/{id} Update key pair name

deleteKeyPair

ResponseModel deleteKeyPair(id)

Delete key pair

Permanently deletes a specified key pair. Provide the key pair ID in the path to remove the designated key pair.

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

importKeyPair

ImportKeypairResponse importKeyPair(payload)

Import key pair

Imports a new key pair for secure shell (SSH) access to your resources. Provide the key name, environment name, and public key in the request body. For more details on importing SSH key pairs, 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.KeypairApi();
let payload = new HyperstackApi.ImportKeypairPayload(); // ImportKeypairPayload | 
apiInstance.importKeyPair(payload).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
payload ImportKeypairPayload

Return type

ImportKeypairResponse

Authorization

apiKey

HTTP request headers

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

listKeyPairs

Keypairs listKeyPairs(opts)

List key pairs

Retrieves a list of your existing SSH key pairs, providing details for each. For more information on SSH key pairs, 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.KeypairApi();
let opts = {
  'page': "page_example", // String | Page Number
  'pageSize': "pageSize_example", // String | Data Per Page
  'search': "search_example" // String | 
};
apiInstance.listKeyPairs(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
page String Page Number [optional]
pageSize String Data Per Page [optional]
search String [optional]

Return type

Keypairs

Authorization

apiKey

HTTP request headers

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

updateKeyPairName

UpdateKeypairNameResponse updateKeyPairName(id, payload)

Update key pair name

Updates the name of a specified key pair. Provide the key pair ID in the path, and include the new `name` in the request body.

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

Parameters

Name Type Description Notes
id Number
payload UpdateKeypairName

Return type

UpdateKeypairNameResponse

Authorization

apiKey

HTTP request headers

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