Product Documentation

Binding NetScaler Resources

Jun 14, 2016

NetScaler resources form relationships with each other through the process of binding. This is how services are associated with a load balancing virtual server, or how policies are bound to a load balancing virtual server. Each binding relationship is represented by its own object. A binding resource has properties representing the name of each NetScaler resource in the binding relationship. It can also have other properties related to that relationship (for example, the weight of the binding between an lbvserver resource and a service resource).

Read through the following examples to get a better understanding of the bind and unbind operation.

Example 1: To bind a service named "svc_prod" to a load balancing virtual server named "MyFirstLbVServer" and specify a weight for the binding:
  • Request:

    HTTP Method
    POST
    URL
    http://<netscaler-ip-address>/nitro/v1/config/lbvserver_service_binding
    Request Headers
    Cookie:NITRO_AUTH_TOKEN=<tokenvalue> 
    Content-Type:application/vnd.com.citrix.netscaler.lbvserver_service_binding+json
    Request Payload
    { 
        "lbvserver_service_binding": 
        { 
            "servicename":"svc_prod", 
            "weight":"20", 
            "name":"MyFirstLbVServer" 
        } 
    }
  • Response:

    HTTP Status Code on Success
    201 Created
    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.
Example 2: To bind a policy to a policy label:
  • Request:

    HTTP Method
    POST
    URL
    http://<netscaler-ip-address>/nitro/v1/config/authenticationpolicylabel_authenticationpolicy_binding
    Request Headers
    Cookie:NITRO_AUTH_TOKEN=<tokenvalue> 
    Content-Type:application/vnd.com.citrix.netscaler.authenticationpolicylabel_authenticationpolicy_binding
    Request Payload
    { 
        "authenticationpolicylabel_authenticationpolicy_binding": 
        { 
            "policyname":"p1", 
            "priority":"100", 
            "gotopriorityexpression":"END", 
            "labelname":"pl1" 
        } 
    }
  • Response:

    HTTP Status Code on Success
    201 Created
    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.

To unbind a resource, use the DELETE method and specify an "args" query string parameter in the URL that contains the attribute name and value in the relationship resource that designates the secondary resource.

For example, to unbind the service "svc_prod" from the load balancing virtual server "MyFirstLbVServer":
  • Request:

    HTTP Method
    DELETE
    URL
    http://<netscaler-ip-address>/nitro/v1/config/lbvserver_service_binding/MyFirstLbVServer?args=servicename:svc_prod
    Request Header
    Cookie:NITRO_AUTH_TOKEN=<tokenvalue>
  • 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.