To create a product template, use the following request:
POST /products/product_id/product-templates
where:
product_id (integer) is the product ID.
Request JSON Objects
Valid JSON parameters include the following.
| Parameter | Type | Required | Definition |
|---|---|---|---|
name | string | Yes | Product name |
| license_filename | string | Yes | License filename pattern |
| license_type | string | Yes | License type; choices are local, network |
| licensee_type | string | Yes | Licensee type; choices are fixed, customer, not_specified |
| licensee | string | No | License; required if licensee type is fixed |
| activations_allowed | integer | Yes | Activations allowed |
| deactivations_allowed | integer | Yes | Deactivations allowed |
| description | string | No | Description |
| hostid_match_rate | integer | Yes | HostID match rate |
| min_hostids | integer | Yes | Minimum number of HostIDs |
| Hostids | array | Yes | List of HostIDs |
| Features | array | Yes | List of Features |
Hostid
Valid JSON parameters for Hostid include the following.
| Parameter | Type | Required | Definition |
|---|---|---|---|
name | string | Yes | HostID name |
| min_amount | integer | Yes | Minimum required |
| max_amount | integer | Yes | Maximum allowed |
Feature
Valid JSON parameters for Feature include the following.
| Parameter | Type | Required | Definition |
|---|---|---|---|
name | string | Yes | Feature name |
| version | string | Yes | Version |
| expiration_type | string | Yes | Expiration type; choices are fixed, days_from_activation, no_expiration |
| expiration_date | string | No | Expiration date; required if expiration type is fixed |
| issued_type | string | Yes | Issued type; choices are fixed, not_issued, activation_time |
| issued_date | string | No | Issued date; required if issued type is fixed |
| options | string | No | Options |
| additional_settings | string | No | Additional settings |
| enabled | boolean | No | Whether feature is enabled or not |
| days_from_activation | string | No | Expiration days from activation; required if expiration type is days_from_activation |
| count | integer | No | Count; required if license type is network |
| maintenance_type | string | Yes | Maintenance type; choices are fixed, days_from_activation, no_maintenance |
| maintenance_date | string | No | Maintenance date; required if maintenance type is fixed |
| maintenance_days_from_activation | string | No | Maintenance days from activation; required if maintenance type is days_from_activation |
| comment | string | No | Comment |
Example request
POST /products/1/product-templates HTTP/1.1
Content-Type: application/json
Authorization: Bearer f794846b7c26621688e1e06164975b4eae8ce2f6
{
"name": "Basic",
"license_filename": "license_%TIME%.lic",
"license_type": "local",
"licensee_type": "not_specified",
"licensee": null,
"activations_allowed": "1",
"deactivations_allowed": "0",
"description": null,
"hostid_match_rate": "100",
"min_hostids": "1",
"Hostids": [
{
"name": "Not Locked",
"min_amount": "1",
"max_amount": "1"
}
],
"Features": [
{
"name": "licstat",
"version": "1.0",
"expiration_type": "no_expiration",
"expiration_date": null,
"issued_type": "not_issued",
"issued_date": null,
"options": null,
"additional_settings": null,
"enabled": true,
"days_from_activation": null,
"count": null,
"maintenance_type": "no_maintenance",
"maintenance_date": null,
"maintenance_days_from_activation": null,
"comment": null
}
]
}
Response
The LAC REST API returns the standard HTTP response codes described in the following table.
| Status Code | Description |
|---|---|
| 200 OK | Product template created. |
| Invalid data. | |
| 403 Forbidden | Invalid or expired token provided. |
| 404 Not Found | Product ID does not exist. |
Example Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "2",
"name": "Basic",
"license_filename": "license_%TIME%.lic",
"license_type": "local",
"licensee_type": "not_specified",
"licensee": null,
"activations_allowed": "1",
"deactivations_allowed": "0",
"description": "",
"hostid_match_rate": "100",
"min_hostids": "1",
"Hostids": [
{
"name": "Not Locked",
"min_amount": "1",
"max_amount": "1"
}
],
"Features": [
{
"name": "licstat",
"version": "1.0",
"expiration_type": "no_expiration",
"expiration_date": null,
"issued_type": "not_issued",
"issued_date": null,
"options": "",
"additional_settings": "",
"enabled": true,
"days_from_activation": null,
"count": null,
"maintenance_type": "no_maintenance",
"maintenance_date": null,
"maintenance_days_from_activation": null,
"comment": ""
}
]
}