Returns all service monitors.
331157
public List<ServiceMonitor> getServiceMonitors() {
        List<ServiceMonitor> serviceMonitors = new ArrayList<>();
        serviceMonitors.addAll(getDynamicServices(ServiceMonitor.class));
        return serviceMonitors;
    }
159727
public List<TaskMonitor> getTaskMonitors(RuntimeContext context) {
        return getTaskMonitors().stream().filter(monitor ->
            monitor.isEnabled(context)
        ).collect(Collectors.toList());
    }
1012602
def getMonitors(self, apikey, monitors='none'):
        """"""
        data= 'api_key=' + apikey + '&format=json'
        if monitors != 'none':
            data += '&monitors=' + monitors
        fetchUrl = self.BASE_URL
        fetchUrl += 'getMonitors'
        try:
            monitors = requests.post(fetchUrl,
                headers=self.headers, data=data, timeout=3)
        except:
            return False
        else:
            if monitors:
                return monitors.json()
            else:
                return False
275042
public List<AdministrativeMonitor> getActiveAdministrativeMonitors() {
        return administrativeMonitors.stream().filter(m -> m.isEnabled() && m.isActivated()).collect(Collectors.toList());
    }
637485
def monitors(self):
        # type: () -> Monitors
        

        if not self._monitors:
            int_ = int
            user32 = self.user32
            get_system_metrics = user32.GetSystemMetrics

            # All monitors
            self._monitors.append(
                {
                    "left": int_(get_system_metrics(76)),  # SM_XVIRTUALSCREEN
                    "top": int_(get_system_metrics(77)),  # SM_YVIRTUALSCREEN
                    "width": int_(get_system_metrics(78)),  # SM_CXVIRTUALSCREEN
                    "height": int_(get_system_metrics(79)),  # SM_CYVIRTUALSCREEN
                }
            )

            # Each monitors
            def _callback(monitor, data, rect, dc_):
                # types: (int, HDC, LPRECT, LPARAM) -> int
                """
                Callback for monitorenumproc() function, it will return
                a RECT with appropriate values.
                """
                # pylint: disable=unused-argument

                rct = rect.contents
                self._monitors.append(
                    {
                        "left": int_(rct.left),
                        "top": int_(rct.top),
                        "width": int_(rct.right - rct.left),
                        "height": int_(rct.bottom - rct.top),
                    }
                )
                return 1

            callback = self.monitorenumproc(_callback)
            user32.EnumDisplayMonitors(0, 0, callback, 0)

        return self._monitors
433514
private void getAllServices() {
        try {
            List<ModelServiceInstance> instances = new DirectoryServiceRestfulClient().getAllInstances();
            for (ModelServiceInstance instance :instances){
                printServiceInstance(ServiceInstanceUtils.toServiceInstance(instance));
            }
        } catch (ServiceException e) {
            e.printStackTrace();
            fail(e.getServiceDirectoryError().getErrorMessage());
        }
    }
886075
def showMonitors(cls):
        
        Debug.info("*** monitor configuration [ {} Screen(s)] ***".format(cls.getNumberScreens()))
        Debug.info("*** Primary is Screen {}".format(cls.primaryScreen))
        for index, screen in enumerate(PlatformManager.getScreenDetails()):
            Debug.info("Screen {}: ({}, {}, {}, {})".format(index, *screen["rect"]))
        Debug.info("*** end monitor configuration ***")
786119
@Override
  public Collection<Monitor<?>> getRegisteredMonitors() {
    if (updatePending.getAndSet(false)) {
      monitorList.set(UnmodifiableList.copyOf(monitors.values()));
    }
    return monitorList.get();
  }
960747
def list_lbaas_healthmonitors(self, retrieve_all=True, **_params):
        """"""
        return self.list('healthmonitors', self.lbaas_healthmonitors_path,
                         retrieve_all, **_params)
661210
def update_monitors(self):
        
        self.thread_debug("Starting monitor refresh", module="update_monitors")

        # need to make a more efficient way of doing this via Reflex Engine
        monitors = []
        self.rcs.cache_reset()

        svcs = self.rcs.cache_list('service',
                                   cols=['pipeline', 'name',
                                         'active-instances'])
        for svc in svcs:
            try:
                pipeline = self.rcs.cache_get('pipeline', svc['pipeline'])
                for mon in pipeline.get('monitor', []):
                    self.DEBUG("monitor {}".format(mon))
                    mon['service'] = svc['name']
                    mon['pipeline'] = svc['pipeline']
                    for inst_name in svc.get('active-instances', []):
                        inst = self.rcs.cache_get('instance', inst_name)

                        # todo: insert: macro flatten

                        mymon = mon.copy()
                        mymon['instance'] = inst_name
                        mymon['target'] = inst['address']
                        mymon['title'] = svc['name'] + ": " + mon['name']
                        monitors.append(mymon)
            except KeyboardInterrupt:
                raise
            except: # pylint: disable=bare-except
                self.NOTIFY("Error in processing monitor:", err=traceback.format_exc())

        self.NOTIFY("Refreshed monitors", total_monitors=len(monitors))
        self.DEBUG("Monitors", monitors=monitors)

        # mutex / threadsafe?
        self.monitors = monitors
        cache = self.rcs._cache # pylint: disable=protected-access
        self.instances = cache['instance']
        self.services = cache['service']
        self.pipelines = cache['pipeline']
        self.thread_debug("Refresh complete", module="update_monitors")
96968
def _GetGsScopes(self):
    """"""
    service_accounts = self.watcher.GetMetadata(metadata_key=self.metadata_key)
    try:
      scopes = service_accounts[self.service_account]['scopes']
      return list(GS_SCOPES.intersection(set(scopes))) if scopes else None
    except KeyError:
      return None
128523
def list_service_profiles(self, retrieve_all=True, **_params):
        """"""
        return self.list('service_profiles', self.service_profiles_path,
                         retrieve_all, **_params)
1165515
async def get_notifications(self) -> List[Notification]:
        
        notifications = []
        for serv in self.services:
            for notification in self.services[serv].notifications:
                notifications.append(notification)
        return notifications
1351519
public Collection<Monitor> list(List<String> queryParams)
    {
        return HTTP.GET("/v3/monitors", null, queryParams, MONITORS).get();
    }
1147364
public EventRecord[] monitor() {
    ArrayList<EventRecord> recs = new ArrayList<EventRecord>();

    for (String device : devices) {
      try {
        recs.add(query(device));
      } catch (Exception e) {
        e.printStackTrace();
      }
    }

    EventRecord[] T = new EventRecord[recs.size()];

    return recs.toArray(T);
  }
541149
def get_services(self):
        """"""
        result = []
        nodes = self.root.iterfind(
            './/ns:service', namespaces={'ns': self.namespace})
        for node in nodes:
            result.append(FritzService(
                node.find(self.nodename('serviceType')).text,
                node.find(self.nodename('controlURL')).text,
                node.find(self.nodename('SCPDURL')).text))
        return result
753181
public Collection<Monitor> list(int offset, int limit)
    {
        return list(filters().offset(offset).limit(limit).build());
    }