This page describes the License Rules API methods you can use to retrieve information about the license rules as modeled in AppDynamics such as creating, updating and deleting license rules, and also retrieving license rules by its id, access key, and name. See License Management in the Controller.

These fields are true for all License Rule APIs:

  • id—is GUID (or UUID) which is an acronym for Globally Unique Identifier. 
  • access_key—must be unique across all licenseRules.
  • name—must be unique across all licenseRules.
  • account_id—Use GET API to know your current account_id.

Creates a New License Rule   

URL

http://<host>:<port>/mds/v1/license/rules

Format

POST /mds/v1/license/rules 

  

Input parameters

Parameter Name

Parameter Type

Value

Mandatory

license_module_type

String

String representing the type of the license module.

Module types are:

  • NETVIZ
  • MACHINE_AGENT
  • SIM_MACHINE_AGENT
  • APM
  • APP_AGENT
  • DOT_NET_AGENT
Yes

id

StringString representing the id or name.Yes

version

IntegerIndicates the version number.Yes

number_of_licenses

IntegerInteger indicating the required number of licenses.Yes

account_id

StringProvides the account name or account id.Yes

access_key

PathProvides the account access key.Yes


LicenseRule is comprised of license_module_type, id, access_key, account_id, version, and number_of_licenses.

Example

curl --user <user>@<AccountName>:<password> -X POST \
  http://<host>:<port>/controller/mds/v1/license/rules \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "011116a4-124c-4b73-9343-f315836f103b",
    "version": 0,
    "name": "Default_API9",
    "description": null,
    "enabled": true,
    "constraints": [],
    "entitlements": [
        {
            "license_module_type": "JAVA",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NATIVE_WEB_SERVER",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NATIVE_SDK",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "DOT_NET",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NETVIZ",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "MACHINE_AGENT",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NODEJS",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "SIM_MACHINE_AGENT",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "PHP",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "PYTHON",
            "number_of_licenses": 100
        }
    ],
    "account_id": "8b1e92f2-387c-45b6-9bb5-ebd7f67587d4",
    "access_key": "ap1845ad-1f3e-4c9b-909b-a3cfa510bfb0",
    "total_licenses": null,
    "peak_usage": null
}
{  
   "id": "011116a4-124c-4b73-9343-f315836f103b",
   "version": 0,
   "name": "Default_API9",
   "description": null,
   "enabled": true,
   "constraints": [  

   ],
   "entitlements": [  
      {  
         "license_module_type": "JAVA",
         "number_of_licenses": 100
      },
      {  
         "license_module_type": "NATIVE_WEB_SERVER",
         "number_of_licenses": 100
      },
      {  
         "license_module_type": "NATIVE_SDK",
         "number_of_licenses": 100
      },
      {  
         "license_module_type": "DOT_NET",
         "number_of_licenses": 100
      },
      {  
         "license_module_type": "NETVIZ",
         "number_of_licenses": 100
      },
      {  
         "license_module_type": "MACHINE_AGENT",
         "number_of_licenses": 100
      },
      {  
         "license_module_type": "NODEJS",
         "number_of_licenses": 100
      },
      {  
         "license_module_type": "SIM_MACHINE_AGENT",
         "number_of_licenses": 100
      },
      {  
         "license_module_type": "PHP",
         "number_of_licenses": 100
      },
      {  
         "license_module_type": "PYTHON",
         "number_of_licenses": 100
      }
   ],
   "account_id": "8b1e92f2-387c-45b6-9bb5-ebd7f67587d4",
   "access_key": "ap1845ad-1f3e-4c9b-909b-a3cfa510bfb0",
   "total_licenses": null,
   "peak_usage": null
}

The version must be 0 when creating.

Returns a Summary of All the License Rules for the Current Account

Use this to retrieve a summary of the license rules. The data transfer objects (DTOs) returned will not contain any constraints, match conditions, or entitlements.

URL

http://<host>:<port>/mds/v1/license/rules

Format

GET /mds/v1/license/rules

Example

[
{
"id": "f36e08e2-5f57-4b8c-9ad2-f18873adcd87",
"version": 2,
"name": "Default",
"description": null,
"enabled": true,
"constraints": [],
"entitlements": [],
"account_id": "0429fc7b-a2b9-42e3-a7fb-f704d436a054",
"access_key": "account-accesskey-123",
"total_licenses": 120,
"peak_usage": null
}
]

Updates a License Rule

URL

http://<host>:<port>/mds/v1/license/rules

Format

PUT /mds/v1/license/rules

Input parameters

Parameter Name

Parameter Type

Value

Mandatory

id
StringString representing the id or name.Yes
license_module_type
String

String representing the type of the license module.

Module types are:

  • NetViz
  • Machine Agent
  • SIM Machine Agent
  • APM
Yes
version
IntegerIndicates the version number.Yes
number_of_licenses
IntegerInteger indicating the required number of licenses.Yes
account_id
StringProvides the account name or account id.Yes
access_key
PathProvides the account access key.Yes

Example Request

curl -v -X PUT http://<host>:<port>/controller/mds/v1/license/rules \
  --user <user>@<AccountName>:<password> \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "321116a4-124c-4b73-9343-f315836f103b",
    "version": 0,
    "name": "Default_API",
    "description": null,
    "enabled": true,
    "constraints": [],
    "entitlements": [
        {
            "license_module_type": "JAVA",
            "number_of_licenses": 1000
        },
        {
            "license_module_type": "NATIVE_WEB_SERVER",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NATIVE_SDK",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "DOT_NET",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NETVIZ",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "MACHINE_AGENT",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NODEJS",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "SIM_MACHINE_AGENT",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "PHP",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "PYTHON",
            "number_of_licenses": 100
        }
    ],
    "account_id": "8b1e92f2-387c-45b6-9bb5-ebd7f67587d4",
    "access_key": "api845ad-1f3e-4c9b-909b-a3cfa510bfb0",
    "total_licenses": null,
    "peak_usage": null
}

To update the license rules:

1. Get the payload using any of the available GET methods.

2. Update accessKeys, entitlements, etc.

3. Send the PUT request without changing other key-value pairs.

4. "version" should be kept as it was during GET. This would be incremental.

Deletes a License Rule

URL

http://<host>:<port>/mds/v1/license/rules/f36e08e2-5f57-4b8c-9ad2-f18873adcd87

Format

DELETE /mds/v1/license/rules/{id}

Input parameter

Parameter Name

Parameter Type

Value

Mandatory

LicenseRuleId

Path

Deletes license rule by its id.

Yes

Retrieve a License Rule Using its ID

Use this to retrieve a license rule by the license rule id.

URL

http://<host>:<port>/mds/v1/license/rules/f36e08e2-5f57-4b8c-9ad2-f18873adcd87

Format

GET /mds/v1/license/rules/{licenseRuleId}

Input parameter

Parameter Name

Parameter Type

Value

Mandatory

licenseRuleIdPathRetrieves the UUID of the license rule.Yes

Output Parameters

Parameter NameParameter TypeValueMandatory
id
StringString representing the id or name.Yes
version
IntegerIndicates the version number.Yes
total_licenses
IntegerInteger indicating the total number of licenses.Yes
account_id
StringProvides the account name or account id.Yes
access_key
pathProvides the account access key.Yes


Example

curl -X GET --user <user>@<AccountName>:<password> http://<host>:<port>/controller/mds/v1/license/rules/091116a4-124c-4b73-9343-f315836f103b
{
    "id": "091116a4-124c-4b73-9343-f315836f103b",
    "version": 0,
    "name": "Default",
    "description": null,
    "enabled": true,
    "constraints": [],
    "entitlements": [
        {
            "license_module_type": "JAVA",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NATIVE_WEB_SERVER",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NATIVE_SDK",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "DOT_NET",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NETVIZ",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "MACHINE_AGENT",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "NODEJS",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "SIM_MACHINE_AGENT",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "PHP",
            "number_of_licenses": 100
        },
        {
            "license_module_type": "PYTHON",
            "number_of_licenses": 100
        }
    ],
    "account_id": "8b1e92f2-387c-45b6-9bb5-ebd7f67587d4",
    "access_key": "bd3845ad-1f3e-4c9b-909b-a3cfa510bfb0",
    "total_licenses": null,
    "peak_usage": null
}

The "version" gets updated after every update from UI or API.

Retrieves a License Rule by Access Key

URL

http://<host>:<port>/mds/v1/license/rules/accessKey/account-accesskey-123

Format 

GET /mds/v1/license/rules/accessKey/{accessKey}

Input parameter

Parameter Name

Parameter Type

Value

Mandatory

access_key

Path

Retrieves the access key assigned to the license rule.

Yes

Output Parameters

Parameter NameParameter TypeValueMandatory
id
StringString representing the id or name.Yes
version
IntegerIndicates the version number.Yes
total_licenses
IntegerInteger indicating the total number of licenses.Yes
account_id
StringProvides the account name or account id.Yes


Example

curl -X GET --user <user>@<AccountName>:<password> http://<host>:<port>/controller/mds/v1/license/rules
[
    {
        "id": "221116a4-124c-4b73-9343-f315836f103b",
        "version": 0,
        "name": "Default",
        "description": null,
        "enabled": true,
        "constraints": [],
        "entitlements": [],
        "account_id": "8b1e92f2-387c-45b6-9bb5-ebd7f67587d4",
        "access_key": "bd3845ad-1f3e-4c9b-909b-a3cfa510bfb0",
        "total_licenses": 1000,
        "peak_usage": null
    },
    {
        "id": "321116a4-124c-4b73-9343-f315836f103b",
        "version": 0,
        "name": "Custom1",
        "description": null,
        "enabled": true,
        "constraints": [],
        "entitlements": [],
        "account_id": "8b1e92f2-387c-45b6-9bb5-ebd7f67587d4",
        "access_key": "api845ad-1f3e-4c9b-909b-a3cfa510bfb0",
        "total_licenses": 1000,
        "peak_usage": null
    }
]
 

Retrieve a License Rule by Name

URL

http://<host>:<port>/mds/v1/license/rules/name/Default

Format 

GET /mds/v1/license/rules/name/{name}

Input parameter

Parameter Name

Parameter Type

Value

Mandatory

name

Path

Retrieves the name of the license rule.

Yes

Output Parameters

Parameter NameParameter TypeValueMandatory
id
StringString representing the id or name.Yes
version
IntegerIndicates the version number.Yes
total_licenses
IntegerInteger indicating the total number of licenses.Yes
account_id
StringProvides the account name or account id.Yes


Example

curl -X GET --user <user>@<AccountName>:<password> http://<host>:<port>/controller/mds/v1/license/rules
 [
    {
        "id": "221116a4-124c-4b73-9343-f315836f103b",
        "version": 0,
        "name": "Default",
        "description": null,
        "enabled": true,
        "constraints": [],
        "entitlements": [],
        "account_id": "8b1e92f2-387c-45b6-9bb5-ebd7f67587d4",
        "access_key": "bd3845ad-1f3e-4c9b-909b-a3cfa510bfb0",
        "total_licenses": 1000,
        "peak_usage": null
    },
    {
        "id": "321116a4-124c-4b73-9343-f315836f103b",
        "version": 0,
        "name": "Custom1",
        "description": null,
        "enabled": true,
        "constraints": [],
        "entitlements": [],
        "account_id": "8b1e92f2-387c-45b6-9bb5-ebd7f67587d4",
        "access_key": "api845ad-1f3e-4c9b-909b-a3cfa510bfb0",
        "total_licenses": 1000,
        "peak_usage": null
    }
]