# HivelocityApi.ProductApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**getProductListResource**](ProductApi.md#getProductListResource) | **GET** /product/list | Return structured sps stock data in a list
[**getProductOperatingSystemsResource**](ProductApi.md#getProductOperatingSystemsResource) | **GET** /product/{productId}/operating-systems | Return List of operating systems found for a Product
[**getProductOptionResource**](ProductApi.md#getProductOptionResource) | **GET** /product/{productId}/options | Return List of Options found for a Product
[**getProductsAndOptionsResource**](ProductApi.md#getProductsAndOptionsResource) | **GET** /product/options | Return a mapping of Products and Options with pricing per-period
[**postProductMatchResource**](ProductApi.md#postProductMatchResource) | **POST** /product/match | Return a list of Products matching the provided lshw output of a server


<a name="getProductListResource"></a>
# **getProductListResource**
> [ProductInfo] getProductListResource(opts)

Return structured sps stock data in a list

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

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

### Parameters

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

### Return type

[**[ProductInfo]**](ProductInfo.md)

### Authorization

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

### HTTP request headers

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

<a name="getProductOperatingSystemsResource"></a>
# **getProductOperatingSystemsResource**
> [Option] getProductOperatingSystemsResource(productId, opts)

Return List of operating systems found for a Product

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

var productId = 56; // Number | ID of the Product

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **productId** | **Number**| ID of the Product | 
 **xFields** | **String**| An optional fields mask | [optional] 

### Return type

[**[Option]**](Option.md)

### Authorization

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

### HTTP request headers

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

<a name="getProductOptionResource"></a>
# **getProductOptionResource**
> Options getProductOptionResource(productId, opts)

Return List of Options found for a Product

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

var productId = 56; // Number | ID of the Product

var opts = { 
  'groupBy': "upgrade" // String | Get results grouped by 'upgrade' or without grouping.
};

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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **productId** | **Number**| ID of the Product | 
 **groupBy** | **String**| Get results grouped by 'upgrade' or without grouping. | [optional] [default to upgrade]

### Return type

[**Options**](Options.md)

### Authorization

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

### HTTP request headers

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

<a name="getProductsAndOptionsResource"></a>
# **getProductsAndOptionsResource**
> [ProductOption] getProductsAndOptionsResource(opts)

Return a mapping of Products and Options with pricing per-period

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

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

### Parameters

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

### Return type

[**[ProductOption]**](ProductOption.md)

### Authorization

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

### HTTP request headers

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

<a name="postProductMatchResource"></a>
# **postProductMatchResource**
> postProductMatchResource(payload)

Return a list of Products matching the provided lshw output of a 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.ProductApi();

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


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

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **payload** | [**ProductMatch**](ProductMatch.md)|  | 

### Return type

null (empty response body)

### Authorization

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

### HTTP request headers

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

