Product Documentation

Retrieving Details of NetScaler Resources

Jun 14, 2016

NITRO provides multiple approaches using which you can retrieve resources and their relevant details. The following table explains each of these approaches with the required URL.

Note: A sample format of the request and response is provided below the table.

Retrieving all details of all resources of a specific type

In the URL, specify the type of resource for which you want to retrieve the details.

For example, to retrieve all details of load balancing virtual servers available on a NetScaler appliance.

http://<netscaler-ip-address>/nitro/v1/config/lbvserver

Retrieving all details of a specific resource

In the URL, specify the name of resource for which you want to retrieve the details.

For example, to retrieve all details of a load balancing virtual server named MyFirstLbVServer:

http://<netscaler-ip-address>/nitro/v1/config/lbvserver/MyFirstLbVServer

Retrieving summary or detailed view of resources

In the URL, use the "view" query parameter to specify whether you want to view the summary (mandatory parameters) or detail (all parameters).

For example, to view the mandatory parameters for all load balancing virtual servers:

http://<netscaler-ip-address>/nitro/v1/config/lbvserver?view=summary
Note: By default, the retrieved results are displayed in detail view (?view=detail).

Retrieving all details of resources that have multiple unique identifiers

In the URL, specify the type of resource and use the "args" query parameter to specify the unique attributes and the values for those attributes.

For example, to get the application firewall profiles that have unique identifiers "name" and "starturl" as appfw1 and aa respectively.

http://<netscaler-ip-address>/nitro/v1/config/appfwprofile?args=name:appfw1,starturl:aa

Retrieving specific details of all resources of a specific type

In the URL, specify the type of the resource and use the "attrs" query parameter to specify the resource details that you want to retrieve.

For example, to retrieve the "name" and "lbmethod" of all load balancing virtual servers:

http://<netscaler-ip-address>/nitro/v1/config/lbvserver?attrs=name,lbmethod

Retrieving specific details of a specific resource

In the URL, specify the type and name of the resource and use the "attrs" query parameter to specify the resource details that you want to retrieve.

For example, to retrieve the "name" and "lbmethod" of a load balancing virtual server named "MyFirstLbVServer":

http://<netscaler-ip-address>/nitro/v1/config/lbvserver/MyFirstLbVServer?attrs=name,lbmethod

Filtering the retrieved resources

In the URL, specify the type of resource and use the "filter" query parameter to specify the attribute(s) and the value(s) of the attributes. The resources fetched will be filtered based on the filter criteria.

Note: The filter query parameter supports the use of PCRE regular expressions.

For example, to filter the load balancing virtual servers where the "lbmethod" is ROUNDROBIN.

http://<netscaler-ip-address>/nitro/v1/config/lbvserver?filter=lbmethod:ROUNDROBIN

Retrieving resources in paginated manner

If the request is likely to result in a large number of resources, you can divide the results into pages and retrieve them page by page (paginated). For example, if you are retrieving all the 53 load balancing virtual servers of a NetScaler appliance, instead of retrieving all 53 in one response, you can configure the results to be divided into 6 pages each having 10 results.

In the URL, specify the name of the resource and use the following query parameters:
  • "pageno" - The page number to be displayed.
  • "pagesize" - The number of resources to be displayed in each page.

For example, to retrieve the load balancing virtual servers in a paginated form, first get a count (using the "count" query parameter shown in below row) of the load balancing virtual servers. Then, accordingly specify the number of results for each page and then specify the page number to be displayed.

http://<netscaler-ip-address>/nitro/v1/config/lbvserver?pagesize=10&pageno=3

For example, to retrieve only the name and load balancing method of all load balancing virtual servers on a NetScaler:
  • Request:

    HTTP Method
    GET
    URL
    http://<netscaler-ip-address>/nitro/v1/config/lbvserver?attrs=name,lbmethod
    Request Headers
    Cookie:NITRO_AUTH_TOKEN=<tokenvalue> 
    Accept:application/vnd.com.citrix.netscaler.lbvserver_list+json
    Note: If the operation returns a list of objects, the Accept header does not require the resource type to be appended by "_list".
  • Response:

    HTTP Status Code on Success
    200 OK
    HTTP Status Code on Failure
    4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error.
    Response Header
    Content-Type:application/vnd.com.citrix.netscaler.lbvserver_list+json
    Note: For a single object, the Content-Type header does not require the resource type to be appended by "_list".
    Response Payload
    { 
        lbvserver: 
        { 
            name: "test", 
            lbmethod: "LEASTCONNECTION" 
        } 
        { 
            name: "test1", 
            lbmethod: "LEASTCONNECTION" 
        } 
    }