Product Documentation

Performing Bulk Operations

Jun 14, 2016

You can create and update multiple resources simultaneously and thus minimize network traffic. For example, you can add multiple load balancing virtual servers in the same operation. To perform a bulk operation, specify the required parameters in the same request payload.

To account for the failure of some operations within the bulk operation, NITRO allows you to configure one of the following behaviors:
  • Exit. When the first error is encountered, the execution stops. The NITRO operations that were executed before the error are committed. This is the default behavior.
  • Rollback. When the first error is encountered, the execution stops. The NITRO operations that were executed before the error are rolled back. Rollback is only supported for add and bind NITRO operations.
  • Continue. All the NITRO operations in the list are executed even if some operations fail.

You must specify the behavior of the bulk operation in the request header using the X-NITRO-ONERROR parameter.

For example, to add two load balancing virtual servers in one operation, and continue even if one of the add operation fails:
  • Request:

    HTTP Method
    POST
    URL
    http://<netscaler-ip-address>/nitro/v1/config/lbvserver
    Request Headers
    Cookie:NITRO_AUTH_TOKEN=<tokenvalue> 
    Content-Type:application/vnd.com.citrix.netscaler.lbvserver_list+json 
    X-NITRO-ONERROR:continue
    Request Payload
    { 
        "lbvserver": 
        [ 
            { 
                "name":"new_lbvserver1", 
                "servicetype":"http" 
            }, 
     
            { 
                "name":"new_lbvserver2", 
                "servicetype":"http" 
            } 
        ] 
    }
  • Response:

    HTTP Status Code on Success
    201 Created for the add operation and 200 OK for the update operation.
    HTTP Status Code on Failure
    207 Multi Status with error details in the response payload. For more information, see Error Handling.