Returns the service instances activated in this space.
496890
def _get_instances(self, page_number=None):
        
        instances = []
        uri = '/v2/spaces/%s/service_instances' % self.guid
        json_response = self.api.get(uri)
        instances += json_response['resources']
        while json_response['next_url'] is not None:
            json_response = self.api.get(json_response['next_url'])
            instances += json_response['resources']

        return instances
454284
def get_services(self):
        
        self.__load_System_class()
        pid = self.get_pid()
        return [d for d in System.get_active_services() if d.ProcessId == pid]
285009
def get_occupied_slots(instance):
    
    return [slot for slot in get_all_slots(type(instance))
            if hasattr(instance,slot)]
1231086
@GetMapping(path = "/instances", produces = MediaType.APPLICATION_JSON_VALUE)
    public Flux<Instance> instances() {
        LOGGER.debug("Deliver all registered instances");
        return registry.getInstances().filter(Instance::isRegistered);
    }
276706
def get_enabled():
    '''
    
    '''
    raw_services = _get_services()
    services = set()
    for service in raw_services:
        if info(service['ServiceName'])['StartType'] in ['Auto']:
            services.add(service['ServiceName'])

    return sorted(services)
238631
def get_all():
    '''
    
    '''
    cmd = 'launchctl list'

    service_lines = [
        line for line in __salt__['cmd.run'](cmd).splitlines()
        if not line.startswith('PID')
    ]

    service_labels_from_list = [
        line.split("\t")[2] for line in service_lines
    ]
    service_labels_from_services = list(_available_services().keys())

    return sorted(set(service_labels_from_list + service_labels_from_services))
341803
def get_instances(device_owners=None, vnic_type=None, instance_id=None):
    """"""
    session = db.get_reader_session()
    with session.begin():
        port_model = models_v2.Port
        binding_model = ml2_models.PortBinding
        instances = (session
                     .query(port_model,
                            binding_model)
                     .outerjoin(
                         binding_model,
                         port_model.id == binding_model.port_id)
                     .distinct(port_model.device_id)
                     .group_by(port_model.device_id)
                     .filter_unnecessary_ports(device_owners, vnic_type))
        if instance_id:
            instances = instances.filter(port_model.device_id == instance_id)
    return instances.all()
438275
def get_instance_guid(self, service_name):
        
        summary = self.space.get_space_summary()
        for service in summary['services']:
            if service['name'] == service_name:
                return service['guid']

        raise ValueError("No service with name '%s' found." % (service_name))
880692
public function getServiceInstances()
    {
        $instances = [];

        foreach ($this->getServices() as $name => $info) {
            if (!isset($info['type'])) {
                continue;
            }
            $type = $info['type'];
            unset($info['type']);

            $instances[$name] = [
                'type' => $type,
                'options' => $info,
                'instance' => static::loadService($this, $type, $name),
            ];
        }

        return $instances;
    }
890119
public List<Instance> listInstances() {
    // [START instance_admin_client_list_instances]
    List<Instance> instances =
        Lists.newArrayList(instanceAdminClient.listInstances(Options.pageSize(1)).iterateAll());
    // [END instance_admin_client_list_instances]
    return instances;
  }
603487
def show_instance(name, call=None):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The show_instance action must be called with -a or --action.'
        )

    nodes = list_nodes_full()
    # Find under which cloud service the name is listed, if any
    if name not in nodes:
        return {}
    __utils__['cloud.cache_node'](nodes[name], __active_provider_name__, __opts__)
    return nodes[name]
152491
def get_instances(self):
        # type: () -> List[Tuple[str, str, int]]
        
        with self.__instances_lock:
            return sorted(
                (name, stored_instance.factory_name, stored_instance.state)
                for name, stored_instance in self.__instances.items()
            )
807168
def find_usage(self):
        
        logger.debug("Checking usage for service %s", self.service_name)
        self.connect()
        self.connect_resource()
        for lim in self.limits.values():
            lim._reset_usage()
        self._find_usage_instances()
        self._find_usage_networking_sgs()
        self._find_usage_networking_eips()
        self._find_usage_networking_eni_sg()
        self._find_usage_spot_instances()
        self._find_usage_spot_fleets()
        self._have_usage = True
        logger.debug("Done checking usage.")
283547
public List<ModelServiceInstance> getAllInstances(){
        HttpResponse result = invoker.invoke("/service" , null, HttpMethod.GET);

        if (result.getHttpCode() != HTTP_OK) {
           throw new ServiceException(ErrorCode.REMOTE_DIRECTORY_SERVER_ERROR,
                    "HTTP Code is not OK, code=%s", result.getHttpCode());
        }

        List<ModelServiceInstance> allInstances = _deserialize(result.getRetBody(), new TypeReference<List<ModelServiceInstance>>(){});
        return allInstances;
    }
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
1170254
def service_action(self, service, action):
        ""
        try:
            service = api.get_cluster(self.cluster).get_service(service)
        except ApiException:
            print("Service not found")
            return None

        if action == "start":
            service.start()
        if action == "restart":
            service.restart()
        if action == "stop":
            service.stop()

        return True
364025
public List<String> getRunningServiceIds() {
        List<ServiceReference<Domain>> serviceReferences = osgiUtilsService.listServiceReferences(Domain.class);
        List<String> result = new ArrayList<String>();
        for (ServiceReference<Domain> ref : serviceReferences) {
            result.add((String) ref.getProperty(org.osgi.framework.Constants.SERVICE_PID));
        }
        return result;
    }