How to Build Iguana License Automation

License Automation Demo

Iguana License Activation

https://www.youtube.com/embed/ryqPzyY0uWA

Iguana License Transfer

This document will provide sample code on the basics of the Iguana License API by demonstrating:

  1. How to Activate a New Iguana using the API

  2. How to License Transfer an Iguana using the API

License API Scenarios and Best Practices

How to Activate a New Iguana

Before activating a new Iguana License, we must:

  1. Gain access to the new Iguana Instance ID.

  2. Gain access to the Authentication Token.

  3. Gain access to the Entitlement ID.

  4. Gain access to the code for the new Iguana Instance.

  5. Apply the License Code to the new Iguana Instance

Step 1. Gain access to the new Iguana Instance ID:

local Details = net.http.get{ url = 'http://localhost:7543/license', auth = {username = 'admin',password = 'password'}, live = true } --Get Iguana ID local iguanaID = Details:split("Iguana ID: ")[2]:split("</h2>")[1] trace(iguanaID)

If you run the original API call it will have the url as “http://localhost:7543/license/detail” but when the Iguana instance is not activated it won't return the correct ID. So, using “http://localhost:7543/license” we are returned with a html response that uses string manipulation (Line 7) in order to gain access to the Iguana ID.

Step 2. Gain access to the Authentication Token:

local r,c,h = net.http.post{ url = "https://my.interfaceware.com/api", parameters = { username = 'my.interfaceware.com -- USERNAME', password = 'my.interfaceware.com -- PASSWORD', method = 'session.login' }, live = true } local parsedR = json.parse{data=r} local AuthToken = parsedR.data.Token trace(AuthToken)

The above code will return the Authentication Token using your my.interfaceware.com username and password.

Step 3. Gain access to the Entitlement ID:

--Use this to locate Entitlement ID of Instance Type (ie. Iguana Basic, Iguana Enterprise) local Licenses = net.http.get{ url = "https://my.interfaceware.com/api", parameters = { product = 'Iguana', token = AuthToken, method = 'license.listentitlements' }, live = true } local test = json.parse{data=Licenses} --The [1] will change, on line 15, depending on which entitlement is used. local entitlement = test.data[1].id trace(entitlement)

NOTE: [1] was picked for the example, but make sure you choose the correct data point by looping through and finding correct value based on the name of the Iguana Instance Type.

The above code will return the Entitlement ID of the Iguana Instance Type (ie. Iguana Basic, Iguana Professional, Iguana Enterprise).

Step 4. Gain access to the code for the new Iguana Instance:

Using the Activate API, we will now use the Iguana ID, the Entitlement ID and the Authentication Token. This is to gain access to the code to activate your Iguana Instance.

Once you retrieve the code, you can make the last API call below to activate your new Iguana License.

Step 5. Apply the License Code to the new Iguana Instance:

NOTE: Once the last Details API call is used, the iguanaID variable call that retrieved the Iguana ID from the beginning will produce an error.


How to License Transfer an Iguana

To complete a License Transfer using Iguana API follow these steps:

  1. Gain access to the Iguana ID used to transfer to.

  2. Obtain Authentication Token.

  3. Gain Access to the Entitlement ID.

  4. Gain access to the Activation ID of the current Iguana Instance.

  5. Gain access to the new code and transfer the new Iguana Instance.

  6. Apply the license code to the new Iguana Instance.

Step 1. Gain access to the Iguana ID used to transfer to:

If the Iguana Instance is already activated use this:

If the Iguana Instance is new and not activated use this:

Step 2. Obtain Authentication Token:

Step 3. Gain access to the Entitlement ID:

Step 4. Gain access to the Activation ID of the current Iguana Instance:

NOTE: The [1] is used for this demonstration on line 14 but will change depending on which instance you would like to transfer.

Step 5. Gain access to the new code and transfer the new Iguana Instance:

Using the Activation ID, and the Iguana ID you want to transfer to:

Step 6. Apply the license code to the new Iguana Instance:

Considerations

Support Other Tools

Using a cURL command in the terminal to access Iguana ID:

{"channels":"100","iguana_id":"LXET2GM47D","license_expiry_date":"No Expiry","maintenance_expiry_date":"No Expiry","server_label":"","unlimited_llp_connections":true}%

Using a cURL command in the terminal to access the Authentication Token:

{

   "data": {

      "Token": "*Token Displayed Here*",

      "Info": {

         "Permissions": {

            "LicenseTransfer": true,

            "TemporaryLicense": true,

            "LicenseRead": true,

            "FinancialRead": true,

            "LicenseWrite": true

         },

         "CompanyName": "Testing"

      }

   },

   "status": "ok"

}%

Related pages