.. versionadded:: 2019.2.0

    List all deployments within a resource group.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.deployments_list testgroup
767571
def deployments_list(resource_group, **kwargs):
    '''
    

    '''
    result = {}
    resconn = __utils__['azurearm.get_client']('resource', **kwargs)
    try:
        deployments = __utils__['azurearm.paged_object_to_list'](
            resconn.deployments.list_by_resource_group(
                resource_group_name=resource_group
            )
        )

        for deploy in deployments:
            result[deploy['name']] = deploy
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('resource', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result
305268
def tenants_list(**kwargs):
    '''
    

    '''
    result = {}
    subconn = __utils__['azurearm.get_client']('subscription', **kwargs)
    try:
        tenants = __utils__['azurearm.paged_object_to_list'](subconn.tenants.list())

        for tenant in tenants:
            result[tenant['tenant_id']] = tenant
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('resource', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result
236205
def list_queues(runas=None, *args):
    '''
    
    '''
    if runas is None and not salt.utils.platform.is_windows():
        runas = salt.utils.user.get_user()
    cmd = [RABBITMQCTL, 'list_queues', '-q']
    cmd.extend(args)
    res = __salt__['cmd.run_all'](cmd, reset_system_locale=False, runas=runas, python_shell=False)
    _check_response(res)
    return _output_to_dict(res['stdout'])
689883
public List<IstioResource> deployIstioResources(final Path directory) throws IOException {

        final List<IstioResource> istioResources = new ArrayList<>();

        if (Files.isDirectory(directory)) {
            Files.list(directory)
                .filter(ResourceFilter::filterKubernetesResource)
                .map(p -> {
                    try {
                        return Files.newInputStream(p);
                    } catch (IOException e) {
                        throw new IllegalArgumentException(e);
                    }
                })
                .forEach(is -> {
                    try {
                        istioResources.addAll(deployIstioResources(is));
                        is.close();
                    } catch (IOException e) {
                        throw new IllegalArgumentException(e);
                    }
                });
        } else {
            throw new IllegalArgumentException(String.format("%s should be a directory", directory));
        }

        return istioResources;
    }
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']))
1125265
def list(host=None, quiet=False, hyper=None):  # pylint: disable=redefined-builtin
    '''
    
    '''
    if quiet:
        log.warning("'quiet' is deprecated. Please migrate to --quiet")
    ret = {}
    client = salt.client.get_local_client(__opts__['conf_file'])
    for info in client.cmd_iter('virtual:physical',
                                'virt.vm_info', tgt_type='grain'):
        if not info:
            continue
        if not isinstance(info, dict):
            continue
        chunk = {}
        id_ = next(six.iterkeys(info))
        if host:
            if host != id_:
                continue
        if not isinstance(info[id_], dict):
            continue
        if 'ret' not in info[id_]:
            continue
        if not isinstance(info[id_]['ret'], dict):
            continue
        data = {}
        for key, val in six.iteritems(info[id_]['ret']):
            if val['state'] in data:
                data[val['state']].append(key)
            else:
                data[val['state']] = [key]
        chunk[id_] = data
        ret.update(chunk)
        if not quiet:
            __jid_event__.fire_event({'data': chunk, 'outputter': 'nested'}, 'progress')

    return ret
331113
def list_security_groups(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The list_security_groups function must be called with -f or --function.'
        )

    server, user, password = _get_xml_rpc()
    auth = ':'.join([user, password])
    secgroup_pool = server.one.secgrouppool.info(auth, -2, -1, -1)[1]

    groups = {}
    for group in _get_xml(secgroup_pool):
        groups[group.find('NAME').text] = _xml_to_dict(group)

    return groups
1152800
def envs():
    '''
    
    '''
    saltenvs = []
    for container in __opts__.get('azurefs', []):
        saltenvs.append(container.get('saltenv', 'base'))
    # Remove duplicates
    return list(set(saltenvs))
294057
def network_interfaces_list_all(**kwargs):
    '''
    

    '''
    result = {}
    netconn = __utils__['azurearm.get_client']('network', **kwargs)
    try:
        nics = __utils__['azurearm.paged_object_to_list'](netconn.network_interfaces.list_all())

        for nic in nics:
            result[nic['name']] = nic
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('network', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result
309921
public static Set<String> listDeployments(Resource deploymentRootResource, Set<String> runtimeNames) {
          Set<Pattern> set = new HashSet<>();
          for (String wildcardExpr : runtimeNames) {
              Pattern pattern = DeploymentOverlayIndex.getPattern(wildcardExpr);
              set.add(pattern);
          }
          return listDeploymentNames(deploymentRootResource, set);
      }
593932
@Override
    public Collection<ScalingGroup> listScalingGroups( AutoScalingGroupFilterOptions options ) throws CloudException, InternalException {
        APITrace.begin(getProvider(), "AutoScaling.listScalingGroups");
        try {
            ProviderContext ctx = getProvider().getContext();

            if( ctx == null ) {
                throw new CloudException("No context has been set for this request");
            }
            ArrayList<ScalingGroup> list = new ArrayList<ScalingGroup>();

            Map<String, String> parameters = getAutoScalingParameters(getProvider().getContext(), EC2Method.DESCRIBE_AUTO_SCALING_GROUPS);
            EC2Method method;
            NodeList blocks;
            Document doc;

            method = new EC2Method(SERVICE_ID, getProvider(), parameters);
            try {
                doc = method.invoke();
            }
            catch( EC2Exception e ) {
                logger.error(e.getSummary());
                throw new CloudException(e);
            }
            blocks = doc.getElementsByTagName("AutoScalingGroups");
            for( int i = 0; i < blocks.getLength(); i++ ) {
                NodeList items = blocks.item(i).getChildNodes();

                for( int j = 0; j < items.getLength(); j++ ) {
                    Node item = items.item(j);

                    if( item.getNodeName().equals("member") ) {
                        ScalingGroup group = toScalingGroup(ctx, item);

                        if( ( group != null && ( options != null && !options.hasCriteria() ) ) || ( group != null && ( options != null && options.hasCriteria() && options.matches(group) ) ) ) {
                            list.add(group);
                        }
                    }
                }
            }
            return list;
        }
        finally {
            APITrace.end();
        }
    }
746801
def list_upgrades(jid,
                  style='group',
                  outputter='nested',
                  ext_source=None):
    '''
    
    '''
    mminion = salt.minion.MasterMinion(__opts__)
    returner = _get_returner((
        __opts__['ext_job_cache'],
        ext_source,
        __opts__['master_job_cache']
    ))

    data = mminion.returners['{0}.get_jid'.format(returner)](jid)
    pkgs = {}

    if style == 'group':
        for minion in data:
            results = data[minion]['return']
            for pkg, pkgver in six.iteritems(results):
                if pkg not in six.iterkeys(pkgs):
                    pkgs[pkg] = {pkgver: {'hosts': []}}

                if pkgver not in six.iterkeys(pkgs[pkg]):
                    pkgs[pkg].update({pkgver: {'hosts': []}})

                pkgs[pkg][pkgver]['hosts'].append(minion)

    if outputter:
        salt.output.display_output(pkgs, outputter, opts=__opts__)

    return pkgs
1299889
def file_list(load):
    '''
    
    '''
    ret = set()
    try:
        for container in __opts__['azurefs']:
            if container.get('saltenv', 'base') != load['saltenv']:
                continue
            container_list = _get_container_path(container) + '.list'
            lk = container_list + '.lk'
            salt.fileserver.wait_lock(lk, container_list, 5)
            if not os.path.exists(container_list):
                continue
            with salt.utils.files.fopen(container_list, 'r') as fp_:
                ret.update(set(salt.utils.json.load(fp_)))
    except Exception as exc:
        log.error('azurefs: an error ocurred retrieving file lists. '
                  'It should be resolved next time the fileserver '
                  'updates. Please do not manually modify the azurefs '
                  'cache directory.')
    return list(ret)
781504
def get_all_role_config_groups(resource_root, service_name,
    cluster_name="default"):
  
  return call(resource_root.get,
      _get_role_config_groups_path(cluster_name, service_name),
      ApiRoleConfigGroup, True, api_version=3)
410166
def resource_groups_list(**kwargs):
    '''
    

    '''
    result = {}
    resconn = __utils__['azurearm.get_client']('resource', **kwargs)
    try:
        groups = __utils__['azurearm.paged_object_to_list'](resconn.resource_groups.list())

        for group in groups:
            result[group['name']] = group
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('resource', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result
627584
def list_affinity_groups(kwargs=None, conn=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_affinity_groups function must be called with -f or --function.'
        )

    if not conn:
        conn = get_conn()

    data = conn.list_affinity_groups()
    ret = {}
    for item in data.affinity_groups:
        ret[item.name] = object_to_dict(item)
    return ret
524169
def update_hostgroup_list
      old_deployment_role_hostgroups = deployment_role_hostgroups.to_a
      new_deployment_role_hostgroups = layout.layout_roles.map do |layout_role|
        deployment_role_hostgroup = deployment_role_hostgroups.where(:role_id => layout_role.role).first_or_initialize do |drh|
          drh.hostgroup = Hostgroup.new(name: layout_role.role.name, parent: hostgroup)
        end

        deployment_role_hostgroup.hostgroup.add_puppetclasses_from_resource(layout_role.role)
        layout_role.role.services.each do |service|
          deployment_role_hostgroup.hostgroup.add_puppetclasses_from_resource(service)
        end
        # deployment_role_hostgroup.hostgroup.save!

        deployment_role_hostgroup.deploy_order = layout_role.deploy_order
        deployment_role_hostgroup.save!

        deployment_role_hostgroup
      end

      # delete any prior mappings that remain
      (old_deployment_role_hostgroups - new_deployment_role_hostgroups).each &:destroy
    end