Access the Monitor Twilio Domain

        :returns: Monitor Twilio Domain
        :rtype: twilio.rest.monitor.Monitor
31
def monitor(self):
        
        if self._monitor is None:
            from twilio.rest.monitor import Monitor
            self._monitor = Monitor(self)
        return self._monitor
815181
def ip_registrant_monitor(self, query, days_back=0, search_type="all", server=None, country=None, org=None, page=1,
                              include_total_count=False, **kwargs):
        """"""
        return self._results('ip-registrant-monitor', '/v1/ip-registrant-monitor', query=query,
                            days_back=days_back, search_type=search_type, server=server, country=country, org=org,
                            page=page, include_total_count=include_total_count, **kwargs)
308547
def getMonitorByName(self, monitorFriendlyName):
        
        url = self.baseUrl
        url += "getMonitors?apiKey=%s" % self.apiKey
        url += "&noJsonCallback=1&format=json"
        success, response = self.requestApi(url)
        if success:
            monitors = response.get('monitors').get('monitor')
            for i in range(len(monitors)):
                monitor = monitors[i]
                if monitor.get('friendlyname') == monitorFriendlyName:
                    status = monitor.get('status')
                    alltimeuptimeratio = monitor.get('alltimeuptimeratio')
                    return status, alltimeuptimeratio
        return None, None
1205528
def cloudwatch_connection(self):
        
        if self._cloudwatch_connection is None:
            conn = self._session.create_client("cloudwatch", self.connection.region)
            self._cloudwatch_connection = conn
        return self._cloudwatch_connection
843763
def monitored(name, **params):
    '''
    

    '''

    ret = {'name': name, 'changes': {}, 'result': None, 'comment': ''}
    if __salt__['uptime.check_exists'](name=name):
        ret['result'] = True
        ret['comment'] = 'URL {0} is already monitored'.format(name)
        ret['changes'] = {}
        return ret
    if not __opts__['test']:
        url_monitored = __salt__['uptime.create'](name, **params)
        if url_monitored:
            ret['result'] = True
            msg = 'Successfully added the URL {0} to uptime'
            ret['comment'] = msg.format(name)
            ret['changes'] = {'url_monitored': url_monitored}
        else:
            ret['result'] = False
            ret['comment'] = 'Failed to add {0} to uptime'.format(name)
            ret['changes'] = {}
    else:
        msg = 'URL {0} is going to be added to uptime'
        ret.update(result=None,
                   comment=msg.format(name))
    return ret
595343
def monitor(self):
        """"""
        if self._monitor_api is None:
            self._monitor_api = self.get_monitor_api()
        return self._monitor_api
741241
def ip_monitor(self, query, days_back=0, page=1, **kwargs):
        """"""
        return self._results('ip-monitor', '/v1/ip-monitor', query=query, days_back=days_back, page=page,
                            items_path=('alerts', ), **kwargs)
1146423
def fetch_watch_info(self):
        
        self._watch_info = self.send_and_read(WatchVersion(data=WatchVersionRequest()), WatchVersion).data
1179046
def check_many(self, domains):
        
        return dict((item.domain, item.status) for item in self.check_domain_request(domains))
1138551
def _get_channel(self):
        
        channel = self._transport.open_session()
        channel.set_combine_stderr(True)
        channel.get_pty()
        return channel
1152639
async def get_proxies(self):
        
        log.debug('Try to get proxies from %s' % self.domain)

        async with aiohttp.ClientSession(
            headers=get_headers(), cookies=self._cookies, loop=self._loop
        ) as self._session:
            await self._pipe()

        log.debug(
            '%d proxies received from %s: %s'
            % (len(self.proxies), self.domain, self.proxies)
        )
        return self.proxies
578381
def previous_page(self):
        
        if not self.previous_page_url:
            return None

        response = self._version.domain.twilio.request('GET', self.previous_page_url)
        cls = type(self)
        return cls(self._version, response, self._solution)
773183
def load(self, callback=None, errback=None, reload=False):
        
        if not reload and self.data:
            raise MonitorException('monitor already loaded')

        def success(result, *args):
            self.data = result
            if callback:
                return callback(self)
            else:
                return self

        return self._rest.retrieve(self.data['id'], callback=success,
                                   errback=errback)
486740
def watch(self, signal_name):
		
		watcher = WSignalSource.Watcher(
			self.__queues[signal_name], lambda x: self.__watchers_callbacks[signal_name].remove(x)
		)
		self.__watchers_callbacks[signal_name].add(watcher)
		return watcher
368871
def get_port_monitor(self):
        
        uri = "{}{}".format(self.data["uri"], self.PORT_MONITOR_PATH)
        return self._helper.do_get(uri)
278437
def get_monitor(host=PINBA_SERVER, port=PINBA_PORT, *args, **kwargs):
    
    kwargs['servername'] = PINBA_SERVER_NAME
    kwargs['scriptname'] = __file__

    for item in inspect.stack():
        if item and __file__ not in item:
            kwargs['scriptname'] = item[3]
            break

    return ScriptMonitor((host, port), *args, **kwargs)
1177210
def next_page(self):
        
        if not self.next_page_url:
            return None

        response = self._version.domain.twilio.request('GET', self.next_page_url)
        cls = type(self)
        return cls(self._version, response, self._solution)