You can create, retrieve, update, and delete 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, you instantiate an array of the resource class, configure the properties of all the instances locally, and then upload all the instances to the NetScaler with one command.
Specifying the Bulk Operation Behavior on the NetScaler
To account for the failure of some operations within the bulk operation, NITRO allows you to configure one of the following behaviors while establishing a connection with the appliance.
- Exit. When the first error is encountered, the execution stops. The commands that were executed before the error are committed.
- Rollback. When the first error is encountered, the execution stops. The commands that were executed before the error are rolled back. Rollback is only supported for add and bind commands.
- Continue. All the commands in the list are executed even if some commands fail.
The following sample code creates two load balancing virtual servers.