T o account for the failure of some operations within the bulk operation, NIT RO allows you to configure one of the
following behaviors:
Exit. When the first error is encountered, the execution stops. T he commands that were executed before the error are
committed.
Continue. All the commands in the list are executed even if some commands fail.
Note: You must configure the required behavior while establishing a connection with the appliance, by setting the onerror
param in the nitro_service() method.
T he following sample code adds two NetScalers in one operation:
ns[] newns = new ns[2];
//Specify details of first NetScaler
newns[0] = new ns();
newns[0].set_name("ns_instance1");
newns[0].set_ip_address("10.70.136.5");
newns[0].set_netmask("255.255.255.0");
newns[0].set_gateway("10.70.136.1");
...
...
...
//Specify details of second NetScaler
newns[1] = new ns();
newns[1].set_name("ns_instance2");
newns[1].set_ip_address("10.70.136.8");
newns[1].set_netmask("255.255.255.0");
newns[1].set_gateway("10.70.136.1");
...
...
//upload the details of the NetScalers to the NITRO server
ns[] result = ns.add(nitroservice, newns);
Exception Handling
T he errorcode field indicates the status of the operation.
An errorcode of 0 indicates that the operation is successful.
A non-zero errorcode indicates an error in processing the NIT RO request.
T he error message field provides a brief explanation and the nature of the failure.
All exceptions in the execution of NIT RO APIs are caught by the com.citrix.sdx.nitro.exception.nitro_exception class. To get
information about the exception, you can use the getErrorCode() method.
For a more detailed description of the error codes, see the API reference available in the <NIT RO_SDK_HOME>/doc folder.
https://docs.citrix.com
© 1999-2017 Citrix Systems, Inc. All rights reserved.
p.224
Need help?
Do you have a question about the NetScaler SDX 8015 and is the answer not in the manual?