diff options
author | jamescott <jamescott@opscode.com> | 2014-02-04 11:16:11 -0800 |
---|---|---|
committer | jamescott <jamescott@opscode.com> | 2014-02-04 11:16:11 -0800 |
commit | 3743ff393832422dd5c36d9c093f11646889df01 (patch) | |
tree | 1f172649bcd92e4df0f81da767b8618421a02959 /distro/common/html/knife_search.html | |
parent | 2a615c49ac61218704d3a34ba20922b94a31ed76 (diff) | |
download | chef-3743ff393832422dd5c36d9c093f11646889df01.tar.gz |
add HTML file for manpage output testing
Diffstat (limited to 'distro/common/html/knife_search.html')
-rw-r--r-- | distro/common/html/knife_search.html | 296 |
1 files changed, 296 insertions, 0 deletions
diff --git a/distro/common/html/knife_search.html b/distro/common/html/knife_search.html new file mode 100644 index 0000000000..9273e5702c --- /dev/null +++ b/distro/common/html/knife_search.html @@ -0,0 +1,296 @@ + + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + + <title>knife search — Knife Man Pages</title> + + <link rel="stylesheet" href="_static/chef.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '', + VERSION: '', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '.html', + HAS_SOURCE: true + }; + </script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <link rel="shortcut icon" href="_static/chef.ico"/> + <link rel="top" title="Knife Man Pages" href="index.html" /> + </head> + <body> +<div style="background-color: #212c35; text-align: left; padding: 0px 0px 0px 0px"> +<a href="http://docs.opscode.com/"><img src="_static/chef_html_logo.png" border="0" alt="Chef"/></a> +</div> + + <div class="related"> + <h3>Navigation</h3> + <ul> + <li><a href="http://docs.opscode.com/chef/knife.html" target="_products">Knife</a>•</li> + <li><a href="http://docs.opscode.com/chef/resources.html" target="_products">Resources</a>•</li> + <li><a href="http://docs.opscode.com/chef/dsl_recipe.html" target="_products">Recipe DSL</a>•</li> + <li><a href="http://docs.opscode.com/chef/lwrps_custom.html" target="_products">LWRPs</a>•</li> + <li><a href="http://docs.opscode.com/search.html">Search the Docs</a>•</li> + <li><a href="http://docs.opscode.com/">Home</a> »</li> + + </ul> + </div> + + <div class="sphinxsidebar"> + <div class="sphinxsidebarwrapper"> + <p class="logo"><a href="knife.html"> + <img class="logo" src="_static/chef_logo.png" alt="Logo"/> + </a></p> + <h3><a href="knife.html">Table Of Contents</a></h3> + <ul> +<li><a class="reference internal" href="#">knife search</a><ul> +<li><a class="reference internal" href="#syntax">Syntax</a></li> +<li><a class="reference internal" href="#options">Options</a></li> +<li><a class="reference internal" href="#examples">Examples</a></li> +</ul> +</li> +</ul> + + </div> + </div> + + <div class="document"> + <div class="documentwrapper"> + <div class="bodywrapper"> + <div class="body"> + + <div class="section" id="knife-search"> +<h1>knife search<a class="headerlink" href="#knife-search" title="Permalink to this headline">¶</a></h1> +<p>Search indexes allow queries to be made for any type of data that is indexed by the server, including data bags (and data bag items), environments, nodes, and roles. A defined query syntax is used to support search patterns like exact, wildcard, range, and fuzzy. A search is a full-text query that can be done from several locations, including from within a recipe, by using the <tt class="docutils literal"><span class="pre">search</span></tt> subcommand in Knife, by using the search functionality in the Chef Manage, or by using the <tt class="docutils literal"><span class="pre">/search</span></tt> or <tt class="docutils literal"><span class="pre">/search/INDEX</span></tt> endpoints in the Chef Server API. The search engine is based on Apache Solr and is run from the server.</p> +<p>The <strong>knife search</strong> subcommand is used run a search query for information that is indexed on a server.</p> +<div class="section" id="syntax"> +<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2> +<p>This argument has the following syntax:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search INDEX SEARCH_QUERY +</pre></div> +</div> +<p>where <tt class="docutils literal"><span class="pre">INDEX</span></tt> is one of <tt class="docutils literal"><span class="pre">client</span></tt>, <tt class="docutils literal"><span class="pre">environment</span></tt>, <tt class="docutils literal"><span class="pre">node</span></tt>, <tt class="docutils literal"><span class="pre">role</span></tt>, or the name of a data bag and <tt class="docutils literal"><span class="pre">SEARCH_QUERY</span></tt> is the search query syntax for the query that will be executed.</p> +<p><tt class="docutils literal"><span class="pre">INDEX</span></tt> is implied if omitted, and will default to <tt class="docutils literal"><span class="pre">node</span></tt>. For example:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search <span class="s1">'*:*'</span> -i +</pre></div> +</div> +<p>will return something similar to:</p> +<div class="highlight-bash"><div class="highlight"><pre>8 items found + +centos-62-dev +opensuse-1203 +ubuntu-1304-dev +ubuntu-1304-orgtest +ubuntu-1204-ohai-test +ubuntu-1304-ifcfg-test +ohai-test +win2k8-dev +</pre></div> +</div> +<p>and is the same search as:</p> +<div class="highlight-bash"><pre>$ knife search node '*:*" -i</pre> +</div> +<p>If the <tt class="docutils literal"><span class="pre">SEARCH_QUERY</span></tt> does not contain a colon character (<tt class="docutils literal"><span class="pre">:</span></tt>), then the default query pattern is <tt class="docutils literal"><span class="pre">tags:*#{@query}*</span> <span class="pre">OR</span> <span class="pre">roles:*#{@query}*</span> <span class="pre">OR</span> <span class="pre">fqdn:*#{@query}*</span> <span class="pre">OR</span> <span class="pre">addresses:*#{@query}*</span></tt>, which means the following two search queries are effectively the same:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search ubuntu +</pre></div> +</div> +<p>or:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s2">"tags:*ubuntu* OR roles:*ubuntu* OR fqdn:*ubuntu* (etc.)"</span> +</pre></div> +</div> +</div> +<div class="section" id="options"> +<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2> +<div class="admonition note"> +<p class="first admonition-title">Note</p> +<p class="last">Review the list of <a class="reference internal" href="knife_common_options.html"><em>common options</em></a> available to this (and all) Knife subcommands and plugins.</p> +</div> +<p>This sub-command has the following options:</p> +<dl class="docutils"> +<dt><tt class="docutils literal"><span class="pre">-a</span> <span class="pre">ATTR</span></tt>, <tt class="docutils literal"><span class="pre">--attribute</span> <span class="pre">ATTR</span></tt></dt> +<dd>The attribute (or attributes) to show.</dd> +<dt><tt class="docutils literal"><span class="pre">-b</span> <span class="pre">ROW</span></tt>, <tt class="docutils literal"><span class="pre">--start</span> <span class="pre">ROW</span></tt></dt> +<dd>The row at which return results will begin.</dd> +<dt><tt class="docutils literal"><span class="pre">-i</span></tt>, <tt class="docutils literal"><span class="pre">--id-only</span></tt></dt> +<dd>Indicates that only matching object IDs will be shown.</dd> +<dt><tt class="docutils literal"><span class="pre">INDEX</span></tt></dt> +<dd>The name of the index to be queried: <tt class="docutils literal"><span class="pre">client</span></tt>, <tt class="docutils literal"><span class="pre">environment</span></tt>, <tt class="docutils literal"><span class="pre">node</span></tt>, <tt class="docutils literal"><span class="pre">role</span></tt>, or <tt class="docutils literal"><span class="pre">DATA_BAG_NAME</span></tt>. Default index: <tt class="docutils literal"><span class="pre">node</span></tt>.</dd> +<dt><tt class="docutils literal"><span class="pre">-l</span></tt>, <tt class="docutils literal"><span class="pre">--long</span></tt></dt> +<dd>Display long output when searching nodes while using the default summary format.</dd> +<dt><tt class="docutils literal"><span class="pre">-m</span></tt>, <tt class="docutils literal"><span class="pre">--medium</span></tt></dt> +<dd>Display more, but not all, of a node’s data when searching using the default summary format.</dd> +<dt><tt class="docutils literal"><span class="pre">-o</span> <span class="pre">SORT</span></tt>, <tt class="docutils literal"><span class="pre">--sort</span> <span class="pre">SORT</span></tt></dt> +<dd>The order in which search results will be sorted.</dd> +<dt><tt class="docutils literal"><span class="pre">-q</span> <span class="pre">SEARCH_QUERY</span></tt>, <tt class="docutils literal"><span class="pre">--query</span> <span class="pre">SEARCH_QUERY</span></tt></dt> +<dd>Use to protect search queries that start with a hyphen (-). A <tt class="docutils literal"><span class="pre">-q</span></tt> query may be specified as an argument or an option, but not both.</dd> +<dt><tt class="docutils literal"><span class="pre">-r</span></tt>, <tt class="docutils literal"><span class="pre">--run-list</span></tt></dt> +<dd>Indicates that only the run-list will be shown.</dd> +<dt><tt class="docutils literal"><span class="pre">-R</span> <span class="pre">INT</span></tt>, <tt class="docutils literal"><span class="pre">--rows</span> <span class="pre">INT</span></tt></dt> +<dd>The number of rows to be returned.</dd> +<dt><tt class="docutils literal"><span class="pre">SEARCH_QUERY</span></tt></dt> +<dd>The search query used to identify a a list of items on a server. This option uses the same syntax as the <tt class="docutils literal"><span class="pre">search</span></tt> sub-command.</dd> +</dl> +</div> +<div class="section" id="examples"> +<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2> +<p>The following examples show how to use this Knife subcommand:</p> +<p><strong>Search by platform ID</strong></p> +<p>To search for the IDs of all nodes running on the Amazon EC2 platform, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s1">'ec2:*'</span> -i +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>4 items found + +ip-0A7CA19F.ec2.internal + +ip-0A58CF8E.ec2.internal + +ip-0A58E134.ec2.internal + +ip-0A7CFFD5.ec2.internal +</pre></div> +</div> +<p><strong>Search by instance type</strong></p> +<p>To search for the instance type (flavor) of all nodes running on the Amazon EC2 platform, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s1">'ec2:*'</span> -a ec2.instance_type +</pre></div> +</div> +<p>to return something like:</p> +<div class="highlight-bash"><div class="highlight"><pre>4 items found + +ec2.instance_type: m1.large +id: ip-0A7CA19F.ec2.internal + +ec2.instance_type: m1.large +id: ip-0A58CF8E.ec2.internal + +ec2.instance_type: m1.large +id: ip-0A58E134.ec2.internal + +ec2.instance_type: m1.large +id: ip-0A7CFFD5.ec2.internal +</pre></div> +</div> +<p><strong>Search by node</strong></p> +<p>To search for all nodes running Ubuntu, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s1">'platform:ubuntu'</span> +</pre></div> +</div> +<p><strong>Search by node and environment</strong></p> +<p>To search for all nodes running CentOS in the production environment, enter:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s1">'chef_environment:production AND platform:centos'</span> +</pre></div> +</div> +<p><strong>Search for nested attributes</strong></p> +<p>To find a nested attribute, use a pattern similar to the following:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <query_to_run> -a <main_attribute>.<nested_attribute> +</pre></div> +</div> +<p><strong>Search for multiple attributes</strong></p> +<p>To build a search query to use more than one attribute, use an underscore (<tt class="docutils literal"><span class="pre">_</span></tt>) to separate each attribute. For example, the following query will search for all nodes running a specific version of Ruby:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s2">"languages_ruby_version:1.9.3"</span> +</pre></div> +</div> +<p><strong>Search for nested attributes using a search query</strong></p> +<p>To build a search query that can find a nested attribute:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node name:<node_name> -a kernel.machine +</pre></div> +</div> +<p><strong>Use a test query</strong></p> +<p>To test a search query that will be used in a <strong>knife ssh</strong> command:</p> +<div class="highlight-bash"><div class="highlight"><pre><span class="nv">$ </span>knife search node <span class="s2">"role:web NOT name:web03"</span> +</pre></div> +</div> +<p>where the query in the previous example will search all servers that have the <tt class="docutils literal"><span class="pre">web</span></tt> role, but not on the server named <tt class="docutils literal"><span class="pre">web03</span></tt>.</p> +</div> +</div> + + + </div> + </div> + </div> + <div class="clearer"></div> + </div> + <div class="related"> + <h3>Navigation</h3> + <ul> + <li><a href="http://docs.opscode.com/chef/knife.html" target="_products">Knife</a>•</li> + <li><a href="http://docs.opscode.com/chef/resources.html" target="_products">Resources</a>•</li> + <li><a href="http://docs.opscode.com/chef/dsl_recipe.html" target="_products">Recipe DSL</a>•</li> + <li><a href="http://docs.opscode.com/chef/lwrps_custom.html" target="_products">LWRPs</a>•</li> + <li><a href="http://docs.opscode.com/search.html">Search the Docs</a>•</li> + <li><a href="http://docs.opscode.com/">Home</a> »</li> + + </ul> + </div> + + + <div class="footer"> + Documentation for current man pages for Knife. + + Send feedback to <a href="mailto:docs@getchef.com">docs@getchef.com</a>. + This work is licensed under a Creative Commons Attribution 3.0 Unported License. + + </div> + +<!-- Start of Async Google Analytics Code --> +<script type="text/javascript"> +var _gaq = _gaq || []; +var pluginUrl = (('https:' == document.location.protocol) ? 'https://ssl.' : 'http://www.') + 'google-analytics.com/plugins/ga/inpage_linkid.js'; +_gaq.push(['_setAccount', 'UA-6369228-7']); +_gaq.push(['_setDomainName', '.opscode.com']); +_gaq.push(['_setAllowHash', false]); +_gaq.push(['_setAllowLinker', true]); +_gaq.push(['_addIgnoredRef','opscode.com']); +_gaq.push(['_trackPageview']); + +(function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; + ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; + s.parentNode.insertBefore(ga, s); })(); +</script> +<!-- End of Async Google Analytics Code --> + + + +<!-- Start of Contact Analytics Code --> +<script type="text/javascript"> +(function() { + var didInit = false; + function initMunchkin() { + if(didInit === false) { + didInit = true; + Munchkin.init('255-VFB-268'); + } + } + var s = document.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = document.location.protocol + '//munchkin.marketo.net/munchkin.js'; + s.onreadystatechange = function() { + if (this.readyState == 'complete' || this.readyState == 'loaded') { + initMunchkin(); + } + }; + s.onload = initMunchkin; + document.getElementsByTagName('head')[0].appendChild(s); +})(); +</script> +<!-- End of Contact Analytics Code --> + + + </body> +</html>
\ No newline at end of file |