Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

License Automation Demo

Iguana License Activation

...

Iguana License Transfer

...

Info

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:

Code Block
languagelua
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:

Code Block
languagelua
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:

Code Block
languagelua
--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.

Code Block
languagelua
local Activate = net.http.post{
  url = "https://my.interfaceware.com/api",
  parameters = {
      product = 'Iguana

...

',
      token = AuthToken,
      method = 'license.activate',
      description = 'license description',
      entitlementid = entitlement,
      instanceid = iguanaID
  },
  live = true
}

local json = json.parse{data=Activate}
local code = json.data.code

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:

Code Block
languagelua
local Details = net.http.post{
  url = 'http://localhost:7543/license/update',
  auth = {username = 'admin',password = 'password'},
  parameters = {key=code},
  live = true
}

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:

Code Block
languagelua
local Details = net.http.get{
  url = 'http://localhost:7543/license/detail',
  auth = {username = 'admin',password = 'password'},
  live = true
}
local parsedDetails = json.parse{data=Details}
local iguanaID = parsedDetails.iguana_id
trace(iguanaID)

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

Code Block
languagelua
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)

Step 2. Obtain Authentication Token:

Code Block
languagelua
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)

Step 3. Gain access to the Entitlement ID:

Code Block
languagelua
--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)

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

Code Block
languagelua
--Used to find activation ID
local Activate = net.http.post{
  url = "https://my.interfaceware.com/api",
  parameters = {
      product = 'Iguana',
      token = AuthToken,
      method = 'license.listActivations',
      entitlementid = entitlement,
  },
  live = true
}

local parsedActivate = json.parse{data=Activate}
local activation = parsedActivate.data[1].activation_id
trace(activation)

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:

Code Block
languagelua
local Activate2 = net.http.post{
  url = "https://my.interfaceware.com/api",
  parameters = {
      product = 'Iguana',
      token = AuthToken,
      method = 'license.UpdateActivationInfo',
      description = 'license description',
      activationid = activation,
      instance_id = iguanaID
  },
  live = true
}
local parsedActivate2 = json.parse{data=Activate2}
local newCode = parsedActivate2.data.code
trace(newCode)

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

Code Block
languagelua
local Details2 = net.http.post{
  url = 'http://localhost:8543/license/update',
  auth = {username = 'admin',password = 'password'},
  parameters = {key=newCode},
  live = true
}

Considerations

Support Other Tools

License Transfer Only on the Same Type

API Documentation Updates

...

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

Code Block
curl -X POST http://localhost:6543/license/detail -H "Content-Type: application/json" --user "admin:password"
Expand
titleSample Response

{"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:

Code Block
curl -X POST -d 'username=(my.interfaceware.com USERNAME)&password=(my.interfaceware.com PASSWORD)&method=session.login' https://my.interfaceware.com/api
Expand
titleSample Response

{

   "data": {

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

      "Info": {

         "Permissions": {

            "LicenseTransfer": true,

            "TemporaryLicense": true,

            "LicenseRead": true,

            "FinancialRead": true,

            "LicenseWrite": true

         },

         "CompanyName": "Testing"

      }

   },

   "status": "ok"

}%