Introduction

Welcome to the Iguana Web API reference. The following API calls are designed to interact with and make changes to the Iguana application, rather than the Translator API which just affects the Translator data.

These APIs will allow you to interact with your Iguana instances programmatically, giving you even more flexibility on using Iguana within your infrastructure.

Please note that all of the URLs in the examples use HTTPS. If you do not have SSL certificates configured on the Iguana that you are trying to send the call to, you'll need to use a HTTP URL instead.

Log API

Log Query

Example Usage of POST /api_query


local LogResults = net.http.post{
  url = 'https://localhost:6543/api_query',
  auth = {username = 'admin',password = 'password'},
  parameters = {
    limit = 50,
    type = 'message',
    deleted = 'false'
  }, live=true
}

Usage

POST /api_query

This query will return a table of Iguana log messages that match the given parameters. If no parameters are entered, will return all log messages.

Required Parameters

Optional Parameters

Returns

Monitor API

Get Server Configuration

Example Usage of POST /get_server_config


local config = net.http.post{
  url='https://localhost:6543/get_server_config',
  auth = {username = 'admin',password = 'password'},
  parameters = {  },
  live = true
}

Usage

POST /get_server_config

Queries the specified server and returns its configuration details as XML.

Required Parameters

Returns

The configuration details of the server specified by the URL as XML.

Query Performance Statistics

Example Usage of POST /monitor_query


local PerformanceStats = net.http.post{
  url = "https://localhost:6543/monitor_query",
  auth = {username = 'admin',password = 'password'},
  parameters = {  },
  live = true
}

Usage

POST /monitor_query

Queries the specified Iguana server and reutrns a detailed XML summary of its performance statistics. It includes information such as the number of open file handles, memory usage, and so on.

Required Parameters

Returns

Performance statistics of the server specified by the URL as XML.

Retrieve Current Iguana Version

Example Usage of POST /current_version


local Version = net.http.post{
  url = 'https://localhost:6543/current_version',
  auth = {username = 'admin',password = 'password'},
  parameters = {  },
  live = true
}

Usage

POST /current_version

Queries the specified Iguana server and returns information regarding it's software version.

Required Parameters

Channel API

Add Channel

Example Usage of POST /add_channel


local channelConfig = net.http.post{
  url = 'https://localhost:6543/add_channel',
  auth = {username = 'admin', password = 'password'},
  parameters = {
    config = XMLSTRING,
    compact = 'true',
  },
  live = true
}

Usage

POST /add_channel

Adds a channel with the specified components to the specified server.

Required Parameters

Returns

More Information

Get Default Channel Configuration

Example Usage of POST /get_default_config


  local defaultConfig = net.http.post{
    url = 'https://localhost:6543/get_default_config',
    auth = {username = 'admin', password = 'password'},
    parameters = {
      source = 'LLP Listener',
      destination = 'To Translator',
      compact = true,
    },
    live = true
  }

Usage

POST /get_default_config

Required Parameters

Returns

Get Channel Configuration

Example Usage of POST /get_channel_config


  local channelConfig = net.http.post{
    url = 'https://localhost:6543/get_channel_config',
    auth = {username = 'admin',password = 'password'},
    parameters = {
      guid = '44F1636BCBA7D0766D418716BDDFC389',
      compact = 'true',
    },
    live = true
  }

Usage

POST /get_channel_config

Retrieves the configuration parameters for a given channel. This can be used with other request handlers in the API to clone channels or to update existing ones. This operation requires the user to have view permissions for the channel.

Required Parameters

Returns

Import Project

Example Usage of POST /import_project


  local guidImport = net.http.post{
    url = 'https://localhost:6543/import_project',
    auth = {username = 'admin', password = 'password'},
    parameters = {
      project = Base64Zip,
      guid = GUID,
      sample_data = 'replace',
    },
    live = true
  }
   

Usage

POST /import_project

Required Parameters

Optional Parameters

Returns

Export Project

Example Usage of POST /export_project


  local base64Zip = net.http.post{
    url = 'https://localhost:6543/export_project',
    auth = {username = 'admin', password = 'password'},
    parameters = {
      guid = GUID,
      sample_data = true,
    },
    live = true
  }
   

Usage

POST /export_project

Required Parameters

Optional Parameters

Returns

Remove Channel

Example Usage of POST /remove_channel


  local Config = net.http.post{
    url = 'https://localhost:6543/remove_channel',
    auth = {username = 'admin',password = 'password'},
    parameters = {
      guid = GUID,
      compact = true,
    },
    live = true
  }
   

Usage

POST /remove_channel

Required Parameters

Returns

Source Control Commit

Example Usage of POST /sc/commit


  local Commit = net.http.post{
    url = 'https://localhost:6543/sc/commit',
    auth = {username = 'admin',password = 'password'},
    parameters = {
      translator_guid = GUID,
      comment='COMMENT',
    },
    live = true
  }

Usage

POST /sc/commit

Required Parameters

Returns

Source Control Bump

Example Usage of POST /sc/bump


  local Commit = net.http.post{
    url = 'https://localhost:6543/sc/bump',
    auth = {username = 'admin',password = 'password'},
    parameters = {
      translator_guid = GUID,
      commit_id = CommitID,
      translators_to_bump = [GUID],
    },
    live = true
  }

Usage

POST /sc/bump

Required Parameters

Returns

Unit Test API

The following API's are designed for use with the Unit Test Framework, which is available exclusively to Iguana Professional and Iguana Enterprise customers. If you are interested in learning more about the Professional and Enterprise packages, please inquire with your Account Manager.

Authorization for these API calls works a bit differently than the rest of the Iguana web APIs. The GUI for the Unit Test Framework allows you to create a permanent Authorization token which can be used in the HTTP header to authorize any of the API calls listed below. This token does not expire and does not need to be refreshed.

Get List of Test Modules

Example Usage of GET /ut/testModules


  local Tests = net.http.get{
    url = "https://localhost:6543/ut/testModules",
    headers = {Authorization = "Bearer"..AuthToken}
  }

Usage

GET /ut/testModules

This call will return the list of Test Modules and the tests that they contain. The Test Module object can be passed to the Run API in order to run the tests it contains. Instead of using a username and password for authorization, it uses an API token which needs to be sent in the Header.

Returns the Test Module object:
  [
   {
      "path": string,
      "dependencies": [
         {
            "path": string,
            "test": string,
            "testlink": string
         }
      ],
      "tests": [
         {
            "name": string
         }
      ],
      "loaderror": string,
      "errorlink": string
   }
]

Returns: Test Module

Run Tests

Example Usage of POST /ut/run


  local testResults = net.http.post{
    url = "https://localhost:6543/ut/run",
    headers = {Authorization = "Bearer"...AuthToken}
    body = {"testModules":[Array of testModules]}
  }

Usage

POST /ut/run

This call will run all of the tests that are in the array of testModules in the body of the request.

  Returns testResult which is an object containing the test results.
  [
     {
        "testPath": String,
        "testName": String,
        "success": Boolean,
        "message": String,
        "duration": Numeric,
        "testLink": String
     }
  ]

Returns: testResult