Router API

The Router API is a REST API exposed by the Admin Node Manager. The Router API provides a mechanism for routing API requests intended for API Servers, the intended API Server may be:

As the Node Manager is the only process that can communicate directly with an API Server all requests intended for an API Server must pass through the Router API on the Admin Node Manager. Examples of APIs intended for API Servers which get routed via the Router API include the Traffic Monitor API, the Monitoring API etc.

Router API

The Router API is designed to forward API Server management service requests to the specified API Server instance. Upon successful calling of the management service on the API Server instance the response is sent back to the client.

The Admin Node Manager contains information about the topology of all registered API Servers so that it can relay requests to it e.g. management port of the API Server, HTTP scheme, hostname. If the API Server is located on a remote host then the request is forwarded to the appropriate remote Node Manager on the host which finally forwards the request to the API Server.

The Vordel Manager web front end utilises the Router API when it communicates with the Admin Node Manager.

Breakdown of a request to Routing API

Any request to the Router API is comprised of three parts:

  1. The path containing a call to the Router API
  2. A path parameter indicating which API Server the request is intended for
  3. The API Server REST request, i.e. the path and parameters of the actual management service hosted on the API Server that is been invoked

Example URL:

https://anm:8090/api/router/service/{API Server ID}/{API Server request}
URL fragment Description
https://anm:8090 The location of the AMN
/api/router/service The path indicating that this request is for the Router API
{API Server ID} The unique ID for an API Server instance in the domain. See section below on how to find the API Server ID
{API Server request} The REST request and parameters intended to be run on the API Server

Example request:

Given the following topology:

Hosts:
|
 ---highlander [host-1]

Admin Node Manager:
|
 ---Node Manager on highlander [nodemanager-1] (http://highlander:8090)

Groups:
|
 ---Sales [group-2]
   |
    ---Sales Server [instance-1] (http://highlander:8085)

If you request Traffic Monitoring details from the "Sales Server" belonging to the group "Sales" then you need to wrap the Traffic Monitor request in a call to the Router API.

/ops/message/a18ce3874de8a62712176c6c/0/getinfo?format=json&details=1&rheaders=1&sheaders=1
/api/router/service/instance-1/ops/message/a18ce3874de8a62712176c6c/0/getinfo?format=json&details=1&rheaders=1&sheaders=1

where

Example URL fragment Description
/api/router/service /api/router/service The path indicating that this request is for the Router API
/instance-1 {API Server ID} The unique ID for an API Server instance in the domain. See section below on how to find the API Server ID
/ops/message/a18ce3874de8a62712176c6c/0/getinfo?format=json&details=1&rheaders=1&sheaders=1 {API Server request} The REST request and parameters intended to be run on the API Server

Note that the API Server API can also be found in the topology.json file located in the Admin Node Manager groups directory:

{
  "id" : "DefaultDomain",
  "version" : 2,
  "timestamp" : 1341504050617,
  "groups" : [ {
    "name" : "Node Manager Group",
    "id" : "group-1",
    "services" : [ {
      "name" : "Node Manager on highlander",
      "id" : "nodemanager-1",
      "type" : "nodemanager",
      "scheme" : "http",
      "enabled" : true,
      "hostID" : "host-1",
      "managementPort" : 8090,
      "tags" : {
        "internal_admin_nm" : "true"
      }
    } ],
    "hostIds" : [ "host-1" ],
    "tags" : {
    }
  }, {
    "name" : "Sales",
    "id" : "group-2",
    "services" : [ {
      "name" : "Sales Server",
      "id" : "instance-1",
      "type" : "gateway",
      "scheme" : "http",
      "enabled" : true,
      "hostID" : "host-1",
      "managementPort" : 8085,
      "tags" : {
      }
    } ],
    "hostIds" : [ "host-1" ],
    "tags" : {
    }
  } ],
  "hosts" : [ {
    "name" : "highlander",
    "id" : "host-1"
  } ],
  "productVersion" : "7.0.0",
  "uniqueIdCounters" : {
    "Group" : 3,
    "Gateway" : 2,
    "NodeManager" : 2,
    "Host" : 2
  }
}