To update a product template, use the following request:

PATCH /products/product_id/product-templates/id

where:

  • product_id (integer) is the product ID.
  • id (integer) is the product template ID.

Request JSON Objects

Valid JSON parameters include the following.

ParameterTypeRequiredDefinition

name 

stringYesProduct name
license_filenamestringYesLicense filename pattern
license_typestringYesLicense type; choices are local, network
licensee_typestringYesLicensee type; choices are fixed, customer, not_specified
licenseestringNoLicense; required if licensee type is fixed
activations_allowedintegerYesActivations allowed
deactivations_allowedintegerYesDeactivations allowed
descriptionstringNoDescription
hostid_match_rateintegerYesHostID match rate
min_hostidsintegerYesMinimum number of HostIDs
HostidsarrayYesList of HostIDs
FeaturesarrayYesList of features

Hostid

Valid JSON parameters for Hostid include the following.

ParameterTypeRequiredDefinition

name 

stringYesHostID name
min_amountintegerYesMinimum required
max_amountintegerYesMaximum allowed

Feature

Valid JSON parameters for Feature include the following.

ParameterTypeRequiredDefinition

name 

stringYesFeature name
versionstringYesVersion
expiration_typestringYesExpiration type; choices are fixed, days_from_activation, no_expiration
expiration_datestringNoExpiration date; required if expiration type is fixed
issued_typestringYesIssued type; choices are fixed, not_issued, activation_time
issued_datestringNoIssued date; required if issued type is fixed
optionsstringNoOptions
additional_settingsstringNoAdditional settings
enabledbooleanNoWhether feature is enabled or not
days_from_activationstringNoExpiration days from activation; required if expiration type is days_from_activation
countintegerNoCount; required if license type is network
maintenance_typestringYesMaintenance type; choices are fixed, days_from_activation, no_maintenance
maintenance_datestringNoMaintenance date; required if maintenance type is fixed
maintenance_days_from_activationstringNoMaintenance days from activation; required if maintenance type is days_from_activation
commentstringNoComment


Example request

PATCH /products/1/product-templates/1 HTTP/1.1
Content-Type: application/json
Authorization: Bearer f794846b7c26621688e1e06164975b4eae8ce2f6

{
	"name": "Basic",
	"license_filename": "license_%TIME%.lic",
	"license_type": "network",
	"licensee_type": "fixed",
	"licensee": "licensee",
	"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": "2.0",
			"expiration_type": "fixed",
			"expiration_date": "2030-01-01",
			"issued_type": "not_issued",
			"issued_date": null,
			"options": null,
			"additional_settings": null,
			"enabled": true,
			"days_from_activation": null,
			"count": "5",
			"maintenance_type": "days_from_activation",
			"maintenance_date": null,
			"maintenance_days_from_activation": "180",
			"comment": null
		}
	]
}

Response

The LAC REST API returns the standard HTTP response codes described in the following table.

Status CodeDescription
200 OKProduct template updated.

400 Bad Request

Invalid data.
403 ForbiddenInvalid or expired token provided.
404 Not FoundProduct template ID does not exist.

Example Response

HTTP/1.1 200 OK
Content-Type: application/json

{
	"id": "1",
	"name": "Basic",
	"license_filename": "license_%TIME%.lic",
	"license_type": "network",
	"licensee_type": "fixed",
	"licensee": "licensee",
	"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": "2.0",
			"expiration_type": "fixed",
			"expiration_date": "2030-01-01",
			"issued_type": "not_issued",
			"issued_date": null,
			"options": "",
			"additional_settings": "",
			"enabled": true,
			"days_from_activation": null,
			"count": "5",
			"maintenance_type": "days_from_activation",
			"maintenance_date": null,
			"maintenance_days_from_activation": "180",
			"comment": ""
		}
	]
}
  • No labels