list instances.
    returns EventVRRPListReply([VRRPInstance]).
555561
def vrrp_list(app, instance_name=None):
    
    list_request = vrrp_event.EventVRRPListRequest(instance_name)
    list_request.dst = vrrp_event.VRRP_MANAGER_NAME
    return app.send_request(list_request)
1026507
def ec2_instances():
    ""
    region = boto.ec2.get_region(REGION)
    reservations = region.connect().get_all_instances()
    instances = []
    for reservation in reservations:
        instances += reservation.instances
    return instances
1134827
def events(self):
        ''''''
        ret = []
        while self.out_queue.qsize():
            ret.append(self.out_queue.get())
        return ret
1341962
def list_clients(self, instance=None):
        
        # Server does not do pagination on listings of this resource.
        # Return an iterator anyway for similarity with other API methods
        url = '/clients'
        if instance:
            url = '/instances/{}/clients'.format(instance)
        response = self.get_proto(path=url)
        message = rest_pb2.ListClientsResponse()
        message.ParseFromString(response.content)
        clients = getattr(message, 'client')
        return iter([Client(client) for client in clients])
1251995
def list(self, cur_p=''):
        '''
        
        '''
        current_page_number = int(cur_p) if cur_p else 1
        current_page_number = 1 if current_page_number < 1 else current_page_number

        kwd = {
            'current_page': current_page_number
        }
        recs = MEntity.get_all_pager(current_page_num=current_page_number)
        self.render('misc/entity/entity_list.html',
                    imgs=recs,
                    cfg=config.CMS_CFG,
                    kwd=kwd,
                    userinfo=self.userinfo)
713990
def list_services(self, instance):
        
        # Server does not do pagination on listings of this resource.
        # Return an iterator anyway for similarity with other API methods
        url = '/services/{}'.format(instance)
        response = self.get_proto(path=url)
        message = rest_pb2.ListServiceInfoResponse()
        message.ParseFromString(response.content)
        services = getattr(message, 'service')
        return iter([Service(service) for service in services])
544583
def list(self):
        
        resp = self.client.api.plugins()
        return [self.prepare_model(r) for r in resp]
1228999
def get_network_instances(self, name=''):
        """"""

        output = self._show_vrf()
        vrfs = {}
        all_vrf_interfaces = {}
        for vrf in output:
            if (vrf.get('route_distinguisher', '') == "<not set>" or
                    vrf.get('route_distinguisher', '') == 'None'):
                vrf['route_distinguisher'] = u''
            else:
                vrf['route_distinguisher'] = py23_compat.text_type(vrf['route_distinguisher'])
            interfaces = {}
            for interface_raw in vrf.get('interfaces', []):
                interface = interface_raw.split(',')
                for line in interface:
                    if line.strip() != '':
                        interfaces[py23_compat.text_type(line.strip())] = {}
                        all_vrf_interfaces[py23_compat.text_type(line.strip())] = {}

            vrfs[py23_compat.text_type(vrf['name'])] = {
                          u'name': py23_compat.text_type(vrf['name']),
                          u'type': u'L3VRF',
                          u'state': {
                              u'route_distinguisher': vrf['route_distinguisher'],
                          },
                          u'interfaces': {
                              u'interface': interfaces,
                          },
            }
        all_interfaces = self.get_interfaces_ip().keys()
        vrfs[u'default'] = {
            u'name': u'default',
            u'type': u'DEFAULT_INSTANCE',
            u'state': {
                u'route_distinguisher': u'',
            },
            u'interfaces': {
                u'interface': {
                    k: {} for k in all_interfaces if k not in all_vrf_interfaces.keys()
                },
            },
        }

        if name:
            if name in vrfs:
                return {py23_compat.text_type(name): vrfs[name]}
            return {}
        else:
            return vrfs
772637
def get_network_instances(self, name=""):
        """"""

        output = self._show_vrf()
        vrfs = {}
        all_vrf_interfaces = {}
        for vrf in output:
            if (
                vrf.get("route_distinguisher", "") == "<not set>"
                or vrf.get("route_distinguisher", "") == "None"
            ):
                vrf["route_distinguisher"] = ""
            else:
                vrf["route_distinguisher"] = py23_compat.text_type(
                    vrf["route_distinguisher"]
                )
            interfaces = {}
            for interface_raw in vrf.get("interfaces", []):
                interface = interface_raw.split(",")
                for line in interface:
                    if line.strip() != "":
                        interfaces[py23_compat.text_type(line.strip())] = {}
                        all_vrf_interfaces[py23_compat.text_type(line.strip())] = {}

            vrfs[py23_compat.text_type(vrf["name"])] = {
                "name": py23_compat.text_type(vrf["name"]),
                "type": "L3VRF",
                "state": {"route_distinguisher": vrf["route_distinguisher"]},
                "interfaces": {"interface": interfaces},
            }
        all_interfaces = self.get_interfaces_ip().keys()
        vrfs["default"] = {
            "name": "default",
            "type": "DEFAULT_INSTANCE",
            "state": {"route_distinguisher": ""},
            "interfaces": {
                "interface": {
                    k: {} for k in all_interfaces if k not in all_vrf_interfaces.keys()
                }
            },
        }

        if name:
            if name in vrfs:
                return {py23_compat.text_type(name): vrfs[name]}
            return {}
        else:
            return vrfs
861663
async def get_instances(self, **kwargs) -> List[ApiResource]:
        """"""
        raw_resources = await self.get_resources(**kwargs)
        _instances = [
            self._resource_factory(_raw)
            for _raw in self._loop_raw(raw_resources)
        ]
        return _instances
574831
def get_events(self) -> List[Event]:
        
        LOG.debug('Getting events for %s', self.key)
        return get_events(self.key)
220046
def show_instance(name, call=None):
    '''
    
    '''
    response = _query('grid', 'server/get', args={'name': name})
    ret = {}
    for item in response['list']:
        name = item['name']
        ret[name] = item

        ret[name]['image_info'] = item['image']
        ret[name]['image'] = item['image']['friendlyName']
        ret[name]['size'] = item['ram']['name']
        ret[name]['public_ips'] = [item['ip']['ip']]
        ret[name]['private_ips'] = []
        ret[name]['state_info'] = item['state']
        if 'active' in item['state']['description']:
            ret[name]['state'] = 'RUNNING'
    return ret
1012043
def events_clients(self):
        
        # TODO Add paging to this
        response = self._get(url.events_clients)
        self._check_response(response, 200)
        return self._create_response(response).get("events")
309488
def get_network_instances(self, name=""):
        

        # command 'show vrf detail' returns all VRFs with detailed information
        # format: list of dictionaries with keys such as 'vrf_name' and 'rd'
        command = "show vrf detail"
        vrf_table_raw = self._get_command_table(command, "TABLE_vrf", "ROW_vrf")

        # command 'show vrf interface' returns all interfaces including their assigned VRF
        # format: list of dictionaries with keys 'if_name', 'vrf_name', 'vrf_id' and 'soo'
        command = "show vrf interface"
        intf_table_raw = self._get_command_table(command, "TABLE_if", "ROW_if")

        # create a dictionary with key = 'vrf_name' and value = list of interfaces
        vrf_intfs = defaultdict(list)
        for intf in intf_table_raw:
            vrf_intfs[intf["vrf_name"]].append(py23_compat.text_type(intf["if_name"]))

        vrfs = {}
        for vrf in vrf_table_raw:
            vrf_name = py23_compat.text_type(vrf.get("vrf_name"))
            vrfs[vrf_name] = {}
            vrfs[vrf_name]["name"] = vrf_name

            # differentiate between VRF type 'DEFAULT_INSTANCE' and 'L3VRF'
            if vrf_name == "default":
                vrfs[vrf_name]["type"] = "DEFAULT_INSTANCE"
            else:
                vrfs[vrf_name]["type"] = "L3VRF"

            vrfs[vrf_name]["state"] = {
                "route_distinguisher": py23_compat.text_type(vrf.get("rd"))
            }

            # convert list of interfaces (vrf_intfs[vrf_name]) to expected format
            # format = dict with key = interface name and empty values
            vrfs[vrf_name]["interfaces"] = {}
            vrfs[vrf_name]["interfaces"]["interface"] = dict.fromkeys(
                vrf_intfs[vrf_name], {}
            )

        # if name of a specific VRF was passed as an argument
        # only return results for this particular VRF
        if name:
            if name in vrfs.keys():
                return {py23_compat.text_type(name): vrfs[name]}
            else:
                return {}
        # else return results for all VRFs
        else:
            return vrfs
406424
def get_events(maximum=10):
    
    events = []
    for ev in range(0, maximum):
        try:
            if CONTROLLER.queue.empty():
                break
            else:
                events.append(CONTROLLER.queue.get_nowait())
        except NameError:
            print('PyMLGame is not initialized correctly. Use pymlgame.init() first.')
            events = False
            break
    return events
464982
public void listInstances() {
    System.out.println("\nListing Instances");
    // [START bigtable_list_instances]
    try {
      List<Instance> instances = adminClient.listInstances();
      for (Instance instance : instances) {
        System.out.println(instance.getId());
      }
    } catch (PartialListInstancesException e) {
      System.err.println("Failed to list instances: " + e.getMessage());
      System.err.println("The following zones are unavailable: " + e.getUnavailableZones());
      System.err.println("But the following instances are reachable: " + e.getInstances());
    }
    // [END bigtable_list_instances]
  }
564289
def get_instance(self, payload):
        
        return SyncListInstance(self._version, payload, service_sid=self._solution['service_sid'], )