예제 #1
0
 /**
  * Use this API to fetch filtered set of nssimpleacl resources. filter string should be in JSON
  * format.eg: "port:80,servicetype:HTTP".
  */
 public static nssimpleacl[] get_filtered(nitro_service service, String filter) throws Exception {
   nssimpleacl obj = new nssimpleacl();
   options option = new options();
   option.set_filter(filter);
   nssimpleacl[] response = (nssimpleacl[]) obj.getfiltered(service, option);
   return response;
 }
예제 #2
0
 /** Use this API to count the nssimpleacl resources configured on NetScaler. */
 public static long count(nitro_service service) throws Exception {
   nssimpleacl obj = new nssimpleacl();
   options option = new options();
   option.set_count(true);
   nssimpleacl[] response = (nssimpleacl[]) obj.get_resources(service, option);
   if (response != null) {
     return response[0].__count;
   }
   return 0;
 }
예제 #3
0
 /**
  * Use this API to count the filtered set of nssimpleacl resources. set the filter parameter
  * values in filtervalue object.
  */
 public static long count_filtered(nitro_service service, filtervalue[] filter) throws Exception {
   nssimpleacl obj = new nssimpleacl();
   options option = new options();
   option.set_count(true);
   option.set_filter(filter);
   nssimpleacl[] response = (nssimpleacl[]) obj.getfiltered(service, option);
   if (response != null) {
     return response[0].__count;
   }
   return 0;
 }
예제 #4
0
 /** Use this API to add nssimpleacl. */
 public static base_response add(nitro_service client, nssimpleacl resource) throws Exception {
   nssimpleacl addresource = new nssimpleacl();
   addresource.aclname = resource.aclname;
   addresource.aclaction = resource.aclaction;
   addresource.td = resource.td;
   addresource.srcip = resource.srcip;
   addresource.destport = resource.destport;
   addresource.protocol = resource.protocol;
   addresource.ttl = resource.ttl;
   return addresource.add_resource(client);
 }
예제 #5
0
 /** Use this API to fetch nssimpleacl resource of given name . */
 public static nssimpleacl get(nitro_service service, String aclname) throws Exception {
   nssimpleacl obj = new nssimpleacl();
   obj.set_aclname(aclname);
   nssimpleacl response = (nssimpleacl) obj.get_resource(service);
   return response;
 }
예제 #6
0
 /** Use this API to fetch all the nssimpleacl resources that are configured on netscaler. */
 public static nssimpleacl[] get(nitro_service service, options option) throws Exception {
   nssimpleacl obj = new nssimpleacl();
   nssimpleacl[] response = (nssimpleacl[]) obj.get_resources(service, option);
   return response;
 }
예제 #7
0
 /** Use this API to flush nssimpleacl. */
 public static base_response flush(nitro_service client, nssimpleacl resource) throws Exception {
   nssimpleacl flushresource = new nssimpleacl();
   flushresource.estsessions = resource.estsessions;
   return flushresource.perform_operation(client, "flush");
 }
예제 #8
0
 /** Use this API to delete nssimpleacl. */
 public static base_response delete(nitro_service client, nssimpleacl resource) throws Exception {
   nssimpleacl deleteresource = new nssimpleacl();
   deleteresource.aclname = resource.aclname;
   return deleteresource.delete_resource(client);
 }
예제 #9
0
 /** Use this API to clear nssimpleacl. */
 public static base_response clear(nitro_service client) throws Exception {
   nssimpleacl clearresource = new nssimpleacl();
   return clearresource.perform_operation(client, "clear");
 }