How do I fetch bindings for all NetScaler entities of a single entity type using a single NITRO AP

How do I fetch bindings for all NetScaler entities of a single entity type using a single NITRO AP

book

Article ID: CTX218111

calendar_today

Updated On:

Description

 

 

Instructions

Assume that a NetScaler customer has 1000 load balancing virtual servers and wants to fetch bindings across all the 1000 load balancing virtual servers. To satisfy this use case in releases prior to 11.1, customer had to loop through 1000 times and fetch the associated bindings for each virtual server one at a time. Lack of a single/bulk-get API made this process time consuming and cumbersome.

From NS 11.1 release onwards, a new API is added to fetch bindings of all the entities of a given entityType. Using this API, NetScaler can return bindings of all the 1000 LB vservers that are configured on NetScaler in a single call.

This new query parameter is called ‘bulkbindings’. It is important to remember that the default behaviour is unchanged. API returns the bulk data only if user explicitly specifies this query parameter (’bulkbindings’) in the request.

Example1: API to fetch all bindings of all lbvservers in single NITRO API

API: http://<NSIP>/nitro/v1/config/lbvserver_binding?bulkbindings=yes Sample Response (truncated for representational purpose only):
{
"errorcode": 0,

"message": "Done", "severity": "NONE", “lbvserver_bindings”: [

{
“name”:”lbv1”, “lbvserver_service_binding”:[{“name”:”v1”...}], “lbvserver_servicegroup_binding”:[{“name”: “v1”...}]

}, {

} ]

}
Example 2: API to fetch all service bindings of all lbvservers in single NITRO

API: http://<NSIP>/nitro/v1/config/lbvserver_service_binding?bulkbindings=yes Sample Response:
{
"errorcode": 0

"message": "Done"
"severity": "NONE" "lbvserver_service_binding": [3] -0: {

“name”:”lbv2”, “lbvserver_service_binding”:[{“name”: “v1” ...}], “lbvserver_servicegroup_binding”:[{“name”: “v1”...}]

"name": "OWA_LA" "servicename": "HTTP_55" "stateflag": "536936451" "ipv46": "10.102.216.55" "port": 80

"servicetype": "HTTP" "curstate": "DOWN"
"weight": "1"
"dynamicweight": "0" "cookieipport": ""
"vserverid": "PXB_MB" "vsvrbindsvcip": "10.102.216.55" "vsvrbindsvcport": 80 "preferredlocation": ""

}
-1: {
"name": "Sharepoint-A" "servicename": "HTTP_55" "stateflag": "536936451" "ipv46": "10.102.216.55"
"port": 80
"servicetype": "HTTP" "curstate": "DOWN"
"weight": "1"
"dynamicweight": "0" "cookieipport": ""
"vserverid": "Tibsfqpjou-B" "vsvrbindsvcip": "10.102.216.55" "vsvrbindsvcport": 80 "preferredlocation": ""
}
-2: {
"name": "Lync_HK" "servicename": "HTTP_53" "stateflag": "536936451" "ipv46": "10.102.216.53"
"port": 80
"servicetype": "HTTP" "curstate": "UP"
"weight": "1"
"dynamicweight": "0" "cookieipport": ""
"vserverid": "Mzod_IL" "vsvrbindsvcip": "10.102.216.53"

"vsvrbindsvcport": 80 "preferredlocation": "" }
}

Example 3: API to fetch all service group bindings of all lbvservers in single NITRO
API: http://<NSIP>/nitro/v1/config/lbvserver_servicegroup_binding?bulkbindings=yes

Sample Response:

{
"errorcode": 0
"message": "Done"
"severity": "NONE" "lbvserver_servicegroup_binding": [1] -0: {
"name": "OWA_USA" "servicegroupname": "sg10" "stateflag": "536936464" "servicename": "sg10"
}
}

 

Issue/Introduction

How do I fetch bindings for all NetScaler entities of a single entity type using a single NITRO AP

Additional Information