Product Documentation

Retrieve Bindings in Bulk

Sep 01, 2016

You can use a bulk GET API to fetch bindings of all the entities of a given entity type.

For example, you can fetch bindings of all the load balancing virtual servers in one call instead of by using multiple GET by "name" calls. In the examples below, the NetScaler appliance has the following configuration.

  • add lb vserver lbv1 http
  • add lb vserver lbv2 http
  • add service svc1 10.20.30.40 http 80
  • add servicegroup sg1 http
  • bind lb vserver lbv1 svc1
  • bind lb vserver lbv1 sg1
  • bind lb vserver lbv2 svc1
  • bind lb vserver lbv2 sg1

Example. To fetch bindings of all lbvservers, in a single NITRO API:

  • Request

HTTP Method
         GET

URL
         http://<NSIP>/nitro/v1/config/lbvserver_binding?bulkbindings=yes

Request Headers 복사

Cookie:NITRO_AUTH_TOKEN=<tokenvalue>

Accept: application/json

  • 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/json

Response Payload 복사

{
   "errorcode":0,
   "message":"Done",
   "severity":"NONE",
   "lbvserver_binding":[
      {
         "name":"lbv1",
         "lbvserver_service_binding":[
            {
               "name":"lbv1",
               "servicename":"svc1",
               "stateflag":"536936451",
               "ipv46":"10.20.30.40",
               "port":80,
               "servicetype":"HTTP",
               "curstate":"DOWN",
               "weight":"1",
               "dynamicweight":"0",
               "cookieipport":"",
               "vserverid":"mcw1",
               "vsvrbindsvcip":"10.20.30.40",
               "vsvrbindsvcport":80,
               "preferredlocation":""
            }
         ],
         "lbvserver_servicegroup_binding":[
            {
               "name":"lbv1",
               "servicegroupname":"sg1",
               "stateflag":"536936464",
               "servicename":"sg1"
            }
         ]
      },
      {
         "name":"lbv2",
         "lbvserver_service_binding":[
            {
               "name":"lbv2",
               "servicename":"svc1",
               "stateflag":"536936451",
               "ipv46":"10.20.30.40",
               "port":80,
               "servicetype":"HTTP",
               "curstate":"DOWN",
               "weight":"1",
               "dynamicweight":"0",
               "cookieipport":"",
               "vserverid":"mcw2",
               "vsvrbindsvcip":"10.20.30.40",
               "vsvrbindsvcport":80,
               "preferredlocation":""
            }        

           ],
         "lbvserver_servicegroup_binding":[
            {
               "name":"lbv2",
               "servicegroupname":"sg1",
               "stateflag":"536936464",
               "servicename":"sg1"
            }        

           ]
      }

   ]
}

Example. To fetch only “service” bindings of all lbvservers:

  • Request

HTTP Method
         GET

URL
         http://<NSIP>/nitro/v1/config/lbvserver_service_binding?bulkbindings=yes

 

Request Header 복사

Content-Type:application/json

Response Payload 복사

{
   "errorcode":0,
   "message":"Done",
   "severity":"NONE",
   "lbvserver_service_binding":[
      {
         "name":"lbv1",
         "servicename":"svc1",
         "stateflag":"536936451",
         "ipv46":"10.20.30.40",
         "port":80,
         "servicetype":"HTTP",
         "curstate":"DOWN",
         "weight":"1",
         "dynamicweight":"0",
         "cookieipport":"",
         "vserverid":"mcw1",
         "vsvrbindsvcip":"10.20.30.40",
         "vsvrbindsvcport":80,
         "preferredlocation":""
      },
      {
         "name":"lbv2",
         "servicename":"svc1",
         "stateflag":"536936451",
         "ipv46":"10.20.30.40",
         "port":80,
         "servicetype":"HTTP",
         "curstate":"DOWN",
         "weight":"1",
         "dynamicweight":"0",
         "cookieipport":"",
         "vserverid":"mcw2",
         "vsvrbindsvcip":"10.20.30.40",
         "vsvrbindsvcport":80,
         "preferredlocation":""
      }   

   ]
}