Traversing the Tree

Resource URIs can be either:

Resources.

A directory structure containing child elements denoting sub-directories or resource nodes.

You can test the overall availability of the REST API by querying the following URI in a compatible Web browser or JSON/REST query application:

https://<host>:<port>

(As mentioned above, <host> is the hostname of the Traffic Manager and <port> is the port that the REST API is published on).

Some versions of Internet Explorer are unable to directly render the “application/json” MIME type data returned from a Traffic Manager REST API query. Ivanti recommends using an alternative browser. However, to resolve the issue for affected browsers, amend the Windows registry as shown here:

1.Open Notepad and enter the following text:

Windows Registry Editor Version 5.00;

Tell IE 7,8,9,10,11 to open JSON documents in the browser on Windows XP and later.

25336920-03F9-11cf-8FD0-00AA00686F13 is the CLSID for the "Browse in place".

[HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/json]

"CLSID"="{25336920-03F9-11cf-8FD0-00AA00686F13}"

"Encoding"=hex:08,00,00,00

2.Save the document as “IE-Json.reg” and then run it.

3.Restart Internet Explorer and re-enter a REST URI to confirm the JSON results appear within the browser.

For further information, see http://www.codeproject.com/Tips/216175/View-JSON-in-Internet-Explorer.

A GET request for this URI should yield the following result:

{

"children": [{

"name": "api",

"href": "/api/"

}]

},

This shows that the REST service at <host>:<port> contains a single child element "/api". As discussed in Resource URI Patterns, the full root URI of the configuration resource model then becomes:

https://myhost:9070/api/tm/8.3/config/active

Therefore, requesting this URI results in a list of child elements similar to the following example:

{

"children": [{

"name": "action_programs",

"href": "/api/tm/8.3/config/active/action_programs/"

}, {

"name": "actions",

"href": "/api/tm/8.3/config/active/actions/"

}, {

"name": "aptimizer",

"href": "/api/tm/8.3/config/active/aptimizer/"

}, {

"name": "bandwidth",

"href": "/api/tm/8.3/config/active/bandwidth/"

}, {

"name": "cloud_api_credentials",

"href": "/api/tm/8.3/config/active/cloud_api_credentials/"

}, {

...

(truncated)

...

}, {

"name": "virtual_servers",

"href": "/api/tm/8.3/config/active/virtual_servers/"

}]

}

This output identifies all configuration resource types available through the Traffic Manager being queried. Each is identified by a name and href attribute combination.

A query for a specific resource type shows all instances of that resource defined within the Traffic Manager configuration. For example, the following URI lists all virtual servers:

https://myhost:9070/api/tm/8.3/config/active/virtual_servers

The output shows each stored virtual server, as per the following example:

{

"children": [{

"name": "vs1",

"href": "/api/tm/8.3/config/active/virtual_servers/vs1"

}, {

"name": "vs2",

"href": "/api/tm/8.3/config/active/virtual_servers/vs2"

}]

}

SNMP counter and system information resources are unique to each Traffic Manager in the cluster. You can access the data for each cluster member from the API of whichever Traffic Manager you are connected to.

To list the available Traffic Managers in your cluster, perform a request for the following URI:

https://myhost1:9070/api/tm/8.3/status

The response is a list of child elements similar to the following:

{

"children": [{

"name": "myhost1.example.com",

"href": "/api/tm/8.3/status/myhost1.example.com/"

}, {

"name": "myhost2.example.com",

"href": "/api/tm/8.3/status/myhost2.example.com/"

}, {

"name": "myhost3.example.com",

"href": "/api/tm/8.3/status/myhost3.example.com/"

}, {

"name": "local_tm",

"href": "/api/tm/8.3/status/local_tm/"

}]

}

The list also includes the “local_tm” child node that corresponds to the REST API of the Traffic Manager you are currently accessing. This provides a consistent programmatic interface to access resources for the local Traffic Manager only, no matter which host's API you are connected to. For example, the following URI can be used on the API of any Traffic Manager in the cluster, and the response contains results for that Traffic Manager only:

/api/tm/8.3/status/local_tm/information

To view (or modify, in the case of configuration resources) a stored record for a particular resource type, append the full path to the end of this base URI. For example, a request for a virtual server configuration resource named "Web" looks like this:

https://myhost:9070/api/tm/8.3/config/active/virtual_servers/Web

Equally, a request for the SNMP counter output for a pool named "P1" looks like this:

https://myhost:9070/api/tm/8.3/status/local_tm/statistics/pools/P1