<h1>composer Package<aclass="headerlink"href="#composer-package"title="Permalink to this headline">¶</a></h1>
<divclass="section"id="id1">
<h2><aclass="reference internal"href="#module-composer"title="composer"><ttclass="xref py py-mod docutils literal"><spanclass="pre">composer</span></tt></a> Package<aclass="headerlink"href="#id1"title="Permalink to this headline">¶</a></h2>
<spanid="http-client-module"></span><h2><ttclass="xref py py-mod docutils literal"><spanclass="pre">http_client</span></tt> Module<aclass="headerlink"href="#module-composer.http_client"title="Permalink to this headline">¶</a></h2>
<dlclass="function">
<dtid="composer.http_client.api_url">
<ttclass="descclassname">composer.http_client.</tt><ttclass="descname">api_url</tt><big>(</big><em>api_version</em>, <em>url</em><big>)</big><aclass="reference internal"href="_modules/composer/http_client.html#api_url"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.api_url"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the versioned path to the API route</p>
<li><strong>api_version</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – The version of the API to talk to. eg. “0”</li>
<li><strong>url</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – The API route to talk to</li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">The full url to use for the route and API version</p>
<ttclass="descclassname">composer.http_client.</tt><ttclass="descname">append_query</tt><big>(</big><em>url</em>, <em>query</em><big>)</big><aclass="reference internal"href="_modules/composer/http_client.html#append_query"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.append_query"title="Permalink to this definition">¶</a></dt>
<dd><p>Add a query argument to a URL</p>
<p>The query should be of the form “param1=what&param2=ever”, i.e., no
leading ‘?’. The new query data will be appended to any existing
<li><strong>url</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – The original URL</li>
<li><strong>query</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – The query to append</li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">The new URL with the query argument included</p>
<ttclass="descclassname">composer.http_client.</tt><ttclass="descname">delete_url_json</tt><big>(</big><em>socket_path</em>, <em>url</em><big>)</big><aclass="reference internal"href="_modules/composer/http_client.html#delete_url_json"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.delete_url_json"title="Permalink to this definition">¶</a></dt>
<dd><p>Send a DELETE request to the url and return JSON response</p>
<li><strong>socket_path</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
<ttclass="descclassname">composer.http_client.</tt><ttclass="descname">download_file</tt><big>(</big><em>socket_path</em>, <em>url</em>, <em>progress=True</em><big>)</big><aclass="reference internal"href="_modules/composer/http_client.html#download_file"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.download_file"title="Permalink to this definition">¶</a></dt>
<dd><p>Download a file, saving it to the CWD with the included filename</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>socket_path</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
<li><strong>url</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – URL to send POST to</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="composer.http_client.get_filename">
<ttclass="descclassname">composer.http_client.</tt><ttclass="descname">get_filename</tt><big>(</big><em>headers</em><big>)</big><aclass="reference internal"href="_modules/composer/http_client.html#get_filename"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.get_filename"title="Permalink to this definition">¶</a></dt>
<dd><p>Get the filename from the response header</p>
<ttclass="descclassname">composer.http_client.</tt><ttclass="descname">get_url_json</tt><big>(</big><em>socket_path</em>, <em>url</em><big>)</big><aclass="reference internal"href="_modules/composer/http_client.html#get_url_json"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.get_url_json"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the JSON results of a GET request</p>
<li><strong>socket_path</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
<li><strong>url</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – URL to request</li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">The json response from the server</p>
<ttclass="descclassname">composer.http_client.</tt><ttclass="descname">get_url_json_unlimited</tt><big>(</big><em>socket_path</em>, <em>url</em>, <em>total_fn=None</em><big>)</big><aclass="reference internal"href="_modules/composer/http_client.html#get_url_json_unlimited"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.get_url_json_unlimited"title="Permalink to this definition">¶</a></dt>
<li><strong>socket_path</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
<li><strong>url</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – URL to request</li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">The json response from the server</p>
<ttclass="descclassname">composer.http_client.</tt><ttclass="descname">get_url_raw</tt><big>(</big><em>socket_path</em>, <em>url</em><big>)</big><aclass="reference internal"href="_modules/composer/http_client.html#get_url_raw"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.get_url_raw"title="Permalink to this definition">¶</a></dt>
<dd><p>Return the raw results of a GET request</p>
<li><strong>socket_path</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
<li><strong>url</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – URL to request</li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">The raw response from the server</p>
<ttclass="descclassname">composer.http_client.</tt><ttclass="descname">post_url</tt><big>(</big><em>socket_path</em>, <em>url</em>, <em>body</em><big>)</big><aclass="reference internal"href="_modules/composer/http_client.html#post_url"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.post_url"title="Permalink to this definition">¶</a></dt>
<li><strong>socket_path</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
<li><strong>url</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – URL to send POST to</li>
<li><strong>body</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – The data for the body of the POST</li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">The json response from the server</p>
<ttclass="descclassname">composer.http_client.</tt><ttclass="descname">post_url_json</tt><big>(</big><em>socket_path</em>, <em>url</em>, <em>body</em><big>)</big><aclass="reference internal"href="_modules/composer/http_client.html#post_url_json"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.post_url_json"title="Permalink to this definition">¶</a></dt>
<li><strong>socket_path</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
<li><strong>url</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – URL to send POST to</li>
<li><strong>body</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – The data for the body of the POST</li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">The json response from the server</p>
<ttclass="descclassname">composer.http_client.</tt><ttclass="descname">post_url_toml</tt><big>(</big><em>socket_path</em>, <em>url</em>, <em>body</em><big>)</big><aclass="reference internal"href="_modules/composer/http_client.html#post_url_toml"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.http_client.post_url_toml"title="Permalink to this definition">¶</a></dt>
<li><strong>socket_path</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – Path to the Unix socket to use for API communication</li>
<li><strong>url</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – URL to send POST to</li>
<li><strong>body</strong> (<aclass="reference external"href="https://docs.python.org/2/library/functions.html#str"title="(in Python v2.7)"><em>str</em></a>) – The data for the body of the POST</li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">The json response from the server</p>
<spanid="unix-socket-module"></span><h2><ttclass="xref py py-mod docutils literal"><spanclass="pre">unix_socket</span></tt> Module<aclass="headerlink"href="#module-composer.unix_socket"title="Permalink to this headline">¶</a></h2>
<dlclass="class">
<dtid="composer.unix_socket.UnixHTTPConnection">
<emclass="property">class </em><ttclass="descclassname">composer.unix_socket.</tt><ttclass="descname">UnixHTTPConnection</tt><big>(</big><em>socket_path</em>, <em>timeout=60</em><big>)</big><aclass="reference internal"href="_modules/composer/unix_socket.html#UnixHTTPConnection"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.unix_socket.UnixHTTPConnection"title="Permalink to this definition">¶</a></dt>
<ttclass="descname">connect</tt><big>(</big><big>)</big><aclass="reference internal"href="_modules/composer/unix_socket.html#UnixHTTPConnection.connect"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.unix_socket.UnixHTTPConnection.connect"title="Permalink to this definition">¶</a></dt>
<emclass="property">class </em><ttclass="descclassname">composer.unix_socket.</tt><ttclass="descname">UnixHTTPConnectionPool</tt><big>(</big><em>socket_path</em>, <em>timeout=60</em><big>)</big><aclass="reference internal"href="_modules/composer/unix_socket.html#UnixHTTPConnectionPool"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#composer.unix_socket.UnixHTTPConnectionPool"title="Permalink to this definition">¶</a></dt>