List splunk searches (names only)

    CLI Example:
        splunk_search.list
553653
def list_(profile="splunk"):
    '''
    
    '''
    client = _get_splunk(profile)
    searches = [x['name'] for x in client.saved_searches]
    return searches
861000
def list(self, limit=None, marker=None):
        
        return self._manager.list(limit=limit, marker=marker)
829142
def _filter_names(names):
    
    names = [n for n in names
             if n not in EXCLUDE_NAMES]
    # This is needed when building a distro from a working
    # copy (likely a checkout) rather than a pristine export:
    for pattern in EXCLUDE_PATTERNS:
        names = [n for n in names
                 if (not fnmatch.fnmatch(n, pattern))
                 and (not n.endswith('.py'))]
    return names
62522
def volume_list(search_opts=None, profile=None, **kwargs):
    '''
    

    '''
    conn = _auth(profile, **kwargs)
    return conn.volume_list(search_opts=search_opts)
127323
def list(self, spec=None):
        

        if spec is None:
            spec = {}

        xmlrpc = XMLRPCConnection()
        try:
            pool_list = xmlrpc.connection.list_pool(
                {
                    'pool': spec,
                    'auth': AuthOptions().options
                })
        except xmlrpclib.Fault as xml_fault:
            raise _fault_to_exception(xml_fault)
        res = list()
        for pool in pool_list:
            p = Pool.from_dict(pool)
            res.append(p)

        return res
756338
def host_list(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'This function must be called with -f, --function argument.'
        )
    ret = {}
    session = _get_session()
    hosts = session.xenapi.host.get_all()
    for host in hosts:
        host_record = session.xenapi.host.get_record(host)
        ret[host_record['name_label']] = host_record
    return ret
942560
def show_list(timeout_in_sec, out=sys.stdout, host=jps.env.get_master_host(), sub_port=jps.DEFAULT_SUB_PORT):
    '''
    '''
    class TopicNameStore(object):

        def __init__(self):
            self._topic_names = set()

        def callback(self, msg, topic):
            self._topic_names.add(topic)

        def get_topic_names(self):
            names = list(self._topic_names)
            names.sort()
            return names

    store = TopicNameStore()
    sub = jps.Subscriber('*', store.callback, host=host, sub_port=sub_port)
    sleep_sec = 0.01
    for i in range(int(timeout_in_sec / sleep_sec)):
        sub.spin_once(sleep_sec)
        time.sleep(0.001)  # for context switch
    for name in store.get_topic_names():
        out.write('{}\n'.format(name))
644697
def list_nodes(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The list_nodes function must be called with -f or --function.'
        )

    ret = {}

    nodes = list_nodes_full()
    for node in nodes:
        ret[node] = {'name': node}
        for prop in ('id', 'image', 'size', 'state', 'private_ips', 'public_ips'):
            ret[node][prop] = nodes[node].get(prop)
    return ret
1108841
def search(cls, query, search_opts=None):
        

        if search_opts is None:
            search_opts = {}

        xmlrpc = XMLRPCConnection()
        try:
            search_result = xmlrpc.connection.search_pool(
                {
                    'query': query,
                    'search_options': search_opts,
                    'auth': AuthOptions().options
                })
        except xmlrpclib.Fault as xml_fault:
            raise _fault_to_exception(xml_fault)
        result = dict()
        result['result'] = []
        result['search_options'] = search_result['search_options']
        for pool in search_result['result']:
            p = Pool.from_dict(pool)
            result['result'].append(p)

        return result
811744
def search(self, regex=None, spec=None, **kwargs):
        """"""
        cmd_list = ['search', '--json']

        if regex and spec:
            raise TypeError('conda search: only one of regex or spec allowed')

        if regex:
            cmd_list.append(regex)

        if spec:
            cmd_list.extend(['--spec', spec])

        if 'platform' in kwargs:
            cmd_list.extend(['--platform', kwargs.pop('platform')])

        cmd_list.extend(
            self._setup_install_commands_from_kwargs(
                kwargs,
                ('canonical', 'unknown', 'use_index_cache', 'outdated',
                 'override_channels')))

        return self._call_and_parse(cmd_list,
                                    abspath=kwargs.get('abspath', True))
1365165
def list_container_object_names(self, container, limit=None, marker=None,
            prefix=None, delimiter=None, full_listing=False):
        
        return self._manager.list_object_names(container, marker=marker,
                limit=limit, prefix=prefix, delimiter=delimiter,
                full_listing=full_listing)
1355511
def saved_searches_factory_helper(splunk_connection_info):
    
    if not ISplunkConnectionInfo.providedBy(splunk_connection_info):
        DoesNotImplement('argument did not provide expected interface')
    service = connect(**splunk_connection_info)
    saved_searches = service.saved_searches
    for s in saved_searches:
        logger.debug("Found Splunk saved search with name %s" % s.name)
    return saved_searches
1164591
def splunk_monitor(monitors):
    """"""
    if not exists('/opt/splunkforwarder'):
        return
    if not env.get('splunk_monitors'):
        with hide('commands'):
            env['splunk_monitors'] = str(splunk('list monitor'))
    for path, sourcetype in monitors:
        if path not in env['splunk_monitors']:
            with hide('everything'):
                run("touch '{path}'; true".format(path=path))
            splunk("add monitor '{path}' -sourcetype {st}".format(
                path=path, st=sourcetype))
            env['splunk_monitors'] += '\n' + path
391018
def brozzler_list_captures(argv=None):
    '''
    
    '''
    import urlcanon

    argv = argv or sys.argv
    arg_parser = argparse.ArgumentParser(
            prog=os.path.basename(argv[0]),
            formatter_class=BetterArgumentDefaultsHelpFormatter)
    arg_parser.add_argument(
            '-p', '--prefix', dest='prefix', action='store_true', help=(
                'use prefix match for url (n.b. may not work as expected if '
                'searching key has query string because canonicalization can '
                'reorder query parameters)'))
    arg_parser.add_argument(
            '--yaml', dest='yaml', action='store_true', help=(
                'yaml output (default is json)'))
    add_rethinkdb_options(arg_parser)
    add_common_options(arg_parser, argv)
    arg_parser.add_argument(
            'url_or_sha1', metavar='URL_or_SHA1',
            help='url or sha1 to look up in captures table')

    args = arg_parser.parse_args(args=argv[1:])
    configure_logging(args)

    rr = rethinker(args)

    if args.url_or_sha1[:5] == 'sha1:':
        if args.prefix:
            logging.warn(
                    'ignoring supplied --prefix option which does not apply '
                    'to lookup by sha1')
        # assumes it's already base32 (XXX could detect if hex and convert)
        sha1base32 = args.url_or_sha1[5:].upper()
        reql = rr.table('captures').between(
                [sha1base32, r.minval, r.minval],
                [sha1base32, r.maxval, r.maxval],
                index='sha1_warc_type')
        logging.debug('querying rethinkdb: %s', reql)
        results = reql.run()
    else:
        key = urlcanon.semantic(args.url_or_sha1).surt().decode('ascii')
        abbr_start_key = key[:150]
        if args.prefix:
            # surt is necessarily ascii and \x7f is the last ascii character
            abbr_end_key = key[:150] + '\x7f'
            end_key = key + '\x7f'
        else:
            abbr_end_key = key[:150]
            end_key = key
        reql = rr.table('captures').between(
                [abbr_start_key, r.minval],
                [abbr_end_key, r.maxval],
                index='abbr_canon_surt_timestamp', right_bound='closed')
        reql = reql.order_by(index='abbr_canon_surt_timestamp')
        reql = reql.filter(
                lambda capture: (capture['canon_surt'] >= key)
                                 & (capture['canon_surt'] <= end_key))
        logging.debug('querying rethinkdb: %s', reql)
        results = reql.run()

    if args.yaml:
        yaml.dump_all(
                results, stream=sys.stdout, explicit_start=True,
                default_flow_style=False)
    else:
        for result in results:
            print(json.dumps(result, cls=Jsonner, indent=2))
548098
def do_list(lookup, term):
    """"""

    space = lookup.keys()
    matches = fnmatch.filter(space, term)

    return [(m, translate(lookup, m)) for m in matches]
298235
def search(cls, args):
        """"""
        safe_shell_pat = re.escape(args['<pattern>']).replace(r'\*', '.*')
        pat_str = '.*{}.*'.format(safe_shell_pat)
        pattern = re.compile(pat_str, re.IGNORECASE)
        remote_json = NAppsManager.search(pattern)
        remote = set()
        for napp in remote_json:
            # WARNING: This will be changed in future versions, when 'author'
            # will be removed.
            username = napp.get('username', napp.get('author'))
            remote.add(((username, napp.get('name')), napp.get('description')))

        cls._print_napps(remote)
619451
def delete(name, profile="splunk"):
    '''
    
    '''
    client = _get_splunk(profile)
    try:
        client.saved_searches.delete(name)
        return True
    except KeyError:
        return None