示例#1
0
	def get(self, service, obj) :
		ur""" Use this API to fetch a snmptrap_binding resource.
		"""
		try :
			if type(obj) is not list :
				option_ = options()
				option_.args = nitro_util.object_to_string_withoutquotes(obj)
				response = obj.get_resource(service, option_)
			else :
				if obj and len(obj) > 0 :
					for i in range(len(obj)) :
						option_ = options()
						option_.args = nitro_util.object_to_string_withoutquotes(obj[i])
						response[i] = obj[i].get_resource(service, option_)
			return response
		except Exception as e:
			raise e
示例#2
0
文件: snmpoid.py 项目: mahabs/nitro
	def get(cls, client, name="", option_="") :
		""" Use this API to fetch all the snmpoid resources that are configured on netscaler.
		"""
		try :
			if type(name) == cls :
				if type(name) is not list :
					option_ = options()
					option_.args = nitro_util.object_to_string_withoutquotes(name)
					response = name.get_resource(client, option_)
				else :
					if name and len(name) > 0 :
						response = [snmpoid() for _ in range(len(name))]
						for i in range(len(name)) :
							option_ = options()
							option_.args = nitro_util.object_to_string_withoutquotes(name[i])
							response[i] = name[i].get_resource(client, option_)
				return response
		except Exception as e :
			raise e
	def get(cls, service, obj) :
		ur""" Use this API to fetch a snmptrap_snmpuser_binding resources.
		"""
		try :
			option_ = options()
			option_.args = nitro_util.object_to_string_withoutquotes(obj)
			response =  obj.get_resources(service,option_)
			return response
		except Exception as e:
			raise e
	def  get(cls, service, name="", option_="") :
		ur""" Use this API to fetch the statistics of all servicegroupmember_stats resources that are configured on netscaler.
		"""
		try :
			obj = servicegroupmember_stats()
			option_ = options()
			option_.args = nitro_util.object_to_string_withoutquotes(name)
			response = obj.stat_resource(service, option_)
			return response
		except Exception as e:
			raise e
示例#5
0
文件: snmpoid.py 项目: mahabs/nitro
	def get_filtered(cls, client, filter_, obj) :
		""" Use this API to fetch filtered set of snmpoid resources.
		filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
		"""
		try :
			option_ = options()
			option_.filter = filter_
			option_.args = nitro_util.object_to_string_withoutquotes(obj)
			response = obj.getfiltered(client, option_)
			return response
		except Exception as e :
			raise e
示例#6
0
    def get_args(cls, client, args):
        ur""" Use this API to fetch all the dnsnaptrrec resources that are configured on netscaler.
	# This uses dnsnaptrrec_args which is a way to provide additional arguments while fetching the resources.
		"""
        try:
            obj = dnsnaptrrec()
            option_ = options()
            option_.args = nitro_util.object_to_string_withoutquotes(args)
            response = obj.get_resources(client, option_)
            return response
        except Exception as e:
            raise e
示例#7
0
	def get(cls, client, name="", option_="") :
		""" Use this API to fetch all the systementity resources that are configured on netscaler.
		"""
		try :
			if type(name) == cls :
				if type(name) is not list :
					option_ = options()
					option_.args = nitro_util.object_to_string_withoutquotes(name)
					response = name.get_resource(client, option_)
				return response
		except Exception as e :
			raise e
	def get_filtered(cls, service, obj, filter_) :
		""" Use this API to fetch filtered set of clusternodegroup_service_binding resources.
		Filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
		"""
		try :
			option_ = options()
			option_.filter = filter_
			option_.args = nitro_util.object_to_string_withoutquotes(obj)
			response = obj.getfiltered(service, option_)
			return response
		except Exception as e:
			raise e
    def get(cls, service, name="", option_=""):
        r""" Use this API to fetch the statistics of all servicegroupmember_stats resources that are configured on netscaler.
		 set statbindings=True in options to retrieve bindings.
		"""
        try:
            obj = servicegroupmember_stats()
            if not option_:
                option_ = options()
            option_.args = nitro_util.object_to_string_withoutquotes(name)
            response = obj.stat_resource(service, option_)
            return response
        except Exception as e:
            raise e
    def count(cls, service, obj):
        ur""" Use this API to count streamidentifier_streamsession_binding resources configued on NetScaler.
		"""
        try:
            option_ = options()
            option_.count = True
            option_.args = nitro_util.object_to_string_withoutquotes(obj)
            response = obj.get_resources(service, option_)
            if response:
                return response[0].__dict__["___count"]
            return 0
        except Exception as e:
            raise e
示例#11
0
    def count(cls, service, obj):
        r""" Use this API to count streamidentifier_streamsession_binding resources configued on NetScaler.
		"""
        try:
            option_ = options()
            option_.count = True
            option_.args = nitro_util.object_to_string_withoutquotes(obj)
            response = obj.get_resources(service, option_)
            if response:
                return response[0].__dict__['___count']
            return 0
        except Exception as e:
            raise e
示例#12
0
    def count(cls, client, obj):
        r""" Use this API to count the svcbindings resources configured on NetScaler.
		"""
        try:
            option_ = options()
            option_.count = True
            option_.args = nitro_util.object_to_string_withoutquotes(obj)
            response = obj.get_resources(client, option_)
            if response:
                return response[0].__dict__['___count']
            return 0
        except Exception as e:
            raise e
示例#13
0
    def get(cls, client, name="", option_=""):
        ur""" Use this API to fetch all the systemeventhistory resources that are configured on netscaler.
		"""
        try:
            if type(name) == cls:
                if type(name) is not list:
                    option_ = options()
                    option_.args = nitro_util.object_to_string_withoutquotes(
                        name)
                    response = name.get_resource(client, option_)
                return response
        except Exception as e:
            raise e
示例#14
0
	def get(cls, client, name="", option_="") :
		r""" Use this API to fetch all the systementity resources that are configured on netscaler.
		"""
		try :
			if type(name) is not list :
				if type(name) == cls :
					raise Exception('Invalid parameter name:{0}'.format(type(name)))
				option_ = options()
				option_.args = nitro_util.object_to_string_withoutquotes(name)
				response = name.get_resource(client, option_)
				return response
		except Exception as e :
			raise e
示例#15
0
文件: snmpoid.py 项目: mahabs/nitro
	def count(cls, client, obj) :
		""" Use this API to count the snmpoid resources configured on NetScaler.
		"""
		try :
			option_ = options()
			option_.count = True
			option_.args = nitro_util.object_to_string_withoutquotes(obj)
			response = obj.get_resources(client, option_)
			if response :
				return response[0].__dict__['___count']
			return 0
		except Exception as e :
			raise e
	def count(cls, service, obj) :
		""" Use this API to count clusternodegroup_service_binding resources configued on NetScaler.
		"""
		try :
			option_ = options()
			option_.count = True
			option_.args = nitro_util.object_to_string_withoutquotes(obj)
			response = obj.get_resources(service, option_)
			if response :
				return response[0].__dict__['___count']
			return 0
		except Exception as e:
			raise e
示例#17
0
	def get(cls, client, name="", option_="") :
		ur""" Use this API to fetch all the snmptrap resources that are configured on netscaler.
		"""
		try :
			if not name :
				obj = snmptrap()
				response = obj.get_resources(client, option_)
			else :
				if type(name) == cls :
					if type(name) is not list :
						option_ = options()
						option_.args = nitro_util.object_to_string_withoutquotes(name)
						response = name.get_resource(client, option_)
					else :
						if name and len(name) > 0 :
							response = [snmptrap() for _ in range(len(name))]
							for i in range(len(name)) :
								option_ = options()
								option_.args = nitro_util.object_to_string_withoutquotes(name[i])
								response[i] = name[i].get_resource(client, option_)
			return response
		except Exception as e :
			raise e
    def get(cls, service, name="", option_=""):
        ur""" Use this API to fetch the statistics of all inatsession_stats resources that are configured on netscaler.
		"""
        try:
            obj = inatsession_stats()
            if name:
                obj.name = name
                response = obj.stat_resource(service, option_)
            option_ = options()
            option_.args = nitro_util.object_to_string_withoutquotes(name)
            response = obj.stat_resource(service, option_)
            return response
        except Exception as e:
            raise e
示例#19
0
    def count_filtered(cls, client, filter_, obj):
        r""" Use this API to count filtered the set of nslimitsessions resources.
		Filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
		"""
        try:
            option_ = options()
            option_.count = True
            option_.filter = filter_
            option_.args = nitro_util.object_to_string_withoutquotes(obj)
            response = obj.getfiltered(client, option_)
            if response:
                return response[0].__dict__['___count']
            return 0
        except Exception as e:
            raise e
	def count_filtered(cls, service, obj, filter_) :
		""" Use this API to count the filtered set of clusternodegroup_lbvserver_binding resources.
		Filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
		"""
		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
示例#21
0
文件: snmpoid.py 项目: mahabs/nitro
	def count_filtered(cls, client, filter_, obj) :
		""" Use this API to count filtered the set of snmpoid resources.
		Filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
		"""
		try :
			option_ = options()
			option_.count = True
			option_.filter = filter_
			option_.args = nitro_util.object_to_string_withoutquotes(obj)
			response = obj.getfiltered(client, option_)
			if response :
				return response[0].__dict__['___count']
			return 0
		except Exception as e :
			raise e
示例#22
0
    def count_filtered(cls, service, obj, filter_):
        r""" Use this API to count the filtered set of clusternodegroup_crvserver_binding resources.
		Filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
		"""
        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
示例#23
0
    def delete_resource(self, service):
        """ Use this method to perform a delete operation on netscaler resource.
        
        Parameters:
			service - nitro_service object
        
        Returns:
			status of the operation performed.
        
        Throws:
			Exception of the type nitro_exception is thrown.
        """
        try:
            if not service.isLogin() :
                service.login()
            str_ = nitro_util.object_to_string_withoutquotes(self)
            response = self.delete_request(service, str_)
            return response
        except Exception as e:
            raise e
示例#24
0
 def delete_resource(self, service):
     """ Use this method to perform a delete operation on netscaler resource.
     
     Parameters:
         service - nitro_service object
     
     Returns:
         status of the operation performed.
     
     Throws:
         Exception of the type nitro_exception is thrown.
     """
     try:
         if not service.isLogin():
             service.login()
         str_ = nitro_util.object_to_string_withoutquotes(self)
         response = self.delete_request(service, str_)
         return response
     except Exception as e:
         raise e