list application containers and their status
516510
function byType(appName, type, callback) {
    var url = format('/%s/apps/%s/containers/%s/', deis.version, appName, type);
    commons.get(url, callback);
  }
732608
def checks_list():
    '''
    
    '''
    application_url = _get_application_url()
    log.debug('[uptime] get checks')
    jcontent = requests.get('{0}/api/checks'.format(application_url)).json()
    return [x['url'] for x in jcontent]
610549
def _get_container_state(self):
        
        try:
            result = yield from self.manager.query("GET", "containers/{}/json".format(self._cid))
        except DockerError:
            return "exited"

        if result["State"]["Paused"]:
            return "paused"
        if result["State"]["Running"]:
            return "running"
        return "exited"
55140
def is_running(config, container, *args, **kwargs):
    '''
    
    '''
    try:
        infos = _get_container_infos(config, container)
        return (infos if infos.get('State', {}).get('Running') else None)
    except Exception:
        return None
1229520
def list_app_resources(
        app, env, resources, cmdb, start, end, tz):
    """"""
    logging.basicConfig(level=logging.INFO)
    start, end = get_dates(start, end, tz)

    all_resources = []
    for rtype_name in resources:
        rtype = Resource.get_type(rtype_name)
        resources = rtype.get_resources(cmdb, start, end, app, env)
        all_resources.extend(resources)
    print(json.dumps(all_resources, indent=2))
429566
def volume_list(self, search_opts=None):
        '''
        
        '''
        if self.volume_conn is None:
            raise SaltCloudSystemExit('No cinder endpoint available')
        nt_ks = self.volume_conn
        volumes = nt_ks.volumes.list(search_opts=search_opts)
        response = {}
        for volume in volumes:
            response[volume.display_name] = {
                'name': volume.display_name,
                'size': volume.size,
                'id': volume.id,
                'description': volume.display_description,
                'attachments': volume.attachments,
                'status': volume.status
            }
        return response
1045045
def list(self, device_path, timeout_ms=None):
    """"""
    return self.filesync_service.list(
        device_path, timeouts.PolledTimeout.from_millis(timeout_ms))
849471
def tile_status(self):
        """"""
        stat = self.status()

        flags = stat['status']

        # FIXME: This needs to stay in sync with lib_common: cdb_status.h
        status = {}
        status['debug_mode'] = bool(flags & (1 << 3))
        status['configured'] = bool(flags & (1 << 1))
        status['app_running'] = bool(flags & (1 << 0))
        status['trapped'] = bool(flags & (1 << 2))

        return status
951593
public function containersActive() {
    $ps = $this->taskDockerComposePs()
      ->file($this->dockerComposeFile)
      ->projectName($this->config->get('name'))
      ->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_DEBUG)
      ->printOutput(FALSE)
      ->run()
      ->getMessage();
    $this->say("$ps");
  }
839954
def _get_containers(self):
        """"""

        def full_fn(path):
            return os.path.join(self.abs_root, path)
        return [self.cont_cls.from_path(self, d)
                for d in os.listdir(self.abs_root) if is_dir(full_fn(d))]
1242708
def list(self):
    
    import IPython

    # "self" is iterable (see __iter__() method).
    data = [{'name': version['name'].split()[-1],
             'deploymentUri': version['deploymentUri'], 'createTime': version['createTime']}
            for version in self.get_iterator()]
    IPython.display.display(
        datalab.utils.commands.render_dictionary(data, ['name', 'deploymentUri', 'createTime']))
1064627
def containers_running(get_container_name):
    
    running = []
    for n in ['web', 'postgres', 'solr', 'datapusher', 'redis']:
        info = docker.inspect_container(get_container_name(n))
        if info and not info['State']['Running']:
            running.append(n + '(halted)')
        elif info:
            running.append(n)
    return running
229366
def _get_file_list(load):
    '''
    
    '''
    if 'env' in load:
        # "env" is not supported; Use "saltenv".
        load.pop('env')

    if 'saltenv' not in load or load['saltenv'] not in envs():
        return []
    ret = set()
    for repo in init():
        repo['repo'].open()
        ref = _get_ref(repo, load['saltenv'])
        if ref:
            manifest = repo['repo'].manifest(rev=ref[1])
            for tup in manifest:
                relpath = os.path.relpath(tup[4], repo['root'])
                # Don't add files outside the hgfs_root
                if not relpath.startswith('../'):
                    ret.add(os.path.join(repo['mountpoint'], relpath))
        repo['repo'].close()
    return sorted(ret)
127679
def get_list_of_applications():
    
    apps = mod_prg.Programs('Applications', 'C:\\apps')
    fl = mod_fl.FileList(['C:\\apps'], ['*.exe'], ["\\bk\\"])
    for f in fl.get_list():
        apps.add(f, 'autogenerated list')
    apps.list()
    apps.save()
1279787
def _list_iter(host=None, path=None):
    '''
    
    '''
    tgt = host or '*'
    client = salt.client.get_local_client(__opts__['conf_file'])
    for container_info in client.cmd_iter(
        tgt, 'lxc.list', kwarg={'path': path}
    ):
        if not container_info:
            continue
        if not isinstance(container_info, dict):
            continue
        chunk = {}
        id_ = next(six.iterkeys(container_info))
        if host and host != id_:
            continue
        if not isinstance(container_info[id_], dict):
            continue
        if 'ret' not in container_info[id_]:
            continue
        if not isinstance(container_info[id_]['ret'], dict):
            continue
        chunk[id_] = container_info[id_]['ret']
        yield chunk
743430
def container_present(name, profile):
    '''
    
    '''
    containers = __salt__['libcloud_storage.list_containers'](profile)
    match = [z for z in containers if z['name'] == name]
    if match:
        return state_result(True, "Container already exists", name, {})
    else:
        result = __salt__['libcloud_storage.create_container'](name, profile)
        return state_result(True, "Created new container", name, result)
196598
def containers(self):
        
        return [
            self.client.containers.get(cid) for cid in
            (self.attrs.get('Containers') or {}).keys()
        ]