# HivelocityApi.BareMetalDevicesApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**deleteBareMetalDeviceIdResource**](BareMetalDevicesApi.md#deleteBareMetalDeviceIdResource) | **DELETE** /bare-metal-devices/{deviceId} | Cancel the specified bare metal device
[**getBareMetalDeviceIdResource**](BareMetalDevicesApi.md#getBareMetalDeviceIdResource) | **GET** /bare-metal-devices/{deviceId} | Return bare metal device
[**getBareMetalDeviceResource**](BareMetalDevicesApi.md#getBareMetalDeviceResource) | **GET** /bare-metal-devices/ | Return a list with all servers as bare metal
[**postBareMetalDeviceResource**](BareMetalDevicesApi.md#postBareMetalDeviceResource) | **POST** /bare-metal-devices/ | Deploy a new bare metal server
[**putBareMetalDeviceIdResource**](BareMetalDevicesApi.md#putBareMetalDeviceIdResource) | **PUT** /bare-metal-devices/{deviceId} | Update a bare metal device


<a name="deleteBareMetalDeviceIdResource"></a>
# **deleteBareMetalDeviceIdResource**
> deleteBareMetalDeviceIdResource(deviceId, opts)

Cancel the specified bare metal device

### 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.BareMetalDevicesApi();

var deviceId = 56; // Number | 

var opts = { 
  'deploymentId': "deploymentId_example" // String | Id of the deployment to interact with
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **deviceId** | **Number**|  | 
 **deploymentId** | **String**| Id of the deployment to interact with | [optional] 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

<a name="getBareMetalDeviceIdResource"></a>
# **getBareMetalDeviceIdResource**
> BareMetalDevice getBareMetalDeviceIdResource(deviceId, opts)

Return bare metal device

### 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.BareMetalDevicesApi();

var deviceId = 56; // Number | 

var opts = { 
  'deploymentId': "deploymentId_example" // String | Id of the deployment to interact with
  '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.getBareMetalDeviceIdResource(deviceId, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **deviceId** | **Number**|  | 
 **deploymentId** | **String**| Id of the deployment to interact with | [optional] 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**BareMetalDevice**](BareMetalDevice.md)

### Authorization

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

### HTTP request headers

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

<a name="getBareMetalDeviceResource"></a>
# **getBareMetalDeviceResource**
> [BareMetalDevice] getBareMetalDeviceResource(opts)

Return a list with all servers as bare metal

### 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.BareMetalDevicesApi();

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.getBareMetalDeviceResource(opts, callback);
```

### Parameters

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

### Return type

[**[BareMetalDevice]**](BareMetalDevice.md)

### Authorization

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

### HTTP request headers

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

<a name="postBareMetalDeviceResource"></a>
# **postBareMetalDeviceResource**
> BareMetalDevice postBareMetalDeviceResource(payload, opts)

Deploy a new bare metal server

### 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.BareMetalDevicesApi();

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

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.postBareMetalDeviceResource(payload, opts, callback);
```

### Parameters

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

### Return type

[**BareMetalDevice**](BareMetalDevice.md)

### Authorization

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

### HTTP request headers

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

<a name="putBareMetalDeviceIdResource"></a>
# **putBareMetalDeviceIdResource**
> BareMetalDevice putBareMetalDeviceIdResource(deviceIdpayload, opts)

Update a bare metal device

### 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.BareMetalDevicesApi();

var deviceId = 56; // Number | 

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

var opts = { 
  'deploymentId': "deploymentId_example" // String | Id of the deployment to interact with
  '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.putBareMetalDeviceIdResource(deviceIdpayload, opts, callback);
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **deviceId** | **Number**|  | 
 **payload** | [**BareMetalDeviceUpdate**](BareMetalDeviceUpdate.md)|  | 
 **deploymentId** | **String**| Id of the deployment to interact with | [optional] 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**BareMetalDevice**](BareMetalDevice.md)

### Authorization

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

### HTTP request headers

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

