List all available services.

        :param namespace: str, if not specified list services for all namespaces
        :return: collection of instances of :class:`conu.backend.k8s.service.Service`
4081
def list_services(self, namespace=None):
        

        if namespace:
            return [Service(name=s.metadata.name,
                            ports=k8s_ports_to_metadata_ports(s.spec.ports),
                            namespace=s.metadata.namespace,
                            labels=s.metadata.labels, selector=s.spec.selector, spec=s.spec)
                    for s in self.core_api.list_namespaced_service(namespace, watch=False).items]

        return [Service(name=s.metadata.name,
                        ports=k8s_ports_to_metadata_ports(s.spec.ports),
                        namespace=s.metadata.namespace,
                        labels=s.metadata.labels, selector=s.spec.selector, spec=s.spec)
                for s in self.core_api.list_service_for_all_namespaces(watch=False).items]
1369665
public static List<String> getServices() throws ApiException {
    V1ServiceList listNamespacedService =
        COREV1_API.listNamespacedService(
            DEFAULT_NAME_SPACE,
            null,
            null,
            null,
            null,
            null,
            Integer.MAX_VALUE,
            null,
            TIME_OUT_VALUE,
            Boolean.FALSE);
    return listNamespacedService
        .getItems()
        .stream()
        .map(v1service -> v1service.getMetadata().getName())
        .collect(Collectors.toList());
  }
733422
def services(self):
        
        self._services = []
        params = {"f": "json"}
        if not self._url.endswith('/services'):
            uURL = self._url + "/services"
        else:
            uURL = self._url
        res = self._get(url=uURL, param_dict=params,
                           securityHandler=self._securityHandler,
                           proxy_port=self._proxy_port,
                           proxy_url=self._proxy_url)
        for k, v in res.items():
            if k == "foldersDetail":
                for item in v:
                    if 'isDefault' in item and item['isDefault'] == False:
                        fURL = self._url + "/services/" + item['folderName']
                        resFolder = self._get(url=fURL, param_dict=params,
                                                 securityHandler=self._securityHandler,
                                                 proxy_port=self._proxy_port,
                                                 proxy_url=self._proxy_url)
                        for k1, v1 in resFolder.items():
                            if k1 == "services":
                                self._checkservice(k1,v1,fURL)
            elif k == "services":
                self._checkservice(k,v,uURL)
        return self._services
293545
def rpc_get_all_namespaces( self, **con_info ):
        
        db = get_db_state(self.working_dir)
        all_namespaces = db.get_all_namespace_ids()
        db.close()

        return self.success_response( {'namespaces': all_namespaces} )
184978
def list_entity_types(namespace, workspace):
    
    headers = _fiss_agent_header({"Content-type":  "application/json"})
    uri = "workspaces/{0}/{1}/entities".format(namespace, workspace)
    return __get(uri, headers=headers)
355578
def list_licenses(service_instance=None):
    '''
    
    '''
    log.trace('Retrieving all licenses')
    licenses = salt.utils.vmware.get_licenses(service_instance)
    ret_dict = [{'key': l.licenseKey,
                 'name': l.name,
                 'description': l.labels[0].value if l.labels else None,
                 # VMware handles unlimited capacity as 0
                 'capacity': l.total if l.total > 0 else sys.maxsize,
                 'used': l.used if l.used else 0}
                 for l in licenses]
    return ret_dict
1288483
def services(self):
        
        self._services = []
        params = {
                    "f" : "json"
                }
        json_dict = self._get(url=self._currentURL,
                                 param_dict=params,
                                 securityHandler=self._securityHandler,
                                 proxy_url=self._proxy_url,
                                 proxy_port=self._proxy_port)
        if "services" in json_dict.keys():
            for s in json_dict['services']:
                uURL = self._currentURL + "/%s.%s" % (s['serviceName'], s['type'])
                self._services.append(
                    AGSService(url=uURL,
                               securityHandler=self._securityHandler,
                               proxy_url=self._proxy_url,
                               proxy_port=self._proxy_port)
                )
        return self._services
579416
def get_all_services(self, view = None):
    
    return services.get_all_services(self._get_resource_root(), self.name, view)
140881
def services(self, *args, **kwargs):
        
        return self._client.services(*args, scope=self.id, **kwargs)
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());
        }
    }
1005089
def _sysv_services():
    '''
    
    '''
    _services = []
    output = __salt__['cmd.run'](['chkconfig', '--list'], python_shell=False)
    for line in output.splitlines():
        comps = line.split()
        try:
            if comps[1].startswith('0:'):
                _services.append(comps[0])
        except IndexError:
            continue
    # Return only the services that have an initscript present
    return [x for x in _services if _service_is_sysv(x)]
86181
def list_services(self):
        
        services = list(self.services.keys())
        services.sort()
        return services
200388
def show_namespace(name, **kwargs):
    '''
    
    '''
    cfg = _setup_conn(**kwargs)
    try:
        api_instance = kubernetes.client.CoreV1Api()
        api_response = api_instance.read_namespace(name)

        return api_response.to_dict()
    except (ApiException, HTTPError) as exc:
        if isinstance(exc, ApiException) and exc.status == 404:
            return None
        else:
            log.exception(
                'Exception when calling '
                'CoreV1Api->read_namespace'
            )
            raise CommandExecutionError(exc)
    finally:
        _cleanup(**cfg)
939145
def list_storage_services(conn=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            ('The list_storage_services function must be called '
             'with -f or --function.')
        )

    if not conn:
        conn = get_conn()

    ret = {}
    accounts = conn.list_storage_accounts()
    for service in accounts.storage_services:
        ret[service.service_name] = {
            'capabilities': service.capabilities,
            'service_name': service.service_name,
            'storage_service_properties': service.storage_service_properties,
            'extended_properties': service.extended_properties,
            'storage_service_keys': service.storage_service_keys,
            'url': service.url,
        }
    return ret
204315
def namedb_get_all_namespace_ids( cur ):
    

    query = "SELECT namespace_id FROM namespaces WHERE op = ?;"
    args = (NAMESPACE_READY,)

    namespace_rows = namedb_query_execute( cur, query, args )
    ret = []
    for namespace_row in namespace_rows:
        ret.append( namespace_row['namespace_id'] )

    return ret
535267
def service_list():
    '''
    
    '''
    r = salt.utils.http.query(DETAILS['url']+'service/list', decode_type='json', decode=True)
    return r['dict']
1344021
def get_all_services(resource_root, cluster_name="default", view=None):
  
  return call(resource_root.get,
      SERVICES_PATH % (cluster_name,),
      ApiService, True, params=view and dict(view=view) or None)