List all the CloudFormation stacks in the given region.
166097
def list(region, profile):
    
    ini_data = {}
    environment = {}

    if region:
        environment['region'] = region
    else:
        environment['region'] = find_myself()

    if profile:
        environment['profile'] = profile

    ini_data['environment'] = environment
    if start_list(ini_data):
        sys.exit(0)
    else:
        sys.exit(1)
616313
def list_elasticache(region, filter_by_kwargs):
    """"""
    conn = boto.elasticache.connect_to_region(region)
    req = conn.describe_cache_clusters()
    data = req["DescribeCacheClustersResponse"]["DescribeCacheClustersResult"]["CacheClusters"]
    if filter_by_kwargs:
        clusters = [x['CacheClusterId'] for x in data if x[filter_by_kwargs.keys()[0]] == filter_by_kwargs.values()[0]]
    else:
        clusters = [x['CacheClusterId'] for x in data]
    return clusters
418923
public List<NodeRecord> loadNodesFromRegion (String region)
    {
        return from(NodeRecord.class)
            .noCache()
            .where(NodeRecord.REGION.eq(region), Ops.not(NodeRecord.SHUTDOWN))
            .select();
    }
944241
def list_nodes_full(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The list_nodes_full function must be called with -f or --function.'
        )

    netapi_versions = get_api_versions(kwargs={
        'resource_provider': 'Microsoft.Network',
        'resource_type': 'networkInterfaces'
        }
    )
    netapi_version = netapi_versions[0]
    compconn = get_conn(client_type='compute')

    ret = {}

    def _get_node_info(node):
        '''
        Get node info.
        '''
        node_ret = {}
        node['id'] = node['vm_id']
        node['size'] = node['hardware_profile']['vm_size']
        node['state'] = node['provisioning_state']
        node['public_ips'] = []
        node['private_ips'] = []
        node_ret[node['name']] = node
        try:
            image_ref = node['storage_profile']['image_reference']
            node['image'] = '|'.join([
                image_ref['publisher'],
                image_ref['offer'],
                image_ref['sku'],
                image_ref['version'],
            ])
        except (TypeError, KeyError):
            try:
                node['image'] = node['storage_profile']['os_disk']['image']['uri']
            except (TypeError, KeyError):
                node['image'] = node.get('storage_profile', {}).get('image_reference', {}).get('id')
        try:
            netifaces = node['network_profile']['network_interfaces']
            for index, netiface in enumerate(netifaces):
                netiface_name = get_resource_by_id(
                    netiface['id'],
                    netapi_version,
                    'name'
                )
                netiface, pubips, privips = _get_network_interface(
                    netiface_name,
                    node['resource_group']
                )
                node['network_profile']['network_interfaces'][index].update(netiface)
                node['public_ips'].extend(pubips)
                node['private_ips'].extend(privips)
        except Exception:
            pass

        node_ret[node['name']] = node

        return node_ret

    for group in list_resource_groups():
        nodes = []
        nodes_query = compconn.virtual_machines.list(
            resource_group_name=group
        )
        for node_obj in nodes_query:
            node = node_obj.as_dict()
            node['resource_group'] = group
            nodes.append(node)

        pool = ThreadPool(cpu_count() * 6)
        results = pool.map_async(_get_node_info, nodes)
        results.wait()

        group_ret = {k: v for result in results.get() for k, v in six.iteritems(result)}
        ret.update(group_ret)

    return ret
231252
def regions():
    
    regions = []
    for region_name in RegionData:
        region = RegionInfo(name=region_name,
                            endpoint=RegionData[region_name],
                            connection_cls=CloudWatchConnection)
        regions.append(region)
    return regions
1018954
def list_datastores(kwargs=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_datastores function must be called with '
            '-f or --function.'
        )

    return {'Datastores': salt.utils.vmware.list_datastores(_get_si())}
353303
def list_datacenters(kwargs=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_datacenters function must be called with '
            '-f or --function.'
        )

    return {'Datacenters': salt.utils.vmware.list_datacenters(_get_si())}
1184398
def list_groups(region=None, key=None, keyid=None, profile=None):
    '''
    

    '''
    return [a.name for a in get_all_groups(region=region, key=key, keyid=keyid, profile=profile)]
449022
def list_clusters(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The list_clusters function must be called with -f or --function.'
        )

    server, user, password = _get_xml_rpc()
    auth = ':'.join([user, password])
    cluster_pool = server.one.clusterpool.info(auth)[1]

    clusters = {}
    for cluster in _get_xml(cluster_pool):
        clusters[cluster.find('NAME').text] = _xml_to_dict(cluster)

    return clusters
375256
def do_stack(self,args):
        """"""
        parser = CommandArgumentParser("stack")
        parser.add_argument(dest='stack',help='stack index or name');
        args = vars(parser.parse_args(args))

        print "loading stack {}".format(args['stack'])
        try:
            index = int(args['stack'])            
            stackSummary = self.wrappedStack['resourcesByTypeIndex']['AWS::CloudFormation::Stack'][index]
        except ValueError:
            stackSummary = self.wrappedStack['resourcesByTypeName']['AWS::CloudFormation::Stack'][args['stack']]

        self.stackResource(stackSummary.stack_name,stackSummary.logical_id)
123257
def list_regions(self):
        

        url = '{0}/v3/regions'.format(self.host)
        return http._get_with_qiniu_mac(url, None, self.auth)
1315377
def list_resource_groups(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The list_hosted_services function must be called with '
            '-f or --function'
        )

    resconn = get_conn(client_type='resource')
    ret = {}
    try:
        groups = resconn.resource_groups.list()

        for group_obj in groups:
            group = group_obj.as_dict()
            ret[group['name']] = group
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('resource', exc.message)
        ret = {'Error': exc.message}

    return ret
961050
def Regions(self,
              skip_mapped_files=False,
              skip_shared_regions=False,
              skip_executable_regions=False,
              skip_readonly_regions=False):
    """"""
    try:
      maps_file = open("/proc/" + str(self.pid) + "/maps", "r")
    except OSError as e:
      raise process_error.ProcessError(e)

    with maps_file:
      for line in maps_file:
        m = self.maps_re.match(line)
        if not m:
          continue
        start = int(m.group(1), 16)
        end = int(m.group(2), 16)
        region_protec = m.group(3)
        inode = int(m.group(6))

        if "r" in region_protec:
          if skip_mapped_files and inode != 0:
            continue
          if skip_shared_regions and "s" in region_protec:
            continue
          if skip_executable_regions and "x" in region_protec:
            continue
          if skip_readonly_regions and "w" not in region_protec:
            continue
          yield start, end - start
1132741
def list_nodes_min(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The list_nodes_min function must be called with -f or --function.'
        )

    ret = {}
    location = get_location()
    params = {
        'Action': 'DescribeInstanceStatus',
        'RegionId': location,
    }
    nodes = query(params)

    log.debug(
        'Total %s instance found in Region %s',
        nodes['TotalCount'], location
    )
    if 'Code' in nodes or nodes['TotalCount'] == 0:
        return ret

    for node in nodes['InstanceStatuses']['InstanceStatus']:
        ret[node['InstanceId']] = {}
        for item in node:
            ret[node['InstanceId']][item] = node[item]

    return ret
1111786
def list_rds(region, filter_by_kwargs):
    """"""
    conn = boto.rds.connect_to_region(region)
    instances = conn.get_all_dbinstances()
    return lookup(instances, filter_by=filter_by_kwargs)
796311
public java.util.List<Stack> getStacks() {
        if (stacks == null) {
            stacks = new com.amazonaws.internal.SdkInternalList<Stack>();
        }
        return stacks;
    }
49319
public final List<AbstractTraceRegion> getNestedRegions() {
		if (nestedRegions == null)
			return Collections.emptyList();
		return Collections.unmodifiableList(nestedRegions);
	}