© 1999-2017 Citrix Systems, Inc. All rights reserved.
p.241
https://docs.citrix.com
The following sample code retrieves statistics of a NetScaler instance with ID 123456a:
ns obj = new ns();
obj.set_id("123456a");
ns stats = ns.get(nitroservice, obj);
System.out.println("CPU Usage:" + stats.get_ns_cpu_usage());
System.out.println("Memory Usage:" + stats.get_ns_memory_usage());
System.out.println("Request rate/sec:" +stats.get_http_req());
Updat ing a Resource
Updat ing a Resource
To update the properties of an existing resource on the appliance, do the following:
1. Set the id property to the ID of the resource to be updated.
2. Set the value for the required properties of the resource by using the corresponding property name. The result is a
resource object.
Note: These values are set locally on the client. The values are not reflected on the appliance till the object is uploaded.
3. Upload the resource object to the appliance, using the update() method.
The following sample code updates the name of the NetScaler instance with ID 123456a to 'ns_instance_new':
ns update_obj = new ns();
//Set the ID of the NetScaler to be updated
update_obj.set_id("123456a");
//Get existing NetScaler details
update_obj = ns.get(nitroservice, update_obj);
//Update the name of the NetScaler to "ns_instance_new" locally
update_obj.set_name("ns_instance_new");
//Upload the updated NetScaler details
ns result = ns.update(nitroservice, update_obj);
Delet ing a Resource
Delet ing a Resource
To delete an existing resource, invoke the static method delete() on the resource class, by passing the ID of the resource to
be removed, as an argument.
The following sample code deletes a NetScaler instance with ID 1:
ns obj = new ns();
obj.set_id("123456a");
ns.delete(nitroservice, obj);
Bulk Operat ions
Bulk Operat ions
You can query or change multiple resources simultaneously and thus minimize network traffic. For example, you can add
multiple NetScaler appliances in the same operation.
Each resource class has methods that take an array of resources for adding, updating, and removing resources. To perform
a bulk operation, specify the details of each operation locally and then send the details at one time to the server.
Содержание NetScaler SDX 11500
Страница 90: ...1999 2017 Citrix Systems Inc All rights reserved p 90 https docs citrix com 5 Click OK...
Страница 218: ...1999 2017 Citrix Systems Inc All rights reserved p 218 https docs citrix com...
Страница 235: ...1999 2017 Citrix Systems Inc All rights reserved p 235 https docs citrix com...
Страница 253: ...1999 2017 Citrix Systems Inc All rights reserved p 253 https docs citrix com errorcode 1 message IP address is missing...