Esempio n. 1
0
    def count_filtered(cls, service, obj, filter_) :
        """Use this API to count the filtered set of clusternodegroup_service_binding resources.
        Filter string should be in JSON format.eg: "port:80,servicetype:HTTP".

        :param service: 
        :param obj: 
        :param filter_: 

        """
        try :
            option_ = options()
            option_.count = True
            option_.filter = filter_
            option_.args = nitro_util.object_to_string_withoutquotes(obj)
            response = obj.getfiltered(service, option_)
            if response :
                return response[0].__dict__['___count']
            return 0
        except Exception as e:
            raise e
Esempio n. 2
0
    def count_filtered(cls, service, name, filter_):
        """Use this API to count the filtered set of authorizationpolicy_aaauser_binding resources.
        Filter string should be in JSON format.eg: "port:80,servicetype:HTTP".

        :param service: 
        :param name: 
        :param filter_: 

        """
        try:
            obj = authorizationpolicy_aaauser_binding()
            obj.name = name
            option_ = options()
            option_.count = True
            option_.filter = filter_
            response = obj.getfiltered(service, option_)
            if response:
                return response[0].__dict__['___count']
            return 0
        except Exception as e:
            raise e
Esempio n. 3
0
    def count_filtered(cls, service, callid, filter_):
        """Use this API to count the filtered set of lsnsipalgcall_datachannel_binding resources.
        Filter string should be in JSON format.eg: "port:80,servicetype:HTTP".

        :param service: 
        :param callid: 
        :param filter_: 

        """
        try:
            obj = lsnsipalgcall_datachannel_binding()
            obj.callid = callid
            option_ = options()
            option_.count = True
            option_.filter = filter_
            response = obj.getfiltered(service, option_)
            if response:
                return response[0].__dict__['___count']
            return 0
        except Exception as e:
            raise e
    def count_filtered(cls, service, groupname, filter_):
        """Use this API to count the filtered set of lsngroup_lsnlogprofile_binding resources.
        Filter string should be in JSON format.eg: "port:80,servicetype:HTTP".

        :param service: 
        :param groupname: 
        :param filter_: 

        """
        try:
            obj = lsngroup_lsnlogprofile_binding()
            obj.groupname = groupname
            option_ = options()
            option_.count = True
            option_.filter = filter_
            response = obj.getfiltered(service, option_)
            if response:
                return response[0].__dict__['___count']
            return 0
        except Exception as e:
            raise e
    def count_filtered(cls, service, certkey, filter_):
        """Use this API to count the filtered set of sslcertkey_service_binding resources.
        Filter string should be in JSON format.eg: "port:80,servicetype:HTTP".

        :param service: 
        :param certkey: 
        :param filter_: 

        """
        try:
            obj = sslcertkey_service_binding()
            obj.certkey = certkey
            option_ = options()
            option_.count = True
            option_.filter = filter_
            response = obj.getfiltered(service, option_)
            if response:
                return response[0].__dict__['___count']
            return 0
        except Exception as e:
            raise e
    def count_filtered(cls, service, td, filter_):
        """Use this API to count the filtered set of nstrafficdomain_vlan_binding resources.
        Filter string should be in JSON format.eg: "port:80,servicetype:HTTP".

        :param service: 
        :param td: 
        :param filter_: 

        """
        try:
            obj = nstrafficdomain_vlan_binding()
            obj.td = td
            option_ = options()
            option_.count = True
            option_.filter = filter_
            response = obj.getfiltered(service, option_)
            if response:
                return response[0].__dict__['___count']
            return 0
        except Exception as e:
            raise e
    def count_filtered(cls, service, sitepath, filter_):
        """Use this API to count the filtered set of wisite_farmname_binding resources.
        Filter string should be in JSON format.eg: "port:80,servicetype:HTTP".

        :param service: 
        :param sitepath: 
        :param filter_: 

        """
        try:
            obj = wisite_farmname_binding()
            obj.sitepath = sitepath
            option_ = options()
            option_.count = True
            option_.filter = filter_
            response = obj.getfiltered(service, option_)
            if response:
                return response[0].__dict__['___count']
            return 0
        except Exception as e:
            raise e
Esempio n. 8
0
    def count_filtered(cls, service, id, filter_):
        """Use this API to count the filtered set of hanode_routemonitor_binding resources.
        Filter string should be in JSON format.eg: "port:80,servicetype:HTTP".

        :param service: 
        :param id: 
        :param filter_: 

        """
        try:
            obj = hanode_routemonitor_binding()
            obj.id = id
            option_ = options()
            option_.count = True
            option_.filter = filter_
            response = obj.getfiltered(service, option_)
            if response:
                return response[0].__dict__['___count']
            return 0
        except Exception as e:
            raise e
Esempio n. 9
0
    def count_filtered(cls, service, vlan, filter_):
        """Use this API to count the filtered set of nd6ravariables_onlinkipv6prefix_binding resources.
        Filter string should be in JSON format.eg: "port:80,servicetype:HTTP".

        :param service: 
        :param vlan: 
        :param filter_: 

        """
        try:
            obj = nd6ravariables_onlinkipv6prefix_binding()
            obj.vlan = vlan
            option_ = options()
            option_.count = True
            option_.filter = filter_
            response = obj.getfiltered(service, option_)
            if response:
                return response[0].__dict__['___count']
            return 0
        except Exception as e:
            raise e
Esempio n. 10
0
    def perform_operationEx(self, service, action):
        """Use this method to perform a POST operation that returns a resource ...etc
        operation on netscaler resource.

        :param service: nitro_service object
        :param action: action needs to be taken on resource
        :returns: requested resource
        
        Throws:

        """
        try:
            if (not service.isLogin()
                    and self.__class__.get_object_type() != "login"):
                service.login()
            opt = options()
            opt.action = action
            response = self.post_requestEx(service, opt)
            return response
        except Exception as e:
            raise e
Esempio n. 11
0
    def count_filtered(cls, service, limitidentifier, filter_) :
        """Use this API to count the filtered set of nslimitidentifier_nslimitsessions_binding resources.
        Filter string should be in JSON format.eg: "port:80,servicetype:HTTP".

        :param service: 
        :param limitidentifier: 
        :param filter_: 

        """
        try :
            obj = nslimitidentifier_nslimitsessions_binding()
            obj.limitidentifier = limitidentifier
            option_ = options()
            option_.count = True
            option_.filter = filter_
            response = obj.getfiltered(service, option_)
            if response :
                return response[0].__dict__['___count']
            return 0
        except Exception as e:
            raise e
Esempio n. 12
0
    def unset_resource(self, service, args):
        """Use this method to perform an Unset operation on netscaler resource.
        
        Parameters:
            service - nitro_service object.

        :param service: 
        :param args: 
        :returns: status of the operation performed.
        
        Throws:

        """
        try:
            if not service.isLogin():
                service.login()
            opt = options()
            opt.action = "unset"
            response = self.unset_request(service, opt, args)
            return response
        except Exception as e:
            raise e
Esempio n. 13
0
    def clear_config(self, force="", level=""):
        """Use self API to clear configuration.

        :param force: clear confirmation without prompting. (Default value = "")
        :param level: clear config according to the level. eg: basic, extended, full (Default value = "")
        :returns: status of the operation performed.

        """
        try: 
            if level and force :
                resource = nsconfig()
                if (force):
                    resource.force = force
                resource.level = level
                option = options()
                option.action = "clear"
                result = resource.perform_operation(self, "", option)
                return result                
            elif force :
                return self.clear_config(force, "basic")
            else :
                return self.clear_config(True,"basic")
        except Exception as e:
            raise e