(self, rdb)
This will create a health check with
        the supplied domain information
This will create a health check with
        the supplied domain information
This will create a health check with the supplied domain information
def createMonitor(self, rdb):
        '''
        This will create a health check with
        the supplied domain information
        '''
        if self.config['CRYPTO_ENABLED'] is True:
            crypto = Fernet(self.config['CRYPTO_KEY'])
            try:
                self.data = crypto.encrypt(json.dumps(self.data))
            except:
                return False
            self.encrypted = True
        mondata = {
            'name': self.name,
            'ctype': self.ctype,
            'uid': self.uid,
            'url': self.url,
            'failcount': 0,
            'status': self.status,
            'data': self.data,
            'encrypted' : self.encrypted
        }
        if self.exists(mondata['name'], mondata['uid'], rdb):
            return 'exists'
        else:
            mondata['status'] = 'queued'
            results = r.table('monitors').insert(mondata).run(rdb)
            if results['inserted'] == 1:
                qdata = {}
                qdata['item'] = mondata
                qdata['action'] = 'create'
                qdata['type'] = 'monitor'
                qdata['item']['cid'] = results['generated_keys'][0]
                self.cid = results['generated_keys'][0]
                urlchk = self.genURL(self.cid, rdb)
                if urlchk:
                    qdata['item']['url'] = self.url
                for dc in ["dc1queue", "dc2queue"]:
                    q1 = r.table(dc).insert(qdata).run(rdb)
                return results['generated_keys'][0]
            else:
                return False
def createMonitor ( self , rdb ) : if self . config [ 'CRYPTO_ENABLED' ] is True : crypto = Fernet ( self . config [ 'CRYPTO_KEY' ] ) try : self . data = crypto . encrypt ( json . dumps ( self . data ) ) except : return False self . encrypted = True mondata = { 'name' : self . name , 'ctype' : self . ctype , 'uid' : self . uid , 'url' : self . url , 'failcount' : 0 , 'status' : self . status , 'data' : self . data , 'encrypted' : self . encrypted } if self . exists ( mondata [ 'name' ] , mondata [ 'uid' ] , rdb ) : return 'exists' else : mondata [ 'status' ] = 'queued' results = r . table ( 'monitors' ) . insert ( mondata ) . run ( rdb ) if results [ 'inserted' ] == 1 : qdata = { } qdata [ 'item' ] = mondata qdata [ 'action' ] = 'create' qdata [ 'type' ] = 'monitor' qdata [ 'item' ] [ 'cid' ] = results [ 'generated_keys' ] [ 0 ] self . cid = results [ 'generated_keys' ] [ 0 ] urlchk = self . genURL ( self . cid , rdb ) if urlchk : qdata [ 'item' ] [ 'url' ] = self . url for dc in [ "dc1queue" , "dc2queue" ] : q1 = r . table ( dc ) . insert ( qdata ) . run ( rdb ) return results [ 'generated_keys' ] [ 0 ] else : return False