# HivelocityApi.SshKeyApi

All URIs are relative to *https://localhost/api/v2*

Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteSshKeyIdResource**](SshKeyApi.md#deleteSshKeyIdResource) | **DELETE** /ssh_key/{sshKeyId} | Removes public ssh key
[**getSshKeyIdResource**](SshKeyApi.md#getSshKeyIdResource) | **GET** /ssh_key/{sshKeyId} | Get public ssh key
[**getSshKeyResource**](SshKeyApi.md#getSshKeyResource) | **GET** /ssh_key/ | Gets all public ssh key
[**postSshKeyResource**](SshKeyApi.md#postSshKeyResource) | **POST** /ssh_key/ | Adds public ssh key
[**putSshKeyIdResource**](SshKeyApi.md#putSshKeyIdResource) | **PUT** /ssh_key/{sshKeyId} | Updates public ssh key


<a name="deleteSshKeyIdResource"></a>
# **deleteSshKeyIdResource**
> deleteSshKeyIdResource(sshKeyId)

Removes public ssh key

### Example
```javascript
var HivelocityApi = require('hivelocity_api');
var defaultClient = HivelocityApi.ApiClient.instance;

// Configure API key authorization: apiKey
var 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';

var apiInstance = new HivelocityApi.SshKeyApi();

var sshKeyId = 56; // Number | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.deleteSshKeyIdResource(sshKeyId, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **sshKeyId** | **Number**|  | 

### Return type

null (empty response body)

### Authorization

[apiKey](../README.md#apiKey)

### HTTP request headers

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

<a name="getSshKeyIdResource"></a>
# **getSshKeyIdResource**
> SshKeyResponse getSshKeyIdResource(sshKeyId, opts)

Get public ssh key

### Example
```javascript
var HivelocityApi = require('hivelocity_api');
var defaultClient = HivelocityApi.ApiClient.instance;

// Configure API key authorization: apiKey
var 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';

var apiInstance = new HivelocityApi.SshKeyApi();

var sshKeyId = 56; // Number | 

var opts = { 
  'xFields': "xFields_example" // String | An optional fields mask
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getSshKeyIdResource(sshKeyId, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **sshKeyId** | **Number**|  | 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**SshKeyResponse**](SshKeyResponse.md)

### Authorization

[apiKey](../README.md#apiKey)

### HTTP request headers

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

<a name="getSshKeyResource"></a>
# **getSshKeyResource**
> [SshKeyResponse] getSshKeyResource(opts)

Gets all public ssh key

### Example
```javascript
var HivelocityApi = require('hivelocity_api');
var defaultClient = HivelocityApi.ApiClient.instance;

// Configure API key authorization: apiKey
var 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';

var apiInstance = new HivelocityApi.SshKeyApi();

var opts = { 
  'xFields': "xFields_example" // String | An optional fields mask
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getSshKeyResource(opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**[SshKeyResponse]**](SshKeyResponse.md)

### Authorization

[apiKey](../README.md#apiKey)

### HTTP request headers

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

<a name="postSshKeyResource"></a>
# **postSshKeyResource**
> SshKeyResponse postSshKeyResource(payload, opts)

Adds public ssh key

### Example
```javascript
var HivelocityApi = require('hivelocity_api');
var defaultClient = HivelocityApi.ApiClient.instance;

// Configure API key authorization: apiKey
var 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';

var apiInstance = new HivelocityApi.SshKeyApi();

var payload = new HivelocityApi.SshKey(); // SshKey | 

var opts = { 
  'xFields': "xFields_example" // String | An optional fields mask
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.postSshKeyResource(payload, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **payload** | [**SshKey**](SshKey.md)|  | 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**SshKeyResponse**](SshKeyResponse.md)

### Authorization

[apiKey](../README.md#apiKey)

### HTTP request headers

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

<a name="putSshKeyIdResource"></a>
# **putSshKeyIdResource**
> SshKeyResponse putSshKeyIdResource(sshKeyIdpayload, opts)

Updates public ssh key

### Example
```javascript
var HivelocityApi = require('hivelocity_api');
var defaultClient = HivelocityApi.ApiClient.instance;

// Configure API key authorization: apiKey
var 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';

var apiInstance = new HivelocityApi.SshKeyApi();

var sshKeyId = 56; // Number | 

var payload = new HivelocityApi.SshKeyUpdate(); // SshKeyUpdate | 

var opts = { 
  'xFields': "xFields_example" // String | An optional fields mask
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.putSshKeyIdResource(sshKeyIdpayload, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **sshKeyId** | **Number**|  | 
 **payload** | [**SshKeyUpdate**](SshKeyUpdate.md)|  | 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**SshKeyResponse**](SshKeyResponse.md)

### Authorization

[apiKey](../README.md#apiKey)

### HTTP request headers

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

