lorax/pylorax.api.html

5206 lines
407 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
2020-10-07 17:56:09 +00:00
<title>pylorax.api package &mdash; Lorax 34.0 documentation</title>
2019-03-27 23:44:17 +00:00
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
2019-03-27 23:44:17 +00:00
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
2020-10-07 17:56:09 +00:00
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
2019-03-27 23:44:17 +00:00
<script type="text/javascript" src="_static/js/theme.js"></script>
2019-03-27 23:44:17 +00:00
2019-03-27 23:44:17 +00:00
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="pylorax package" href="pylorax.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
2019-03-27 23:44:17 +00:00
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> Lorax
</a>
<div class="version">
2020-10-07 17:56:09 +00:00
34.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction to Lorax</a></li>
<li class="toctree-l1"><a class="reference internal" href="intro.html#before-lorax">Before Lorax</a></li>
<li class="toctree-l1"><a class="reference internal" href="lorax.html">Lorax</a></li>
<li class="toctree-l1"><a class="reference internal" href="livemedia-creator.html">livemedia-creator</a></li>
<li class="toctree-l1"><a class="reference internal" href="lorax-composer.html">lorax-composer</a></li>
2018-10-29 20:42:44 +00:00
<li class="toctree-l1"><a class="reference internal" href="composer-cli.html">composer-cli</a></li>
2019-11-05 22:45:24 +00:00
<li class="toctree-l1"><a class="reference internal" href="mkksiso.html">mkksiso</a></li>
<li class="toctree-l1"><a class="reference internal" href="product-images.html">Product and Updates Images</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">src</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="composer.html">composer package</a></li>
2019-10-16 23:14:02 +00:00
<li class="toctree-l2"><a class="reference internal" href="lifted.html">lifted package</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="pylorax.html">pylorax package</a><ul class="current">
<li class="toctree-l3 current"><a class="reference internal" href="pylorax.html#subpackages">Subpackages</a><ul class="current">
<li class="toctree-l4 current"><a class="current reference internal" href="#">pylorax.api package</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#submodules">Submodules</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.base">pylorax.base module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.buildstamp">pylorax.buildstamp module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.cmdline">pylorax.cmdline module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.creator">pylorax.creator module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.decorators">pylorax.decorators module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.discinfo">pylorax.discinfo module</a></li>
2019-03-27 23:44:17 +00:00
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.dnfbase">pylorax.dnfbase module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.dnfhelper">pylorax.dnfhelper module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.executils">pylorax.executils module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.imgutils">pylorax.imgutils module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.installer">pylorax.installer module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.ltmpl">pylorax.ltmpl module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.monitor">pylorax.monitor module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.mount">pylorax.mount module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.output">pylorax.output module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.sysutils">pylorax.sysutils module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.treebuilder">pylorax.treebuilder module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax.treeinfo">pylorax.treeinfo module</a></li>
<li class="toctree-l3"><a class="reference internal" href="pylorax.html#module-pylorax">Module contents</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Lorax</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li><a href="modules.html">src</a> &raquo;</li>
<li><a href="pylorax.html">pylorax package</a> &raquo;</li>
<li>pylorax.api package</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/pylorax.api.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="pylorax-api-package">
<h1>pylorax.api package<a class="headerlink" href="#pylorax-api-package" title="Permalink to this headline"></a></h1>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline"></a></h2>
2019-03-27 23:44:17 +00:00
</div>
<div class="section" id="module-pylorax.api.bisect">
<span id="pylorax-api-bisect-module"></span><h2>pylorax.api.bisect module<a class="headerlink" href="#module-pylorax.api.bisect" title="Permalink to this headline"></a></h2>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.bisect.insort_left">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.bisect.</code><code class="sig-name descname">insort_left</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">a</span></em>, <em class="sig-param"><span class="n">x</span></em>, <em class="sig-param"><span class="n">key</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">lo</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">hi</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/bisect.html#insort_left"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.bisect.insort_left" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Insert item x in list a, and keep it sorted assuming a is sorted.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
2019-10-16 23:14:02 +00:00
<li><p><strong>a</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)"><em>list</em></a>) -- sorted list</p></li>
<li><p><strong>x</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><em>object</em></a>) -- item to insert into the list</p></li>
2019-03-27 23:44:17 +00:00
<li><p><strong>key</strong> (<em>function</em>) -- Function to use to compare items in the list</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>index where the item was inserted</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)">int</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
<p>If x is already in a, insert it to the left of the leftmost x.
Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.</p>
<p>This is a modified version of bisect.insort_left that can use a
function for the compare, and returns the index position where it
was inserted.</p>
</dd></dl>
2018-08-13 23:44:47 +00:00
</div>
<div class="section" id="module-pylorax.api.checkparams">
<span id="pylorax-api-checkparams-module"></span><h2>pylorax.api.checkparams module<a class="headerlink" href="#module-pylorax.api.checkparams" title="Permalink to this headline"></a></h2>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2018-08-13 23:44:47 +00:00
<dt id="pylorax.api.checkparams.checkparams">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.checkparams.</code><code class="sig-name descname">checkparams</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">tuples</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/checkparams.html#checkparams"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.checkparams.checkparams" title="Permalink to this definition"></a></dt>
2018-08-13 23:44:47 +00:00
<dd></dd></dl>
</div>
<div class="section" id="module-pylorax.api.cmdline">
<span id="pylorax-api-cmdline-module"></span><h2>pylorax.api.cmdline module<a class="headerlink" href="#module-pylorax.api.cmdline" title="Permalink to this headline"></a></h2>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.cmdline.lorax_composer_parser">
2019-07-30 22:48:40 +00:00
<code class="sig-prename descclassname">pylorax.api.cmdline.</code><code class="sig-name descname">lorax_composer_parser</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/cmdline.html#lorax_composer_parser"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.cmdline.lorax_composer_parser" title="Permalink to this definition"></a></dt>
<dd><p>Return the ArgumentParser for lorax-composer</p>
</dd></dl>
</div>
<div class="section" id="module-pylorax.api.compose">
<span id="pylorax-api-compose-module"></span><h2>pylorax.api.compose module<a class="headerlink" href="#module-pylorax.api.compose" title="Permalink to this headline"></a></h2>
<p>Setup for composing an image</p>
<div class="section" id="adding-new-output-types">
<h3>Adding New Output Types<a class="headerlink" href="#adding-new-output-types" title="Permalink to this headline"></a></h3>
<p>The new output type must add a kickstart template to ./share/composer/ where the
name of the kickstart (without the trailing .ks) matches the entry in compose_args.</p>
<p>The kickstart should not have any url or repo entries, these will be added at build
time. The %packages section should be the last thing, and while it can contain mandatory
packages required by the output type, it should not have the trailing %end because the
package NEVRAs will be appended to it at build time.</p>
<p>compose_args should have a name matching the kickstart, and it should set the novirt_install
parameters needed to generate the desired output. Other types should be set to False.</p>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.compose.add_customizations">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">add_customizations</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">f</span></em>, <em class="sig-param"><span class="n">recipe</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#add_customizations"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.add_customizations" title="Permalink to this definition"></a></dt>
<dd><p>Add customizations to the kickstart file</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>f</strong> (<em>open file object</em>) -- kickstart file object</p></li>
<li><p><strong>recipe</strong> (<em>Recipe object</em>) -- </p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>None</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p>RuntimeError if there was a problem writing to the kickstart</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.compose.bootloader_append">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">bootloader_append</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">line</span></em>, <em class="sig-param"><span class="n">kernel_append</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#bootloader_append"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.bootloader_append" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Insert the kernel_append string into the --append argument</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
2019-10-16 23:14:02 +00:00
<li><p><strong>line</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The bootloader ... line</p></li>
<li><p><strong>kernel_append</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The arguments to append to the --append section</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
</dl>
<p>Using pykickstart to process the line is the best way to make sure it
is parsed correctly, and re-assembled for inclusion into the final kickstart</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.compose.compose_args">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">compose_args</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">compose_type</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#compose_args"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.compose_args" title="Permalink to this definition"></a></dt>
<dd><p>Returns the settings to pass to novirt_install for the compose type</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>compose_type</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The type of compose to create, from <cite>compose_types()</cite></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
<p>This will return a dict of options that match the ArgumentParser options for livemedia-creator.
2019-03-27 23:44:17 +00:00
These are the ones the define the type of output, it's filename, etc.
Other options will be filled in by <cite>make_compose()</cite></p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.compose.compose_types">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">compose_types</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">share_dir</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#compose_types"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.compose_types" title="Permalink to this definition"></a></dt>
2019-11-05 22:45:24 +00:00
<dd><p>Returns a list of tuples of the supported output types, and their state</p>
<p>The output types come from the kickstart names in /usr/share/lorax/composer/*ks</p>
2019-11-05 22:45:24 +00:00
<p>If they are disabled on the current arch their state is False. If enabled, it is True.
eg. [(&quot;alibaba&quot;, False), (&quot;ext4-filesystem&quot;, True), ...]</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.compose.customize_ks_template">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">customize_ks_template</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">ks_template</span></em>, <em class="sig-param"><span class="n">recipe</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#customize_ks_template"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.customize_ks_template" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Customize the kickstart template and return it</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
2019-10-16 23:14:02 +00:00
<li><p><strong>ks_template</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The kickstart template</p></li>
2019-03-27 23:44:17 +00:00
<li><p><strong>recipe</strong> (<em>Recipe object</em>) -- </p></li>
</ul>
</dd>
</dl>
2019-05-03 00:15:17 +00:00
<p>Apply customizations to existing template commands, or add defaults for ones that are
missing and required.</p>
2019-03-27 23:44:17 +00:00
<p>Apply customizations.kernel.append to the bootloader argument in the template.
Add bootloader line if it is missing.</p>
2019-05-03 00:15:17 +00:00
<p>Add default timezone if needed. It does NOT replace an existing timezone entry</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-05-03 00:15:17 +00:00
<dt id="pylorax.api.compose.firewall_cmd">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">firewall_cmd</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">line</span></em>, <em class="sig-param"><span class="n">settings</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#firewall_cmd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.firewall_cmd" title="Permalink to this definition"></a></dt>
2019-05-03 00:15:17 +00:00
<dd><p>Update the firewall line with the new ports and services</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
2019-10-16 23:14:02 +00:00
<li><p><strong>line</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The firewall ... line</p></li>
<li><p><strong>settings</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><em>dict</em></a>) -- A dict with the list of services and ports to enable and disable</p></li>
2019-05-03 00:15:17 +00:00
</ul>
</dd>
</dl>
<p>Using pykickstart to process the line is the best way to make sure it
is parsed correctly, and re-assembled for inclusion into the final kickstart</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-05-03 00:15:17 +00:00
<dt id="pylorax.api.compose.get_default_services">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">get_default_services</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">recipe</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#get_default_services"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.get_default_services" title="Permalink to this definition"></a></dt>
2019-05-03 00:15:17 +00:00
<dd><p>Get the default string for services, based on recipe
:param recipe: The recipe</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>string with &quot;services&quot; or &quot;&quot;</p>
</dd>
<dt class="field-even">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
2019-05-03 00:15:17 +00:00
</dd>
</dl>
<p>When no services have been selected we don't need to add anything to the kickstart
so return an empty string. Otherwise return &quot;services&quot; which will be updated with
the settings.</p>
2019-03-27 23:44:17 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.compose.get_extra_pkgs">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">get_extra_pkgs</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dbo</span></em>, <em class="sig-param"><span class="n">share_dir</span></em>, <em class="sig-param"><span class="n">compose_type</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#get_extra_pkgs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.get_extra_pkgs" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Return extra packages needed for the output type</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dbo</strong> (<em>dnf.Base</em>) -- dnf base object</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>share_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path to the top level share directory</p></li>
<li><p><strong>compose_type</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The type of output to create from the recipe</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of package names (name only, not NEVRA)</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)">list</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
<p>Currently this is only needed by live-iso, it reads ./live/live-install.tmpl and
processes only the installpkg lines. It lists the packages needed to complete creation of the
iso using the templates such as x86.tmpl</p>
<p>Keep in mind that the live-install.tmpl is shared between livemedia-creator and lorax-composer,
even though the results are applied differently.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-05-03 00:15:17 +00:00
<dt id="pylorax.api.compose.get_firewall_settings">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">get_firewall_settings</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">recipe</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#get_firewall_settings"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.get_firewall_settings" title="Permalink to this definition"></a></dt>
2019-05-03 00:15:17 +00:00
<dd><p>Return the customizations.firewall settings</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>recipe</strong> (<em>Recipe object</em>) -- The recipe</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A dict of settings</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a></p>
2019-05-03 00:15:17 +00:00
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.compose.get_kernel_append">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">get_kernel_append</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">recipe</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#get_kernel_append"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.get_kernel_append" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Return the customizations.kernel append value</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>recipe</strong> (<em>Recipe object</em>) -- </p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>append value or empty string</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-05-03 00:15:17 +00:00
<dt id="pylorax.api.compose.get_keyboard_layout">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">get_keyboard_layout</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">recipe</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#get_keyboard_layout"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.get_keyboard_layout" title="Permalink to this definition"></a></dt>
2019-05-03 00:15:17 +00:00
<dd><p>Return the customizations.locale.keyboard list</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>recipe</strong> (<em>Recipe object</em>) -- The recipe</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The keyboard layout string</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
2019-05-03 00:15:17 +00:00
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-05-03 00:15:17 +00:00
<dt id="pylorax.api.compose.get_languages">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">get_languages</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">recipe</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#get_languages"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.get_languages" title="Permalink to this definition"></a></dt>
2019-05-03 00:15:17 +00:00
<dd><p>Return the customizations.locale.languages list</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>recipe</strong> (<em>Recipe object</em>) -- The recipe</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>list of language strings</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)">list</a></p>
2019-05-03 00:15:17 +00:00
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-05-03 00:15:17 +00:00
<dt id="pylorax.api.compose.get_services">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">get_services</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">recipe</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#get_services"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.get_services" title="Permalink to this definition"></a></dt>
2019-05-03 00:15:17 +00:00
<dd><p>Return the customizations.services settings</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>recipe</strong> (<em>Recipe object</em>) -- The recipe</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A dict of settings</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a></p>
2019-05-03 00:15:17 +00:00
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-05-03 00:15:17 +00:00
<dt id="pylorax.api.compose.get_timezone_settings">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">get_timezone_settings</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">recipe</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#get_timezone_settings"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.get_timezone_settings" title="Permalink to this definition"></a></dt>
2019-05-03 00:15:17 +00:00
<dd><p>Return the customizations.timezone dict</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>recipe</strong> (<em>Recipe object</em>) -- </p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>append value or empty string</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a></p>
2019-05-03 00:15:17 +00:00
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-05-03 00:15:17 +00:00
<dt id="pylorax.api.compose.keyboard_cmd">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">keyboard_cmd</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">line</span></em>, <em class="sig-param"><span class="n">layout</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#keyboard_cmd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.keyboard_cmd" title="Permalink to this definition"></a></dt>
2019-05-03 00:15:17 +00:00
<dd><p>Update the keyboard line with the layout</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
2019-10-16 23:14:02 +00:00
<li><p><strong>line</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The keyboard ... line</p></li>
<li><p><strong>settings</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The keyboard layout</p></li>
2019-05-03 00:15:17 +00:00
</ul>
</dd>
</dl>
<p>Using pykickstart to process the line is the best way to make sure it
is parsed correctly, and re-assembled for inclusion into the final kickstart</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-05-03 00:15:17 +00:00
<dt id="pylorax.api.compose.lang_cmd">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">lang_cmd</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">line</span></em>, <em class="sig-param"><span class="n">languages</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#lang_cmd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.lang_cmd" title="Permalink to this definition"></a></dt>
2019-05-03 00:15:17 +00:00
<dd><p>Update the lang line with the languages</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
2019-10-16 23:14:02 +00:00
<li><p><strong>line</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The lang ... line</p></li>
<li><p><strong>settings</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)"><em>list</em></a>) -- The list of languages</p></li>
2019-05-03 00:15:17 +00:00
</ul>
</dd>
</dl>
<p>Using pykickstart to process the line is the best way to make sure it
is parsed correctly, and re-assembled for inclusion into the final kickstart</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.compose.move_compose_results">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">move_compose_results</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">results_dir</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#move_compose_results"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.move_compose_results" title="Permalink to this definition"></a></dt>
<dd><p>Move the final image to the results_dir and cleanup the unneeded compose files</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="pylorax.html#pylorax.base.DataHolder" title="pylorax.base.DataHolder"><em>DataHolder</em></a>) -- Build configuration</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>results_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Directory to put the results into</p></li>
</ul>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.compose.repo_to_ks">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">repo_to_ks</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">r</span></em>, <em class="sig-param"><span class="n">url</span><span class="o">=</span><span class="default_value">'url'</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#repo_to_ks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.repo_to_ks" title="Permalink to this definition"></a></dt>
<dd><p>Return a kickstart line with the correct args.
:param r: DNF repository information
:type r: dnf.Repo
2019-03-27 23:44:17 +00:00
:param url: &quot;url&quot; or &quot;baseurl&quot; to use for the baseurl parameter
:type url: str
:returns: kickstart command arguments for url/repo command
:rtype: str</p>
2019-03-27 23:44:17 +00:00
<p>Set url to &quot;baseurl&quot; if it is a repo, leave it as &quot;url&quot; for the installation url.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-05-03 00:15:17 +00:00
<dt id="pylorax.api.compose.services_cmd">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">services_cmd</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">line</span></em>, <em class="sig-param"><span class="n">settings</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#services_cmd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.services_cmd" title="Permalink to this definition"></a></dt>
2019-05-03 00:15:17 +00:00
<dd><p>Update the services line with additional services to enable/disable</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
2019-10-16 23:14:02 +00:00
<li><p><strong>line</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The services ... line</p></li>
<li><p><strong>settings</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><em>dict</em></a>) -- A dict with the list of services to enable and disable</p></li>
2019-05-03 00:15:17 +00:00
</ul>
</dd>
</dl>
<p>Using pykickstart to process the line is the best way to make sure it
is parsed correctly, and re-assembled for inclusion into the final kickstart</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.compose.start_build">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">start_build</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">dnflock</span></em>, <em class="sig-param"><span class="n">gitlock</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">recipe_name</span></em>, <em class="sig-param"><span class="n">compose_type</span></em>, <em class="sig-param"><span class="n">test_mode</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#start_build"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.start_build" title="Permalink to this definition"></a></dt>
<dd><p>Start the build</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- Configuration object</p></li>
<li><p><strong>dnflock</strong> (<em>YumLock</em>) -- Lock and YumBase for depsolving</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>recipe</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The recipe to build</p></li>
<li><p><strong>compose_type</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The type of output to create from the recipe</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Unique ID for the build that can be used to track its status</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2018-08-13 23:44:47 +00:00
<dt id="pylorax.api.compose.test_templates">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">test_templates</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dbo</span></em>, <em class="sig-param"><span class="n">share_dir</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#test_templates"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.test_templates" title="Permalink to this definition"></a></dt>
2018-08-13 23:44:47 +00:00
<dd><p>Try depsolving each of the the templates and report any errors</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>dbo</strong> (<em>dnf.Base</em>) -- dnf base object</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of template types and errors</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>List of errors</p>
</dd>
</dl>
2018-08-13 23:44:47 +00:00
<p>Return a list of templates and errors encountered or an empty list</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-05-03 00:15:17 +00:00
<dt id="pylorax.api.compose.timezone_cmd">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">timezone_cmd</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">line</span></em>, <em class="sig-param"><span class="n">settings</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#timezone_cmd"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.timezone_cmd" title="Permalink to this definition"></a></dt>
2019-05-03 00:15:17 +00:00
<dd><p>Update the timezone line with the settings</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
2019-10-16 23:14:02 +00:00
<li><p><strong>line</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The timezone ... line</p></li>
<li><p><strong>settings</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><em>dict</em></a>) -- A dict with timezone and/or ntpservers list</p></li>
2019-05-03 00:15:17 +00:00
</ul>
</dd>
</dl>
<p>Using pykickstart to process the line is the best way to make sure it
is parsed correctly, and re-assembled for inclusion into the final kickstart</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.compose.write_ks_group">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">write_ks_group</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">f</span></em>, <em class="sig-param"><span class="n">group</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#write_ks_group"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.write_ks_group" title="Permalink to this definition"></a></dt>
<dd><p>Write kickstart group entry</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>f</strong> (<em>open file object</em>) -- kickstart file object</p></li>
<li><p><strong>group</strong> -- A blueprint group dictionary</p></li>
</ul>
</dd>
</dl>
<p>gid is optional</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2018-10-04 23:56:59 +00:00
<dt id="pylorax.api.compose.write_ks_root">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">write_ks_root</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">f</span></em>, <em class="sig-param"><span class="n">user</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#write_ks_root"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.write_ks_root" title="Permalink to this definition"></a></dt>
2018-10-04 23:56:59 +00:00
<dd><p>Write kickstart root password and sshkey entry</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>f</strong> (<em>open file object</em>) -- kickstart file object</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>user</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><em>dict</em></a>) -- A blueprint user dictionary</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True if it wrote a rootpw command to the kickstart</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.8)">bool</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
2018-10-04 23:56:59 +00:00
<p>If the entry contains a ssh key, use sshkey to write it
If it contains password, use rootpw to set it</p>
<p>root cannot be used with the user command. So only key and password are supported
for root.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.compose.write_ks_user">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.compose.</code><code class="sig-name descname">write_ks_user</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">f</span></em>, <em class="sig-param"><span class="n">user</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/compose.html#write_ks_user"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.compose.write_ks_user" title="Permalink to this definition"></a></dt>
<dd><p>Write kickstart user and sshkey entry</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>f</strong> (<em>open file object</em>) -- kickstart file object</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>user</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><em>dict</em></a>) -- A blueprint user dictionary</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
</dl>
<p>If the entry contains a ssh key, use sshkey to write it
All of the user fields are optional, except name, write out a kickstart user entry
with whatever options are relevant.</p>
</dd></dl>
</div>
</div>
<div class="section" id="module-pylorax.api.config">
<span id="pylorax-api-config-module"></span><h2>pylorax.api.config module<a class="headerlink" href="#module-pylorax.api.config" title="Permalink to this headline"></a></h2>
2020-10-07 17:56:09 +00:00
<dl class="py class">
<dt id="pylorax.api.config.ComposerConfig">
2020-10-07 17:56:09 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.api.config.</code><code class="sig-name descname">ComposerConfig</code><span class="sig-paren">(</span><em class="sig-param">defaults=None</em>, <em class="sig-param">dict_type=&lt;class 'dict'&gt;</em>, <em class="sig-param">allow_no_value=False</em>, <em class="sig-param">*</em>, <em class="sig-param">delimiters=('='</em>, <em class="sig-param">':')</em>, <em class="sig-param">comment_prefixes=('#'</em>, <em class="sig-param">';')</em>, <em class="sig-param">inline_comment_prefixes=None</em>, <em class="sig-param">strict=True</em>, <em class="sig-param">empty_lines_in_values=True</em>, <em class="sig-param">default_section='DEFAULT'</em>, <em class="sig-param">interpolation=&lt;object object&gt;</em>, <em class="sig-param">converters=&lt;object object&gt;</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/config.html#ComposerConfig"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.config.ComposerConfig" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/configparser.html#configparser.ConfigParser" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">configparser.ConfigParser</span></code></a></p>
2020-10-07 17:56:09 +00:00
<dl class="py method">
<dt id="pylorax.api.config.ComposerConfig.get_default">
2020-10-07 17:56:09 +00:00
<code class="sig-name descname">get_default</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">section</span></em>, <em class="sig-param"><span class="n">option</span></em>, <em class="sig-param"><span class="n">default</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/config.html#ComposerConfig.get_default"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.config.ComposerConfig.get_default" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.config.configure">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.config.</code><code class="sig-name descname">configure</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">conf_file</span><span class="o">=</span><span class="default_value">'/etc/lorax/composer.conf'</span></em>, <em class="sig-param"><span class="n">root_dir</span><span class="o">=</span><span class="default_value">'/'</span></em>, <em class="sig-param"><span class="n">test_config</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/config.html#configure"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.config.configure" title="Permalink to this definition"></a></dt>
<dd><p>lorax-composer configuration</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
2019-10-16 23:14:02 +00:00
<li><p><strong>conf_file</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path to the config file overriding the default settings</p></li>
<li><p><strong>root_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Directory to prepend to paths, defaults to /</p></li>
<li><p><strong>test_config</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.8)"><em>bool</em></a>) -- Set to True to skip reading conf_file</p></li>
</ul>
2019-03-27 23:44:17 +00:00
</dd>
2019-10-16 23:14:02 +00:00
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Configuration</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig">ComposerConfig</a></p>
</dd>
2019-03-27 23:44:17 +00:00
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.config.make_dnf_dirs">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.config.</code><code class="sig-name descname">make_dnf_dirs</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">conf</span></em>, <em class="sig-param"><span class="n">uid</span></em>, <em class="sig-param"><span class="n">gid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/config.html#make_dnf_dirs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.config.make_dnf_dirs" title="Permalink to this definition"></a></dt>
2018-10-29 20:42:44 +00:00
<dd><p>Make any missing dnf directories owned by user:group</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>conf</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- The configuration to use</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>uid</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- uid of owner</p></li>
<li><p><strong>gid</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- gid of owner</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>list of errors</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list of str</p>
</dd>
</dl>
2018-10-29 20:42:44 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2018-10-29 20:42:44 +00:00
<dt id="pylorax.api.config.make_owned_dir">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.config.</code><code class="sig-name descname">make_owned_dir</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">p_dir</span></em>, <em class="sig-param"><span class="n">uid</span></em>, <em class="sig-param"><span class="n">gid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/config.html#make_owned_dir"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.config.make_owned_dir" title="Permalink to this definition"></a></dt>
2018-10-29 20:42:44 +00:00
<dd><p>Make a directory and its parents, setting owner and group</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>p_dir</strong> (<em>string</em>) -- path to directory to create</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>uid</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- uid of owner</p></li>
<li><p><strong>gid</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- gid of owner</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>list of errors</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list of str</p>
</dd>
</dl>
2018-10-29 20:42:44 +00:00
<p>Check to make sure it does not have o+rw permissions and that it is owned by uid:gid</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.config.make_queue_dirs">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.config.</code><code class="sig-name descname">make_queue_dirs</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">conf</span></em>, <em class="sig-param"><span class="n">gid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/config.html#make_queue_dirs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.config.make_queue_dirs" title="Permalink to this definition"></a></dt>
<dd><p>Make any missing queue directories</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>conf</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- The configuration to use</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>gid</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Group ID that has access to the queue directories</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>list of errors</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list of str</p>
</dd>
</dl>
</dd></dl>
</div>
2018-08-13 23:44:47 +00:00
<div class="section" id="module-pylorax.api.dnfbase">
<span id="pylorax-api-dnfbase-module"></span><h2>pylorax.api.dnfbase module<a class="headerlink" href="#module-pylorax.api.dnfbase" title="Permalink to this headline"></a></h2>
2020-10-07 17:56:09 +00:00
<dl class="py class">
2018-10-04 23:56:59 +00:00
<dt id="pylorax.api.dnfbase.DNFLock">
2020-10-07 17:56:09 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.api.dnfbase.</code><code class="sig-name descname">DNFLock</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">conf</span></em>, <em class="sig-param"><span class="n">expire_secs</span><span class="o">=</span><span class="default_value">21600</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/dnfbase.html#DNFLock"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.dnfbase.DNFLock" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
2018-10-04 23:56:59 +00:00
<p>Hold the dnf.Base object and a Lock to control access to it.</p>
<p>self.dbo is a property that returns the dnf.Base object, but it <em>may</em> change
from one call to the next if the upstream repositories have changed.</p>
2020-10-07 17:56:09 +00:00
<dl class="py method">
2018-10-04 23:56:59 +00:00
<dt id="pylorax.api.dnfbase.DNFLock.lock">
2019-07-30 22:48:40 +00:00
<em class="property">property </em><code class="sig-name descname">lock</code><a class="headerlink" href="#pylorax.api.dnfbase.DNFLock.lock" title="Permalink to this definition"></a></dt>
2018-10-04 23:56:59 +00:00
<dd><p>Check for repo updates (using expiration time) and return the lock</p>
<p>If the repository has been updated, tear down the old dnf.Base and
create a new one. This is the only way to force dnf to use the new
metadata.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py method">
2018-10-04 23:56:59 +00:00
<dt id="pylorax.api.dnfbase.DNFLock.lock_check">
2019-07-30 22:48:40 +00:00
<em class="property">property </em><code class="sig-name descname">lock_check</code><a class="headerlink" href="#pylorax.api.dnfbase.DNFLock.lock_check" title="Permalink to this definition"></a></dt>
2018-10-04 23:56:59 +00:00
<dd><p>Force a check for repo updates and return the lock</p>
<p>Use this method sparingly, it removes the repodata and downloads a new copy every time.</p>
</dd></dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2018-08-13 23:44:47 +00:00
<dt id="pylorax.api.dnfbase.get_base_object">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.dnfbase.</code><code class="sig-name descname">get_base_object</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">conf</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/dnfbase.html#get_base_object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.dnfbase.get_base_object" title="Permalink to this definition"></a></dt>
2018-08-13 23:44:47 +00:00
<dd><p>Get the DNF object with settings from the config file</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>conf</strong> (<em>ComposerParser</em>) -- configuration object</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A DNF Base object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>dnf.Base</p>
</dd>
</dl>
2018-08-13 23:44:47 +00:00
</dd></dl>
</div>
<div class="section" id="module-pylorax.api.errors">
<span id="pylorax-api-errors-module"></span><h2>pylorax.api.errors module<a class="headerlink" href="#module-pylorax.api.errors" title="Permalink to this headline"></a></h2>
2019-06-18 22:08:20 +00:00
</div>
<div class="section" id="module-pylorax.api.flask_blueprint">
<span id="pylorax-api-flask-blueprint-module"></span><h2>pylorax.api.flask_blueprint module<a class="headerlink" href="#module-pylorax.api.flask_blueprint" title="Permalink to this headline"></a></h2>
<p>Flask Blueprints that support skipping routes</p>
<p>When using Blueprints for API versioning you will usually want to fall back
to the previous version's rules for routes that have no new behavior. To do
this we add a 'skip_rule' list to the Blueprint's options dictionary. It lists
all of the routes that you do not want to register.</p>
<dl>
<dt>For example:</dt><dd><p>from pylorax.api.v0 import v0
from pylorax.api.v1 import v1</p>
<p>server.register_blueprint(v0, url_prefix=&quot;/api/v0/&quot;)
server.register_blueprint(v0, url_prefix=&quot;/api/v1/&quot;, skip_rules=[&quot;/blueprints/list&quot;]
server.register_blueprint(v1, url_prefix=&quot;/api/v1/&quot;)</p>
</dd>
</dl>
<p>This will register all of v0's routes under <cite>/api/v0</cite>, and all but <cite>/blueprints/list</cite> under /api/v1,
and then register v1's version of <cite>/blueprints/list</cite> under <cite>/api/v1</cite></p>
2020-10-07 17:56:09 +00:00
<dl class="py class">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.flask_blueprint.BlueprintSetupStateSkip">
2020-10-07 17:56:09 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.api.flask_blueprint.</code><code class="sig-name descname">BlueprintSetupStateSkip</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">blueprint</span></em>, <em class="sig-param"><span class="n">app</span></em>, <em class="sig-param"><span class="n">options</span></em>, <em class="sig-param"><span class="n">first_registration</span></em>, <em class="sig-param"><span class="n">skip_rules</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/flask_blueprint.html#BlueprintSetupStateSkip"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.flask_blueprint.BlueprintSetupStateSkip" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">flask.blueprints.BlueprintSetupState</span></code></p>
2020-10-07 17:56:09 +00:00
<dl class="py method">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.flask_blueprint.BlueprintSetupStateSkip.add_url_rule">
2020-10-07 17:56:09 +00:00
<code class="sig-name descname">add_url_rule</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">rule</span></em>, <em class="sig-param"><span class="n">endpoint</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">view_func</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">options</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/flask_blueprint.html#BlueprintSetupStateSkip.add_url_rule"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.flask_blueprint.BlueprintSetupStateSkip.add_url_rule" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>A helper method to register a rule (and optionally a view function)
to the application. The endpoint is automatically prefixed with the
blueprint's name.</p>
</dd></dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py class">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.flask_blueprint.BlueprintSkip">
2020-10-07 17:56:09 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.api.flask_blueprint.</code><code class="sig-name descname">BlueprintSkip</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/flask_blueprint.html#BlueprintSkip"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.flask_blueprint.BlueprintSkip" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">flask.blueprints.Blueprint</span></code></p>
2020-10-07 17:56:09 +00:00
<dl class="py method">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.flask_blueprint.BlueprintSkip.make_setup_state">
2020-10-07 17:56:09 +00:00
<code class="sig-name descname">make_setup_state</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">app</span></em>, <em class="sig-param"><span class="n">options</span></em>, <em class="sig-param"><span class="n">first_registration</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/flask_blueprint.html#BlueprintSkip.make_setup_state"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.flask_blueprint.BlueprintSkip.make_setup_state" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Creates an instance of <code class="xref py py-meth docutils literal notranslate"><span class="pre">BlueprintSetupState()</span></code>
object that is later passed to the register callback functions.
Subclasses can override this to return a subclass of the setup state.</p>
</dd></dl>
</dd></dl>
2019-03-27 23:44:17 +00:00
</div>
<div class="section" id="module-pylorax.api.gitrpm">
<span id="pylorax-api-gitrpm-module"></span><h2>pylorax.api.gitrpm module<a class="headerlink" href="#module-pylorax.api.gitrpm" title="Permalink to this headline"></a></h2>
<p>Clone a git repository and package it as an rpm</p>
<p>This module contains functions for cloning a git repo, creating a tar archive of
the selected commit, branch, or tag, and packaging the files into an rpm that will
be installed by anaconda when creating the image.</p>
2020-10-07 17:56:09 +00:00
<dl class="py class">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.gitrpm.GitArchiveTarball">
2020-10-07 17:56:09 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.api.gitrpm.</code><code class="sig-name descname">GitArchiveTarball</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">gitRepo</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#GitArchiveTarball"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.GitArchiveTarball" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
2019-03-27 23:44:17 +00:00
<p>Create a git archive of the selected git repo and reference</p>
2020-10-07 17:56:09 +00:00
<dl class="py method">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.gitrpm.GitArchiveTarball.write_file">
2020-10-07 17:56:09 +00:00
<code class="sig-name descname">write_file</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">sourcesDir</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#GitArchiveTarball.write_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.GitArchiveTarball.write_file" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Create the tar archive</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>sourcesDir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path to use for creating the archive</p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
<p>This clones the git repository and creates a git archive from the specified reference.
The result is in RPMNAME.tar.xz under the sourcesDir</p>
</dd></dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py class">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.gitrpm.GitRpmBuild">
2020-10-07 17:56:09 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.api.gitrpm.</code><code class="sig-name descname">GitRpmBuild</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#GitRpmBuild"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.GitRpmBuild" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">rpmfluff.rpmbuild.SimpleRpmBuild</span></code></p>
2019-03-27 23:44:17 +00:00
<p>Build an rpm containing files from a git repository</p>
2020-10-07 17:56:09 +00:00
<dl class="py method">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.gitrpm.GitRpmBuild.add_git_tarball">
2020-10-07 17:56:09 +00:00
<code class="sig-name descname">add_git_tarball</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">gitRepo</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#GitRpmBuild.add_git_tarball"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.GitRpmBuild.add_git_tarball" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Add a tar archive of a git repository to the rpm</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>gitRepo</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><em>dict</em></a>) -- A dict with the repository details</p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
<p>This populates the rpm with the URL of the git repository, the summary
describing the repo, the description of the repository and reference used,
and sets up the rpm to install the archive contents into the destination
path.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py method">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.gitrpm.GitRpmBuild.check">
2019-07-30 22:48:40 +00:00
<code class="sig-name descname">check</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#GitRpmBuild.check"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.GitRpmBuild.check" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd></dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py method">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.gitrpm.GitRpmBuild.clean">
2019-07-30 22:48:40 +00:00
<code class="sig-name descname">clean</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#GitRpmBuild.clean"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.GitRpmBuild.clean" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Remove the base directory from inside the tmpdir</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py method">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.gitrpm.GitRpmBuild.cleanup_tmpdir">
2019-07-30 22:48:40 +00:00
<code class="sig-name descname">cleanup_tmpdir</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#GitRpmBuild.cleanup_tmpdir"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.GitRpmBuild.cleanup_tmpdir" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Remove the temporary directory and all of its contents</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py method">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.gitrpm.GitRpmBuild.get_base_dir">
2019-07-30 22:48:40 +00:00
<code class="sig-name descname">get_base_dir</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#GitRpmBuild.get_base_dir"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.GitRpmBuild.get_base_dir" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Place all the files under a temporary directory + rpmbuild/</p>
</dd></dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.gitrpm.create_gitrpm_repo">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.gitrpm.</code><code class="sig-name descname">create_gitrpm_repo</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">results_dir</span></em>, <em class="sig-param"><span class="n">recipe</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#create_gitrpm_repo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.create_gitrpm_repo" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Create a dnf repository with the rpms from the recipe</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
2019-10-16 23:14:02 +00:00
<li><p><strong>results_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path to create the repository under</p></li>
2019-03-27 23:44:17 +00:00
<li><p><strong>recipe</strong> (<a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe"><em>Recipe</em></a>) -- The recipe to get the repos.git entries from</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Path to the dnf repository or &quot;&quot;</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
<p>This function creates a dnf repository directory at results_dir+&quot;repo/&quot;,
creates rpms for all of the repos.git entries in the recipe, runs createrepo_c
on the dnf repository so that Anaconda can use it, and returns the path to the
repository to the caller.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.gitrpm.get_repo_description">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.gitrpm.</code><code class="sig-name descname">get_repo_description</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">gitRepo</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#get_repo_description"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.get_repo_description" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Return a description including the git repo and reference</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>gitRepo</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><em>dict</em></a>) -- A dict with the repository details</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A string with the git repo url and reference</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.gitrpm.make_git_rpm">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.gitrpm.</code><code class="sig-name descname">make_git_rpm</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">gitRepo</span></em>, <em class="sig-param"><span class="n">dest</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/gitrpm.html#make_git_rpm"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.gitrpm.make_git_rpm" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Create an rpm from the specified git repo</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>gitRepo</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><em>dict</em></a>) -- A dict with the repository details</p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
<p>This will clone the git repository, create an archive of the selected reference,
and build an rpm that will install the files from the repository under the destination
directory. The gitRepo dict should have the following fields:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">rpmname</span><span class="p">:</span> <span class="s2">&quot;server-config&quot;</span>
<span class="n">rpmversion</span><span class="p">:</span> <span class="s2">&quot;1.0&quot;</span>
<span class="n">rpmrelease</span><span class="p">:</span> <span class="s2">&quot;1&quot;</span>
<span class="n">summary</span><span class="p">:</span> <span class="s2">&quot;Setup files for server deployment&quot;</span>
<span class="n">repo</span><span class="p">:</span> <span class="s2">&quot;PATH OF GIT REPO TO CLONE&quot;</span>
<span class="n">ref</span><span class="p">:</span> <span class="s2">&quot;v1.0&quot;</span>
<span class="n">destination</span><span class="p">:</span> <span class="s2">&quot;/opt/server/&quot;</span>
</pre></div>
</div>
<ul class="simple">
<li><p>rpmname: Name of the rpm to create, also used as the prefix name in the tar archive</p></li>
<li><p>rpmversion: Version of the rpm, eg. &quot;1.0.0&quot;</p></li>
<li><p>rpmrelease: Release of the rpm, eg. &quot;1&quot;</p></li>
<li><p>summary: Summary string for the rpm</p></li>
<li><p>repo: URL of the get repo to clone and create the archive from</p></li>
<li><p>ref: Git reference to check out. eg. origin/branch-name, git tag, or git commit hash</p></li>
<li><p>destination: Path to install the / of the git repo at when installing the rpm</p></li>
</ul>
</dd></dl>
</div>
<div class="section" id="module-pylorax.api.projects">
<span id="pylorax-api-projects-module"></span><h2>pylorax.api.projects module<a class="headerlink" href="#module-pylorax.api.projects" title="Permalink to this headline"></a></h2>
2020-10-07 17:56:09 +00:00
<dl class="py exception">
<dt id="pylorax.api.projects.ProjectsError">
2019-07-30 22:48:40 +00:00
<em class="property">exception </em><code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">ProjectsError</code><a class="reference internal" href="_modules/pylorax/api/projects.html#ProjectsError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.ProjectsError" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#Exception" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></a></p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.projects.api_changelog">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">api_changelog</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">changelog</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#api_changelog"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.api_changelog" title="Permalink to this definition"></a></dt>
<dd><p>Convert the changelog to a string</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>changelog</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.8)"><em>tuple</em></a>) -- A list of time, author, string tuples.</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The most recent changelog text or &quot;&quot;</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
<p>This returns only the most recent changelog entry.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.projects.api_time">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">api_time</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">t</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#api_time"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.api_time" title="Permalink to this definition"></a></dt>
<dd><p>Convert time since epoch to a string</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>t</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Seconds since epoch</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Time string</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2018-06-04 23:34:57 +00:00
<dt id="pylorax.api.projects.delete_repo_source">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">delete_repo_source</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">source_glob</span></em>, <em class="sig-param"><span class="n">source_id</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#delete_repo_source"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.delete_repo_source" title="Permalink to this definition"></a></dt>
2018-06-04 23:34:57 +00:00
<dd><p>Delete a source from a repo file</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><ul class="simple">
<li><p><strong>source_glob</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- A glob of the repo sources to search</p></li>
<li><p><strong>source_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The repo id to delete</p></li>
</ul>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>None</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p>ProjectsError if there was a problem</p>
</dd>
</dl>
2018-06-04 23:34:57 +00:00
<p>A repo file may have multiple sources in it, delete only the selected source.
If it is the last one in the file, delete the file.</p>
<p>WARNING: This will delete ANY source, the caller needs to ensure that a system
2019-10-16 23:14:02 +00:00
source_id isn't passed to it.</p>
2018-06-04 23:34:57 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.projects.dep_evra">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">dep_evra</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dep</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#dep_evra"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.dep_evra" title="Permalink to this definition"></a></dt>
<dd><p>Return the epoch:version-release.arch for the dep</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>dep</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><em>dict</em></a>) -- dependency dict</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>epoch:version-release.arch</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.projects.dep_nevra">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">dep_nevra</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dep</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#dep_nevra"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.dep_nevra" title="Permalink to this definition"></a></dt>
<dd><p>Return the name-epoch:version-release.arch</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2018-06-04 23:34:57 +00:00
<dt id="pylorax.api.projects.dnf_repo_to_file_repo">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">dnf_repo_to_file_repo</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#dnf_repo_to_file_repo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.dnf_repo_to_file_repo" title="Permalink to this definition"></a></dt>
2018-06-04 23:34:57 +00:00
<dd><p>Return a string representation of a DNF Repo object suitable for writing to a .repo file</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>repo</strong> (<em>dnf.RepoDict</em>) -- DNF Repository</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A string</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
2018-06-04 23:34:57 +00:00
<p>The DNF Repo.dump() function does not produce a string that can be used as a dnf .repo file,
it ouputs baseurl and gpgkey as python lists which DNF cannot read. So do this manually with
only the attributes we care about.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.projects.estimate_size">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">estimate_size</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">packages</span></em>, <em class="sig-param"><span class="n">block_size</span><span class="o">=</span><span class="default_value">6144</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#estimate_size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.estimate_size" title="Permalink to this definition"></a></dt>
<dd><p>Estimate the installed size of a package list</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>packages</strong> (<em>list of hawkey.Package objects</em>) -- The packages to be installed</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>block_size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- The block size to use for rounding up file sizes.</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The estimated size of installed packages</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)">int</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
<p>Estimating actual requirements is difficult without the actual file sizes, which
2019-03-27 23:44:17 +00:00
dnf doesn't provide access to. So use the file count and block size to estimate
a minimum size for each package.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2018-06-04 23:34:57 +00:00
<dt id="pylorax.api.projects.get_repo_sources">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">get_repo_sources</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">source_glob</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#get_repo_sources"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.get_repo_sources" title="Permalink to this definition"></a></dt>
2018-06-04 23:34:57 +00:00
<dd><p>Return a list of sources from a directory of yum repositories</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>source_glob</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- A glob to use to match the source files, including full path</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A list of the source ids in all of the matching files</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list of str</p>
</dd>
</dl>
2018-06-04 23:34:57 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2018-06-04 23:34:57 +00:00
<dt id="pylorax.api.projects.get_source_ids">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">get_source_ids</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">source_path</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#get_source_ids"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.get_source_ids" title="Permalink to this definition"></a></dt>
2018-06-04 23:34:57 +00:00
<dd><p>Return a list of the source ids in a file</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>source_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Full path and filename of the source (yum repo) file</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A list of source id strings</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list of str</p>
</dd>
</dl>
2018-06-04 23:34:57 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.projects.modules_info">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">modules_info</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dbo</span></em>, <em class="sig-param"><span class="n">module_names</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#modules_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.modules_info" title="Permalink to this definition"></a></dt>
<dd><p>Return details about a module, including dependencies</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dbo</strong> (<em>dnf.Base</em>) -- dnf base object</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>module_names</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Names of the modules to get info about</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of dicts with module details and dependencies.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list of dicts</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.projects.modules_list">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">modules_list</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dbo</span></em>, <em class="sig-param"><span class="n">module_names</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#modules_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.modules_list" title="Permalink to this definition"></a></dt>
<dd><p>Return a list of modules</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dbo</strong> (<em>dnf.Base</em>) -- dnf base object</p></li>
<li><p><strong>offset</strong> -- Number of modules to skip</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>limit</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Maximum number of modules to return</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of module information and total count</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple of a list of dicts and an Int</p>
</dd>
</dl>
<p>Modules don't exist in RHEL7 so this only returns projects
and sets the type to &quot;rpm&quot;</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.projects.new_repo_source">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">new_repo_source</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dbo</span></em>, <em class="sig-param"><span class="n">repoid</span></em>, <em class="sig-param"><span class="n">source</span></em>, <em class="sig-param"><span class="n">repo_dir</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#new_repo_source"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.new_repo_source" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Add a new repo source from a Weldr source dict</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dbo</strong> (<em>dnf.Base</em>) -- dnf base object</p></li>
<li><p><strong>id</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The repo id (API v0 uses the name, v1 uses the id)</p></li>
<li><p><strong>source</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><em>dict</em></a>) -- A Weldr source dict</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>None</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p>...</p>
</dd>
</dl>
<p>Make sure access to the dbo has been locked before calling this.
The <cite>id</cite> parameter will the the 'name' field for API v0, and the 'id' field for API v1</p>
<p>DNF variables will be substituted at load time, and on restart.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.projects.pkg_to_build">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">pkg_to_build</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">pkg</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#pkg_to_build"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.pkg_to_build" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Extract the build details from a hawkey.Package object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>pkg</strong> (<em>hawkey.Package</em>) -- hawkey.Package object with package details</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A dict with the build details, epoch, release, arch, build_time, changelog, ...</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
<p>metadata entries are hard-coded to {}</p>
<p>Note that this only returns the build dict, it does not include the name, description, etc.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.projects.pkg_to_dep">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">pkg_to_dep</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">pkg</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#pkg_to_dep"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.pkg_to_dep" title="Permalink to this definition"></a></dt>
<dd><p>Extract the info from a hawkey.Package object</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>pkg</strong> (<em>hawkey.Package</em>) -- A hawkey.Package object</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A dict with name, epoch, version, release, arch</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.projects.pkg_to_project">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">pkg_to_project</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">pkg</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#pkg_to_project"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.pkg_to_project" title="Permalink to this definition"></a></dt>
<dd><p>Extract the details from a hawkey.Package object</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>pkgs</strong> (<em>hawkey.Package</em>) -- hawkey.Package object with package details</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A dict with the name, summary, description, and url.</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
<p>upstream_vcs is hard-coded to UPSTREAM_VCS</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.projects.pkg_to_project_info">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">pkg_to_project_info</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">pkg</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#pkg_to_project_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.pkg_to_project_info" title="Permalink to this definition"></a></dt>
<dd><p>Extract the details from a hawkey.Package object</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>pkg</strong> (<em>hawkey.Package</em>) -- hawkey.Package object with package details</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A dict with the project details, as well as epoch, release, arch, build_time, changelog, ...</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
<p>metadata entries are hard-coded to {}</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.projects.proj_to_module">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">proj_to_module</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">proj</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#proj_to_module"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.proj_to_module" title="Permalink to this definition"></a></dt>
<dd><p>Extract the name from a project_info dict</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>pkg</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><em>dict</em></a>) -- dict with package details</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A dict with name, and group_type</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
<p>group_type is hard-coded to &quot;rpm&quot;</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.projects.projects_depsolve">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">projects_depsolve</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dbo</span></em>, <em class="sig-param"><span class="n">projects</span></em>, <em class="sig-param"><span class="n">groups</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#projects_depsolve"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.projects_depsolve" title="Permalink to this definition"></a></dt>
<dd><p>Return the dependencies for a list of projects</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dbo</strong> (<em>dnf.Base</em>) -- dnf base object</p></li>
<li><p><strong>projects</strong> (<em>List of Strings</em>) -- The projects to find the dependencies for</p></li>
<li><p><strong>groups</strong> (<em>List of str</em>) -- The groups to include in dependency solving</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>NEVRA's of the project and its dependencies</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list of dicts</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>ProjectsError if there was a problem installing something</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.projects.projects_depsolve_with_size">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">projects_depsolve_with_size</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dbo</span></em>, <em class="sig-param"><span class="n">projects</span></em>, <em class="sig-param"><span class="n">groups</span></em>, <em class="sig-param"><span class="n">with_core</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#projects_depsolve_with_size"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.projects_depsolve_with_size" title="Permalink to this definition"></a></dt>
<dd><p>Return the dependencies and installed size for a list of projects</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dbo</strong> (<em>dnf.Base</em>) -- dnf base object</p></li>
<li><p><strong>project_names</strong> (<em>List of Strings</em>) -- The projects to find the dependencies for</p></li>
<li><p><strong>groups</strong> (<em>List of str</em>) -- The groups to include in dependency solving</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>installed size and a list of NEVRA's of the project and its dependencies</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p>tuple of (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)">int</a>, list of dicts)</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>ProjectsError if there was a problem installing something</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.projects.projects_info">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">projects_info</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dbo</span></em>, <em class="sig-param"><span class="n">project_names</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#projects_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.projects_info" title="Permalink to this definition"></a></dt>
<dd><p>Return details about specific projects</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dbo</strong> (<em>dnf.Base</em>) -- dnf base object</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>project_names</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- List of names of projects to get info about</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of project info dicts with pkg_to_project as well as epoch, version, release, etc.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list of dicts</p>
</dd>
</dl>
<p>If project_names is None it will return the full list of available packages</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.projects.projects_list">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">projects_list</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dbo</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#projects_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.projects_list" title="Permalink to this definition"></a></dt>
<dd><p>Return a list of projects</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>dbo</strong> (<em>dnf.Base</em>) -- dnf base object</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of project info dicts with name, summary, description, homepage, upstream_vcs</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list of dicts</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2018-06-04 23:34:57 +00:00
<dt id="pylorax.api.projects.repo_to_source">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">repo_to_source</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">system_source</span></em>, <em class="sig-param"><span class="n">api</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#repo_to_source"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.repo_to_source" title="Permalink to this definition"></a></dt>
2018-06-04 23:34:57 +00:00
<dd><p>Return a Weldr Source dict created from the DNF Repository</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>dnf.RepoDict</em>) -- DNF Repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>system_source</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.8)"><em>bool</em></a>) -- True if this source is an immutable system source</p></li>
<li><p><strong>api</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Select which api version of the dict to return (default 1)</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A dict with Weldr Source fields filled in</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
2018-06-04 23:34:57 +00:00
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;check_gpg&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;check_ssl&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;gpgkey_url&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="s2">&quot;file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-28-x86_64&quot;</span>
<span class="p">],</span>
2019-10-16 23:14:02 +00:00
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;fedora&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Fedora $releasever - $basearch&quot;</span><span class="p">,</span>
2018-06-04 23:34:57 +00:00
<span class="s2">&quot;proxy&quot;</span><span class="p">:</span> <span class="s2">&quot;http://proxy.brianlane.com:8123&quot;</span><span class="p">,</span>
<span class="s2">&quot;system&quot;</span><span class="p">:</span> <span class="n">true</span>
<span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;yum-metalink&quot;</span><span class="p">,</span>
<span class="s2">&quot;url&quot;</span><span class="p">:</span> <span class="s2">&quot;https://mirrors.fedoraproject.org/metalink?repo=fedora-28&amp;arch=x86_64&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
2019-10-16 23:14:02 +00:00
<p>The <code class="docutils literal notranslate"><span class="pre">name</span></code> field has changed in v1 of the API.
In v0 of the API <code class="docutils literal notranslate"><span class="pre">name</span></code> is the repo.id, in v1 it is the repo.name and a new field,
<code class="docutils literal notranslate"><span class="pre">id</span></code> has been added for the repo.id</p>
2018-06-04 23:34:57 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2018-06-04 23:34:57 +00:00
<dt id="pylorax.api.projects.source_to_repo">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">source_to_repo</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">source</span></em>, <em class="sig-param"><span class="n">dnf_conf</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#source_to_repo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.source_to_repo" title="Permalink to this definition"></a></dt>
2018-06-04 23:34:57 +00:00
<dd><p>Return a dnf Repo object created from a source dict</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><ul class="simple">
<li><p><strong>source</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><em>dict</em></a>) -- A Weldr source dict</p></li>
<li><p><strong>dnf_conf</strong> (<em>dnf.conf</em>) -- The dnf Config object</p></li>
</ul>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A dnf Repo object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>dnf.Repo</p>
</dd>
</dl>
2018-06-04 23:34:57 +00:00
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;check_gpg&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
<span class="s2">&quot;check_ssl&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span>
<span class="s2">&quot;gpgkey_urls&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="s2">&quot;file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-28-x86_64&quot;</span>
<span class="p">],</span>
2019-10-16 23:14:02 +00:00
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;fedora&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Fedora $releasever - $basearch&quot;</span><span class="p">,</span>
2018-06-04 23:34:57 +00:00
<span class="s2">&quot;proxy&quot;</span><span class="p">:</span> <span class="s2">&quot;http://proxy.brianlane.com:8123&quot;</span><span class="p">,</span>
<span class="s2">&quot;system&quot;</span><span class="p">:</span> <span class="kc">True</span>
<span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;yum-metalink&quot;</span><span class="p">,</span>
<span class="s2">&quot;url&quot;</span><span class="p">:</span> <span class="s2">&quot;https://mirrors.fedoraproject.org/metalink?repo=fedora-28&amp;arch=x86_64&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
2019-10-16 23:14:02 +00:00
<p>If the <code class="docutils literal notranslate"><span class="pre">id</span></code> field is included it is used for the repo id, otherwise <code class="docutils literal notranslate"><span class="pre">name</span></code> is used.
v0 of the API only used <code class="docutils literal notranslate"><span class="pre">name</span></code>, v1 added the distinction between <code class="docutils literal notranslate"><span class="pre">id</span></code> and <code class="docutils literal notranslate"><span class="pre">name</span></code>.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.projects.source_to_repodict">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.projects.</code><code class="sig-name descname">source_to_repodict</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">source</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/projects.html#source_to_repodict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.projects.source_to_repodict" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Return a tuple suitable for use with dnf.add_new_repo</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>source</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><em>dict</em></a>) -- A Weldr source dict</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A tuple of dnf.Repo attributes</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>(<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a>, <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)">list</a>, <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a>)</p>
</dd>
</dl>
<p>Return a tuple with (id, baseurl|(), kwargs) that can be used
with dnf.repos.add_new_repo</p>
2018-06-04 23:34:57 +00:00
</dd></dl>
</div>
<div class="section" id="module-pylorax.api.queue">
<span id="pylorax-api-queue-module"></span><h2>pylorax.api.queue module<a class="headerlink" href="#module-pylorax.api.queue" title="Permalink to this headline"></a></h2>
<p>Functions to monitor compose queue and run anaconda</p>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.queue.build_status">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">build_status</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">status_filter</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">api</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#build_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.build_status" title="Permalink to this definition"></a></dt>
<dd><p>Return the details of finished or failed builds</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- Configuration settings</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>status_filter</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- What builds to return. None == all, &quot;FINISHED&quot;, or &quot;FAILED&quot;</p></li>
<li><p><strong>api</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Select which api version of the dict to return (default 1)</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-even"><p>A list of the build details (from compose_detail)</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list of dicts</p>
</dd>
</dl>
<p>This returns a list of build details for each of the matching builds on the
system. It does not return the status of builds that have not been finished.
Use queue_status() for those.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.queue.check_queues">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">check_queues</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#check_queues"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.check_queues" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Check to make sure the new and run queue symlinks are correct</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>cfg</strong> (<a class="reference internal" href="pylorax.html#pylorax.base.DataHolder" title="pylorax.base.DataHolder"><em>DataHolder</em></a>) -- Configuration settings</p>
</dd>
</dl>
<p>Also check all of the existing results and make sure any with WAITING
set in STATUS have a symlink in queue/new/</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.queue.compose_detail">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">compose_detail</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">results_dir</span></em>, <em class="sig-param"><span class="n">api</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#compose_detail"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.compose_detail" title="Permalink to this definition"></a></dt>
<dd><p>Return details about the build.</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- Configuration settings (required for api=1)</p></li>
<li><p><strong>results_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The directory containing the metadata and results for the build</p></li>
<li><p><strong>api</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Select which api version of the dict to return (default 1)</p></li>
</ul>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A dictionary with details about the compose</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a></p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>IOError if it cannot read the directory, STATUS, or blueprint file.</p>
</dd>
</dl>
<p>The following details are included in the dict:</p>
<ul class="simple">
2019-03-27 23:44:17 +00:00
<li><p>id - The uuid of the comoposition</p></li>
<li><p>queue_status - The final status of the composition (FINISHED or FAILED)</p></li>
<li><p>compose_type - The type of output generated (tar, iso, etc.)</p></li>
<li><p>blueprint - Blueprint name</p></li>
<li><p>version - Blueprint version</p></li>
<li><p>image_size - Size of the image, if finished. 0 otherwise.</p></li>
2019-10-16 23:14:02 +00:00
<li><p>uploads - For API v1 details about uploading the image are included</p></li>
</ul>
2018-08-13 23:44:47 +00:00
<p>Various timestamps are also included in the dict. These are all Unix UTC timestamps.
It is possible for these timestamps to not always exist, in which case they will be
None in Python (or null in JSON). The following timestamps are included:</p>
<ul class="simple">
2019-03-27 23:44:17 +00:00
<li><p>job_created - When the user submitted the compose</p></li>
<li><p>job_started - Anaconda started running</p></li>
<li><p>job_finished - Job entered FINISHED or FAILED state</p></li>
2018-08-13 23:44:47 +00:00
</ul>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.queue.get_compose_type">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">get_compose_type</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">results_dir</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#get_compose_type"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.get_compose_type" title="Permalink to this definition"></a></dt>
<dd><p>Return the type of composition.</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>results_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The directory containing the metadata and results for the build</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The type of compose (eg. 'tar')</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>RuntimeError if no kickstart template can be found.</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.queue.get_image_name">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">get_image_name</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">uuid_dir</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#get_image_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.get_image_name" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Return the filename and full path of the build's image file</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>uuid</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The UUID of the build</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The image filename and full path</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple of strings</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>RuntimeError if there was a problem (eg. invalid uuid, missing config file)</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.queue.make_compose">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">make_compose</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">results_dir</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#make_compose"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.make_compose" title="Permalink to this definition"></a></dt>
<dd><p>Run anaconda with the final-kickstart.ks from results_dir</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="pylorax.html#pylorax.base.DataHolder" title="pylorax.base.DataHolder"><em>DataHolder</em></a>) -- Configuration settings</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>results_dir</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The directory containing the metadata and results for the build</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Nothing</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p>May raise various exceptions</p>
</dd>
</dl>
<p>This takes the final-kickstart.ks, and the settings in config.toml and runs Anaconda
in no-virt mode (directly on the host operating system). Exceptions should be caught
at the higer level.</p>
<p>If there is a failure, the build artifacts will be cleaned up, and any logs will be
moved into logs/anaconda/ and their ownership will be set to the user from the cfg
object.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.queue.monitor">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">monitor</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#monitor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.monitor" title="Permalink to this definition"></a></dt>
<dd><p>Monitor the queue for new compose requests</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>cfg</strong> (<a class="reference internal" href="pylorax.html#pylorax.base.DataHolder" title="pylorax.base.DataHolder"><em>DataHolder</em></a>) -- Configuration settings</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Does not return</p>
</dd>
</dl>
<p>The queue has 2 subdirectories, new and run. When a compose is ready to be run
a symlink to the uniquely named results directory should be placed in ./queue/new/</p>
<p>When the it is ready to be run (it is checked every 30 seconds or after a previous
compose is finished) the symlink will be moved into ./queue/run/ and a STATUS file
will be created in the results directory.</p>
2019-03-27 23:44:17 +00:00
<p>STATUS can contain one of: WAITING, RUNNING, FINISHED, FAILED</p>
<p>If the system is restarted while a compose is running it will move any old symlinks
from ./queue/run/ to ./queue/new/ and rerun them.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.queue.queue_status">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">queue_status</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">api</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#queue_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.queue_status" title="Permalink to this definition"></a></dt>
<dd><p>Return details about what is in the queue.</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- Configuration settings</p></li>
<li><p><strong>api</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Select which api version of the dict to return (default 1)</p></li>
</ul>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A list of the new composes, and a list of the running composes</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
<p>This returns a dict with 2 lists. &quot;new&quot; is the list of uuids that are waiting to be built,
and &quot;run&quot; has the uuids that are being built (currently limited to 1 at a time).</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.queue.start_queue_monitor">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">start_queue_monitor</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">uid</span></em>, <em class="sig-param"><span class="n">gid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#start_queue_monitor"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.start_queue_monitor" title="Permalink to this definition"></a></dt>
<dd><p>Start the queue monitor as a mp process</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- Configuration settings</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>uid</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- User ID that owns the queue</p></li>
<li><p><strong>gid</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Group ID that owns the queue</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.queue.uuid_add_upload">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">uuid_add_upload</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">uuid</span></em>, <em class="sig-param"><span class="n">upload_uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#uuid_add_upload"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.uuid_add_upload" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Add an upload UUID to a build</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- Configuration settings</p></li>
<li><p><strong>uuid</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The UUID of the build</p></li>
<li><p><strong>upload_uuid</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The UUID of the upload</p></li>
</ul>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>None</p>
</dd>
2019-10-16 23:14:02 +00:00
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.8)">None</a></p>
</dd>
2019-03-27 23:44:17 +00:00
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.queue.uuid_cancel">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">uuid_cancel</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#uuid_cancel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.uuid_cancel" title="Permalink to this definition"></a></dt>
<dd><p>Cancel a build and delete its results</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- Configuration settings</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>uuid</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The UUID of the build</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True if it was canceled and deleted</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.8)">bool</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
<p>Only call this if the build status is WAITING or RUNNING</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.queue.uuid_delete">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">uuid_delete</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#uuid_delete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.uuid_delete" title="Permalink to this definition"></a></dt>
<dd><p>Delete all of the results from a compose</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- Configuration settings</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>uuid</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The UUID of the build</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True if it was deleted</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.8)">bool</a></p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>This will raise an error if the delete failed</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.queue.uuid_get_uploads">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">uuid_get_uploads</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#uuid_get_uploads"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.uuid_get_uploads" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Return the list of uploads for a build uuid</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- Configuration settings</p></li>
<li><p><strong>uuid</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The UUID of the build</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The upload UUIDs associated with the build UUID</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#frozenset" title="(in Python v3.8)">frozenset</a></p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.queue.uuid_image">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">uuid_image</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#uuid_image"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.uuid_image" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Return the filename and full path of the build's image file</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- Configuration settings</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>uuid</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The UUID of the build</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The image filename and full path</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>tuple of strings</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>RuntimeError if there was a problem (eg. invalid uuid, missing config file)</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.queue.uuid_info">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">uuid_info</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">uuid</span></em>, <em class="sig-param"><span class="n">api</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#uuid_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.uuid_info" title="Permalink to this definition"></a></dt>
<dd><p>Return information about the composition</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- Configuration settings</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>uuid</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The UUID of the build</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>dictionary of information about the composition or None</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a></p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>RuntimeError if there was a problem</p>
</dd>
</dl>
<p>This will return a dict with the following fields populated:</p>
<ul class="simple">
2019-03-27 23:44:17 +00:00
<li><p>id - The uuid of the comoposition</p></li>
<li><p>config - containing the configuration settings used to run Anaconda</p></li>
<li><p>blueprint - The depsolved blueprint used to generate the kickstart</p></li>
<li><p>commit - The (local) git commit hash for the blueprint used</p></li>
<li><p>deps - The NEVRA of all of the dependencies used in the composition</p></li>
<li><p>compose_type - The type of output generated (tar, iso, etc.)</p></li>
<li><p>queue_status - The final status of the composition (FINISHED or FAILED)</p></li>
</ul>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.queue.uuid_log">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">uuid_log</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">uuid</span></em>, <em class="sig-param"><span class="n">size</span><span class="o">=</span><span class="default_value">1024</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#uuid_log"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.uuid_log" title="Permalink to this definition"></a></dt>
2019-07-30 22:48:40 +00:00
<dd><p>Return <cite>size</cite> KiB from the end of the most currently relevant log for a
given compose</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- Configuration settings</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>uuid</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The UUID of the build</p></li>
<li><p><strong>size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Number of KiB to read. Default is 1024</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
2019-07-30 22:48:40 +00:00
<dd class="field-even"><p>Up to <cite>size</cite> KiB from the end of the log</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>RuntimeError if there was a problem (eg. no log file available)</p>
</dd>
</dl>
2019-07-30 22:48:40 +00:00
<p>This function will return the end of either the anaconda log, the packaging
log, or the combined composer logs, depending on the progress of the
compose. It tries to return lines from the end of the log, it will attempt
to start on a line boundary, and it may return less than <cite>size</cite> kbytes.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.queue.uuid_ready_upload">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">uuid_ready_upload</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">uuid</span></em>, <em class="sig-param"><span class="n">upload_uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#uuid_ready_upload"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.uuid_ready_upload" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Set an upload to READY if the build is in FINISHED state</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- Configuration settings</p></li>
<li><p><strong>uuid</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The UUID of the build</p></li>
<li><p><strong>upload_uuid</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The UUID of the upload</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>None</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.8)">None</a></p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>RuntimeError if the build uuid is invalid or not in FINISHED state.</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.queue.uuid_remove_upload">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">uuid_remove_upload</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">upload_uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#uuid_remove_upload"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.uuid_remove_upload" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Remove an upload UUID from the build</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- Configuration settings</p></li>
<li><p><strong>upload_uuid</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The UUID of the upload</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>None</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.8)">None</a></p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>RuntimeError if the upload_uuid is not found</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.queue.uuid_schedule_upload">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">uuid_schedule_upload</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">uuid</span></em>, <em class="sig-param"><span class="n">provider_name</span></em>, <em class="sig-param"><span class="n">image_name</span></em>, <em class="sig-param"><span class="n">settings</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#uuid_schedule_upload"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.uuid_schedule_upload" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Schedule an upload of an image</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- Configuration settings</p></li>
<li><p><strong>uuid</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The UUID of the build</p></li>
<li><p><strong>provider_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The name of the cloud provider, e.g. &quot;azure&quot;</p></li>
<li><p><strong>image_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path of the image to upload</p></li>
<li><p><strong>settings</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><em>dict</em></a>) -- Settings to use for the selected provider</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>uuid of the upload</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>RuntimeError if the uuid is not a valid build uuid</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.queue.uuid_status">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">uuid_status</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">uuid</span></em>, <em class="sig-param"><span class="n">api</span><span class="o">=</span><span class="default_value">1</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#uuid_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.uuid_status" title="Permalink to this definition"></a></dt>
<dd><p>Return the details of a specific UUID compose</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- Configuration settings</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>uuid</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The UUID of the build</p></li>
<li><p><strong>api</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Select which api version of the dict to return (default 1)</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Details about the build</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a> or <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.8)">None</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
2019-10-16 23:14:02 +00:00
<p>Returns the same dict as <cite>compose_detail()</cite></p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.queue.uuid_tar">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.queue.</code><code class="sig-name descname">uuid_tar</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">cfg</span></em>, <em class="sig-param"><span class="n">uuid</span></em>, <em class="sig-param"><span class="n">metadata</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">image</span><span class="o">=</span><span class="default_value">False</span></em>, <em class="sig-param"><span class="n">logs</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/queue.html#uuid_tar"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.queue.uuid_tar" title="Permalink to this definition"></a></dt>
<dd><p>Return a tar of the build data</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cfg</strong> (<a class="reference internal" href="#pylorax.api.config.ComposerConfig" title="pylorax.api.config.ComposerConfig"><em>ComposerConfig</em></a>) -- Configuration settings</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>uuid</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The UUID of the build</p></li>
<li><p><strong>metadata</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.8)"><em>bool</em></a>) -- Set to true to include all the metadata needed to reproduce the build</p></li>
<li><p><strong>image</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.8)"><em>bool</em></a>) -- Set to true to include the output image</p></li>
<li><p><strong>logs</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.8)"><em>bool</em></a>) -- Set to true to include the logs from the build</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A stream of bytes from tar</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>A generator</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>RuntimeError if there was a problem (eg. missing config file)</p>
</dd>
</dl>
<p>This yields an uncompressed tar's data to the caller. It includes
the selected data to the caller by returning the Popen stdout from the tar process.</p>
</dd></dl>
</div>
<div class="section" id="module-pylorax.api.recipes">
<span id="pylorax-api-recipes-module"></span><h2>pylorax.api.recipes module<a class="headerlink" href="#module-pylorax.api.recipes" title="Permalink to this headline"></a></h2>
2020-10-07 17:56:09 +00:00
<dl class="py class">
<dt id="pylorax.api.recipes.CommitDetails">
2020-10-07 17:56:09 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">CommitDetails</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">commit</span></em>, <em class="sig-param"><span class="n">timestamp</span></em>, <em class="sig-param"><span class="n">message</span></em>, <em class="sig-param"><span class="n">revision</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#CommitDetails"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.CommitDetails" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="pylorax.html#pylorax.base.DataHolder" title="pylorax.base.DataHolder"><code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.base.DataHolder</span></code></a></p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py exception">
<dt id="pylorax.api.recipes.CommitTimeValError">
2019-07-30 22:48:40 +00:00
<em class="property">exception </em><code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">CommitTimeValError</code><a class="reference internal" href="_modules/pylorax/api/recipes.html#CommitTimeValError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.CommitTimeValError" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#Exception" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></a></p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.recipes.NewRecipeGit">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">NewRecipeGit</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">toml_dict</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#NewRecipeGit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.NewRecipeGit" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Create a RecipeGit object from fields in a TOML dict</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
2019-10-16 23:14:02 +00:00
<li><p><strong>rpmname</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Name of the rpm to create, also used as the prefix name in the tar archive</p></li>
<li><p><strong>rpmversion</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Version of the rpm, eg. &quot;1.0.0&quot;</p></li>
<li><p><strong>rpmrelease</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Release of the rpm, eg. &quot;1&quot;</p></li>
<li><p><strong>summary</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Summary string for the rpm</p></li>
<li><p><strong>repo</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- URL of the get repo to clone and create the archive from</p></li>
<li><p><strong>ref</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Git reference to check out. eg. origin/branch-name, git tag, or git commit hash</p></li>
<li><p><strong>destination</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path to install the / of the git repo at when installing the rpm</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A populated RecipeGit object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#pylorax.api.recipes.RecipeGit" title="pylorax.api.recipes.RecipeGit">RecipeGit</a></p>
</dd>
</dl>
<p>The TOML should look like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">[[</span><span class="n">repos</span><span class="o">.</span><span class="n">git</span><span class="p">]]</span>
<span class="n">rpmname</span><span class="o">=</span><span class="s2">&quot;server-config&quot;</span>
<span class="n">rpmversion</span><span class="o">=</span><span class="s2">&quot;1.0&quot;</span>
<span class="n">rpmrelease</span><span class="o">=</span><span class="s2">&quot;1&quot;</span>
<span class="n">summary</span><span class="o">=</span><span class="s2">&quot;Setup files for server deployment&quot;</span>
<span class="n">repo</span><span class="o">=</span><span class="s2">&quot;PATH OF GIT REPO TO CLONE&quot;</span>
<span class="n">ref</span><span class="o">=</span><span class="s2">&quot;v1.0&quot;</span>
<span class="n">destination</span><span class="o">=</span><span class="s2">&quot;/opt/server/&quot;</span>
</pre></div>
</div>
<p>Note that the repo path supports anything that git supports, <a class="reference external" href="file://">file://</a>, <a class="reference external" href="https://">https://</a>, <a class="reference external" href="http://">http://</a></p>
<p>Currently there is no support for authentication</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py class">
<dt id="pylorax.api.recipes.Recipe">
2020-10-07 17:56:09 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">Recipe</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">name</span></em>, <em class="sig-param"><span class="n">description</span></em>, <em class="sig-param"><span class="n">version</span></em>, <em class="sig-param"><span class="n">modules</span></em>, <em class="sig-param"><span class="n">packages</span></em>, <em class="sig-param"><span class="n">groups</span></em>, <em class="sig-param"><span class="n">customizations</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">gitrepos</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#Recipe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.Recipe" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a></p>
<p>A Recipe of package and modules</p>
<p>This is a subclass of dict that enforces the constructor arguments
2019-03-27 23:44:17 +00:00
and adds a .filename property to return the recipe's filename,
and a .toml() function to return the recipe as a TOML string.</p>
2020-10-07 17:56:09 +00:00
<dl class="py method">
<dt id="pylorax.api.recipes.Recipe.bump_version">
2020-10-07 17:56:09 +00:00
<code class="sig-name descname">bump_version</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">old_version</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#Recipe.bump_version"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.Recipe.bump_version" title="Permalink to this definition"></a></dt>
<dd><p>semver recipe version number bump</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>old_version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- An optional old version number</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The new version number or None</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>ValueError</p>
</dd>
</dl>
<p>If neither have a version, 0.0.1 is returned
If there is no old version the new version is checked and returned
If there is no new version, but there is a old one, bump its patch level
If the old and new versions are the same, bump the patch level
If they are different, check and return the new version</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py method">
<dt id="pylorax.api.recipes.Recipe.filename">
2019-07-30 22:48:40 +00:00
<em class="property">property </em><code class="sig-name descname">filename</code><a class="headerlink" href="#pylorax.api.recipes.Recipe.filename" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Return the Recipe's filename</p>
<p>Replaces spaces in the name with '-' and appends .toml</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py method">
<dt id="pylorax.api.recipes.Recipe.freeze">
2020-10-07 17:56:09 +00:00
<code class="sig-name descname">freeze</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">deps</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#Recipe.freeze"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.Recipe.freeze" title="Permalink to this definition"></a></dt>
<dd><p>Return a new Recipe with full module and package NEVRA</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>deps</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)"><em>list</em></a><em>(</em>) -- A list of dependency NEVRA to use to fill in the modules and packages</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A new Recipe object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe">Recipe</a></p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py method">
2018-08-13 23:44:47 +00:00
<dt id="pylorax.api.recipes.Recipe.group_names">
2019-07-30 22:48:40 +00:00
<em class="property">property </em><code class="sig-name descname">group_names</code><a class="headerlink" href="#pylorax.api.recipes.Recipe.group_names" title="Permalink to this definition"></a></dt>
2018-08-13 23:44:47 +00:00
<dd><p>Return the names of the groups. Groups do not have versions.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py method">
<dt id="pylorax.api.recipes.Recipe.module_names">
2019-07-30 22:48:40 +00:00
<em class="property">property </em><code class="sig-name descname">module_names</code><a class="headerlink" href="#pylorax.api.recipes.Recipe.module_names" title="Permalink to this definition"></a></dt>
<dd><p>Return the names of the modules</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py method">
2018-06-04 23:34:57 +00:00
<dt id="pylorax.api.recipes.Recipe.module_nver">
2019-07-30 22:48:40 +00:00
<em class="property">property </em><code class="sig-name descname">module_nver</code><a class="headerlink" href="#pylorax.api.recipes.Recipe.module_nver" title="Permalink to this definition"></a></dt>
2018-06-04 23:34:57 +00:00
<dd><p>Return the names and version globs of the modules</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py method">
<dt id="pylorax.api.recipes.Recipe.package_names">
2019-07-30 22:48:40 +00:00
<em class="property">property </em><code class="sig-name descname">package_names</code><a class="headerlink" href="#pylorax.api.recipes.Recipe.package_names" title="Permalink to this definition"></a></dt>
<dd><p>Return the names of the packages</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py method">
2018-06-04 23:34:57 +00:00
<dt id="pylorax.api.recipes.Recipe.package_nver">
2019-07-30 22:48:40 +00:00
<em class="property">property </em><code class="sig-name descname">package_nver</code><a class="headerlink" href="#pylorax.api.recipes.Recipe.package_nver" title="Permalink to this definition"></a></dt>
2018-06-04 23:34:57 +00:00
<dd><p>Return the names and version globs of the packages</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py method">
<dt id="pylorax.api.recipes.Recipe.toml">
2019-07-30 22:48:40 +00:00
<code class="sig-name descname">toml</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#Recipe.toml"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.Recipe.toml" title="Permalink to this definition"></a></dt>
<dd><p>Return the Recipe in TOML format</p>
</dd></dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py exception">
<dt id="pylorax.api.recipes.RecipeError">
2019-07-30 22:48:40 +00:00
<em class="property">exception </em><code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">RecipeError</code><a class="reference internal" href="_modules/pylorax/api/recipes.html#RecipeError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.RecipeError" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#Exception" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></a></p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py exception">
<dt id="pylorax.api.recipes.RecipeFileError">
2019-07-30 22:48:40 +00:00
<em class="property">exception </em><code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">RecipeFileError</code><a class="reference internal" href="_modules/pylorax/api/recipes.html#RecipeFileError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.RecipeFileError" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#Exception" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></a></p>
2018-08-13 23:44:47 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py class">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.recipes.RecipeGit">
2020-10-07 17:56:09 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">RecipeGit</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">rpmname</span></em>, <em class="sig-param"><span class="n">rpmversion</span></em>, <em class="sig-param"><span class="n">rpmrelease</span></em>, <em class="sig-param"><span class="n">summary</span></em>, <em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">ref</span></em>, <em class="sig-param"><span class="n">destination</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#RecipeGit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.RecipeGit" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a></p>
2019-03-27 23:44:17 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py class">
2018-08-13 23:44:47 +00:00
<dt id="pylorax.api.recipes.RecipeGroup">
2020-10-07 17:56:09 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">RecipeGroup</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">name</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#RecipeGroup"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.RecipeGroup" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a></p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py class">
<dt id="pylorax.api.recipes.RecipeModule">
2020-10-07 17:56:09 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">RecipeModule</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">name</span></em>, <em class="sig-param"><span class="n">version</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#RecipeModule"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.RecipeModule" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">dict</span></code></a></p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py class">
<dt id="pylorax.api.recipes.RecipePackage">
2020-10-07 17:56:09 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">RecipePackage</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">name</span></em>, <em class="sig-param"><span class="n">version</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#RecipePackage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.RecipePackage" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pylorax.api.recipes.RecipeModule" title="pylorax.api.recipes.RecipeModule"><code class="xref py py-class docutils literal notranslate"><span class="pre">pylorax.api.recipes.RecipeModule</span></code></a></p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-07-30 22:48:40 +00:00
<dt id="pylorax.api.recipes.check_list_case">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">check_list_case</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">expected_keys</span></em>, <em class="sig-param"><span class="n">recipe_keys</span></em>, <em class="sig-param"><span class="n">prefix</span><span class="o">=</span><span class="default_value">''</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#check_list_case"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.check_list_case" title="Permalink to this definition"></a></dt>
2019-07-30 22:48:40 +00:00
<dd><p>Check the case of the recipe keys</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>expected_keys</strong> (<em>list of str</em>) -- A list of expected key strings</p></li>
<li><p><strong>recipe_keys</strong> (<em>list of str</em>) -- A list of the recipe's key strings</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>list of errors</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list of str</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-07-30 22:48:40 +00:00
<dt id="pylorax.api.recipes.check_recipe_dict">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">check_recipe_dict</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">recipe_dict</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#check_recipe_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.check_recipe_dict" title="Permalink to this definition"></a></dt>
2019-07-30 22:48:40 +00:00
<dd><p>Check a dict before using it to create a new Recipe</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>recipe_dict</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><em>dict</em></a>) -- A plain dict of the recipe</p>
2019-07-30 22:48:40 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True if dict is ok</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.8)">bool</a></p>
2019-07-30 22:48:40 +00:00
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>RecipeError</p>
</dd>
</dl>
<p>This checks a dict to make sure required fields are present,
that optional fields are correct, and that other optional fields
are of the correct format, when included.</p>
<p>This collects all of the errors and returns a single RecipeError with
a string that can be presented to users.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-07-30 22:48:40 +00:00
<dt id="pylorax.api.recipes.check_required_list">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">check_required_list</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">lst</span></em>, <em class="sig-param"><span class="n">fields</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#check_required_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.check_required_list" title="Permalink to this definition"></a></dt>
2019-07-30 22:48:40 +00:00
<dd><p>Check a list of dicts for required fields</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>lst</strong> (<em>list of dict</em>) -- A list of dicts with fields</p></li>
<li><p><strong>fields</strong> (<em>list of str</em>) -- A list of field name strings</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A list of error strings</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list of str</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.commit_recipe">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">commit_recipe</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">recipe</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#commit_recipe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.commit_recipe" title="Permalink to this definition"></a></dt>
<dd><p>Commit a recipe to a branch</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
2019-03-27 23:44:17 +00:00
<li><p><strong>recipe</strong> (<a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe"><em>Recipe</em></a>) -- Recipe to commit</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>OId of the new commit</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>Git.OId</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.commit_recipe_directory">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">commit_recipe_directory</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">directory</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#commit_recipe_directory"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.commit_recipe_directory" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Commit all *.toml files from a directory, if they aren't already in git.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>directory</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The directory of *.toml recipes to commit</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>None</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p>Can raise errors from Ggit or RecipeFileError</p>
</dd>
</dl>
<p>Files with Toml or RecipeFileErrors will be skipped, and the remainder will
be tried.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.commit_recipe_file">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">commit_recipe_file</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">filename</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#commit_recipe_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.commit_recipe_file" title="Permalink to this definition"></a></dt>
<dd><p>Commit a recipe file to a branch</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path to the recipe file to commit</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>OId of the new commit</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>Git.OId</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit or RecipeFileError</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.recipes.customizations_diff">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">customizations_diff</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">old_recipe</span></em>, <em class="sig-param"><span class="n">new_recipe</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#customizations_diff"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.customizations_diff" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Diff the customizations sections from two versions of a recipe</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.delete_file">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">delete_file</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">filename</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#delete_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.delete_file" title="Permalink to this definition"></a></dt>
<dd><p>Delete a file from a branch.</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- filename to delete</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>OId of the new commit</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>Git.OId</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.delete_recipe">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">delete_recipe</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">recipe_name</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#delete_recipe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.delete_recipe" title="Permalink to this definition"></a></dt>
<dd><p>Delete a recipe from a branch.</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>recipe_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Recipe name to delete</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>OId of the new commit</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>Git.OId</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.recipes.diff_lists">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">diff_lists</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">title</span></em>, <em class="sig-param"><span class="n">field</span></em>, <em class="sig-param"><span class="n">old_items</span></em>, <em class="sig-param"><span class="n">new_items</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#diff_lists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.diff_lists" title="Permalink to this definition"></a></dt>
<dd><p>Return the differences between two lists of dicts.</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
2019-10-16 23:14:02 +00:00
<li><p><strong>title</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Title of the entry</p></li>
<li><p><strong>field</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Field to use as the key for comparisons</p></li>
<li><p><strong>old_items</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)"><em>list</em></a><em>(</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><em>dict</em></a><em>)</em>) -- List of item dicts with &quot;name&quot; field</p></li>
<li><p><strong>new_items</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)"><em>list</em></a><em>(</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><em>dict</em></a><em>)</em>) -- List of item dicts with &quot;name&quot; field</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>List of diff dicts with old/new entries</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)">list</a>(<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a>)</p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.find_commit_tag">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">find_commit_tag</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">filename</span></em>, <em class="sig-param"><span class="n">commit_id</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#find_commit_tag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.find_commit_tag" title="Permalink to this definition"></a></dt>
<dd><p>Find the tag that matches the commit_id</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- filename to revert</p></li>
2019-03-27 23:44:17 +00:00
<li><p><strong>commit_id</strong> (<em>Git.OId</em>) -- The commit id to check</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The tag or None if there isn't one</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a> or <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.8)">None</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
<p>There should be only 1 tag pointing to a commit, but there may not
be a tag at all.</p>
2019-03-27 23:44:17 +00:00
<p>The tag will look like: 'refs/tags/&lt;branch&gt;/&lt;filename&gt;/r&lt;revision&gt;'</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.recipes.find_field_value">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">find_field_value</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">field</span></em>, <em class="sig-param"><span class="n">value</span></em>, <em class="sig-param"><span class="n">lst</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#find_field_value"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.find_field_value" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Find a field matching value in the list of dicts.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
2019-10-16 23:14:02 +00:00
<li><p><strong>field</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- field to search for</p></li>
<li><p><strong>value</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- value to match in the field</p></li>
2019-06-18 22:08:20 +00:00
<li><p><strong>lst</strong> (<em>list of dict</em>) -- List of dict's with field</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>First dict with matching field:value, or None</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a> or <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.8)">None</a></p>
2019-06-18 22:08:20 +00:00
</dd>
</dl>
<p>Used to return a specific entry from a list that looks like this:</p>
<p>[{&quot;name&quot;: &quot;one&quot;, &quot;attr&quot;: &quot;green&quot;}, ...]</p>
<p>find_field_value(&quot;name&quot;, &quot;one&quot;, lst) will return the matching dict.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.find_name">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">find_name</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">name</span></em>, <em class="sig-param"><span class="n">lst</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#find_name"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.find_name" title="Permalink to this definition"></a></dt>
<dd><p>Find the dict matching the name in a list and return it.</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
2019-10-16 23:14:02 +00:00
<li><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Name to search for</p></li>
2019-06-18 22:08:20 +00:00
<li><p><strong>lst</strong> (<em>list of dict</em>) -- List of dict's with &quot;name&quot; field</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>First dict with matching name, or None</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a> or <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.8)">None</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
2019-06-18 22:08:20 +00:00
<p>This is just a wrapper for find_field_value with field set to &quot;name&quot;</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.recipes.find_recipe_obj">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">find_recipe_obj</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">path</span></em>, <em class="sig-param"><span class="n">recipe</span></em>, <em class="sig-param"><span class="n">default</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#find_recipe_obj"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.find_recipe_obj" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Find a recipe object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> (<em>list of str</em>) -- A list of dict field names</p></li>
<li><p><strong>recipe</strong> (<a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe"><em>Recipe</em></a>) -- The recipe to search</p></li>
<li><p><strong>default</strong> (<em>Any</em>) -- The value to return if it is not found</p></li>
</ul>
</dd>
</dl>
<p>Return the object found by applying the path to the dicts in the recipe, or
return the default if it doesn't exist.</p>
<p>eg. {&quot;customizations&quot;: {&quot;hostname&quot;: &quot;foo&quot;, &quot;users&quot;: [...]}}</p>
<p>find_recipe_obj([&quot;customizations&quot;, &quot;hostname&quot;], recipe, &quot;&quot;)</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.get_commit_details">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">get_commit_details</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">commit</span></em>, <em class="sig-param"><span class="n">revision</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#get_commit_details"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.get_commit_details" title="Permalink to this definition"></a></dt>
<dd><p>Return the details about a specific commit.</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>commit</strong> (<em>Git.Commit</em>) -- The commit to get details from</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>revision</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Optional commit revision</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Details about the commit</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#pylorax.api.recipes.CommitDetails" title="pylorax.api.recipes.CommitDetails">CommitDetails</a></p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>CommitTimeValError or Ggit exceptions</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.get_revision_from_tag">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">get_revision_from_tag</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">tag</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#get_revision_from_tag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.get_revision_from_tag" title="Permalink to this definition"></a></dt>
<dd><p>Return the revision number from a tag</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>tag</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The tag to exract the revision from</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The integer revision or None</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)">int</a> or <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.8)">None</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
<p>The revision is the part after the r in 'branch/filename/rXXX'</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.gfile">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">gfile</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">path</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#gfile"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.gfile" title="Permalink to this definition"></a></dt>
<dd><p>Convert a string path to GFile for use with Git</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.head_commit">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">head_commit</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#head_commit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.head_commit" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Get the branch's HEAD Commit Object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Branch's head commit</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>Git.Commit</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.is_commit_tag">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">is_commit_tag</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">commit_id</span></em>, <em class="sig-param"><span class="n">tag</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#is_commit_tag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.is_commit_tag" title="Permalink to this definition"></a></dt>
<dd><p>Check to see if a tag points to a specific commit.</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
<li><p><strong>commit_id</strong> (<em>Git.OId</em>) -- The commit id to check</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>tag</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The tag to check</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True if the tag points to the commit, False otherwise</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.8)">bool</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.is_parent_diff">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">is_parent_diff</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">filename</span></em>, <em class="sig-param"><span class="n">tree</span></em>, <em class="sig-param"><span class="n">parent</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#is_parent_diff"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.is_parent_diff" title="Permalink to this definition"></a></dt>
<dd><p>Check to see if the commit is different from its parents</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- filename to revert</p></li>
2019-03-27 23:44:17 +00:00
<li><p><strong>tree</strong> (<em>Git.Tree</em>) -- The commit's tree</p></li>
<li><p><strong>parent</strong> (<em>Git.Commit</em>) -- The commit's parent commit</p></li>
</ul>
</dd>
<dt class="field-even">Retuns</dt>
<dd class="field-even"><p>True if filename in the commit is different from its parents</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.8)">bool</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.list_branch_files">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">list_branch_files</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#list_branch_files"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.list_branch_files" title="Permalink to this definition"></a></dt>
<dd><p>Return a sorted list of the files on the branch HEAD</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A sorted list of the filenames</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)">list</a>(<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a>)</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.list_commit_files">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">list_commit_files</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">commit</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#list_commit_files"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.list_commit_files" title="Permalink to this definition"></a></dt>
<dd><p>Return a sorted list of the files on a commit</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>commit</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The commit hash to list</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A sorted list of the filenames</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)">list</a>(<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a>)</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.list_commits">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">list_commits</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">filename</span></em>, <em class="sig-param"><span class="n">limit</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#list_commits"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.list_commits" title="Permalink to this definition"></a></dt>
<dd><p>List the commit history of a file on a branch.</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- filename to revert</p></li>
<li><p><strong>limit</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- Number of commits to return (0=all)</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A list of commit details</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)">list</a>(<a class="reference internal" href="#pylorax.api.recipes.CommitDetails" title="pylorax.api.recipes.CommitDetails">CommitDetails</a>)</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.open_or_create_repo">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">open_or_create_repo</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">path</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#open_or_create_repo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.open_or_create_repo" title="Permalink to this definition"></a></dt>
<dd><p>Open an existing repo, or create a new one</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>path</strong> (<em>string</em>) -- path to recipe directory</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A repository object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>Git.Repository</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit</p>
</dd>
</dl>
<p>A bare git repo will be created in the git directory of the specified path.
If a repo already exists it will be opened and returned instead of
creating a new one.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.prepare_commit">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">prepare_commit</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">builder</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#prepare_commit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.prepare_commit" title="Permalink to this definition"></a></dt>
<dd><p>Prepare for a commit</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
2019-03-27 23:44:17 +00:00
<li><p><strong>builder</strong> (<a class="reference internal" href="pylorax.html#pylorax.treebuilder.TreeBuilder" title="pylorax.treebuilder.TreeBuilder"><em>TreeBuilder</em></a>) -- instance of TreeBuilder</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>(Tree, Sig, Ref)</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.8)">tuple</a></p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.read_commit">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">read_commit</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">filename</span></em>, <em class="sig-param"><span class="n">commit</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#read_commit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.read_commit" title="Permalink to this definition"></a></dt>
<dd><p>Return the contents of a file on a specific branch or commit.</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- filename to read</p></li>
<li><p><strong>commit</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Optional commit hash</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The commit id, and the contents of the commit</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.8)">tuple</a>(<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a>, <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a>)</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit</p>
</dd>
</dl>
<p>If no commit is passed the master:filename is returned, otherwise it will be
commit:filename</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.read_commit_spec">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">read_commit_spec</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">spec</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#read_commit_spec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.read_commit_spec" title="Permalink to this definition"></a></dt>
<dd><p>Return the raw content of the blob specified by the spec</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>spec</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Git revparse spec</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Contents of the commit</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit</p>
</dd>
</dl>
<p>eg. To read the README file from master the spec is &quot;master:README&quot;</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.read_recipe_and_id">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">read_recipe_and_id</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">recipe_name</span></em>, <em class="sig-param"><span class="n">commit</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#read_recipe_and_id"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.read_recipe_and_id" title="Permalink to this definition"></a></dt>
<dd><p>Read a recipe commit and its id from git</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>recipe_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Recipe name to read</p></li>
<li><p><strong>commit</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Optional commit hash</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The commit id, and a Recipe object</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.8)">tuple</a>(<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a>, <a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe">Recipe</a>)</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit</p>
</dd>
</dl>
<p>If no commit is passed the master:filename is returned, otherwise it will be
commit:filename</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.read_recipe_commit">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">read_recipe_commit</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">recipe_name</span></em>, <em class="sig-param"><span class="n">commit</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#read_recipe_commit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.read_recipe_commit" title="Permalink to this definition"></a></dt>
<dd><p>Read a recipe commit from git and return a Recipe object</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>recipe_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Recipe name to read</p></li>
<li><p><strong>commit</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Optional commit hash</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A Recipe object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe">Recipe</a></p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit</p>
</dd>
</dl>
<p>If no commit is passed the master:filename is returned, otherwise it will be
commit:filename</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.recipe_diff">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">recipe_diff</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">old_recipe</span></em>, <em class="sig-param"><span class="n">new_recipe</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#recipe_diff"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.recipe_diff" title="Permalink to this definition"></a></dt>
<dd><p>Diff two versions of a recipe</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>old_recipe</strong> (<a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe"><em>Recipe</em></a>) -- The old version of the recipe</p></li>
<li><p><strong>new_recipe</strong> (<a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe"><em>Recipe</em></a>) -- The new version of the recipe</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A list of diff dict entries with old/new</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.8)">list</a>(<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)">dict</a>)</p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.recipe_filename">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">recipe_filename</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">name</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#recipe_filename"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.recipe_filename" title="Permalink to this definition"></a></dt>
<dd><p>Return the toml filename for a recipe</p>
2019-03-27 23:44:17 +00:00
<p>Replaces spaces with '-' and appends '.toml'</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.recipe_from_dict">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">recipe_from_dict</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">recipe_dict</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#recipe_from_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.recipe_from_dict" title="Permalink to this definition"></a></dt>
<dd><p>Create a Recipe object from a plain dict.</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>recipe_dict</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.8)"><em>dict</em></a>) -- A plain dict of the recipe</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A Recipe object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe">Recipe</a></p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>RecipeError</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.recipe_from_file">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">recipe_from_file</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">recipe_path</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#recipe_from_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.recipe_from_file" title="Permalink to this definition"></a></dt>
<dd><p>Return a recipe file as a Recipe object</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>recipe_path</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Path to the recipe fila</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A Recipe object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe">Recipe</a></p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.recipe_from_toml">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">recipe_from_toml</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">recipe_str</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#recipe_from_toml"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.recipe_from_toml" title="Permalink to this definition"></a></dt>
<dd><p>Create a Recipe object from a toml string.</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><strong>recipe_str</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The Recipe TOML string</p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A Recipe object</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe">Recipe</a></p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>TomlError</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-03-27 23:44:17 +00:00
<dt id="pylorax.api.recipes.repo_file_exists">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">repo_file_exists</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">filename</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#repo_file_exists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.repo_file_exists" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Return True if the filename exists on the branch</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Filename to check</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True if the filename exists on the HEAD of the branch, False otherwise.</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.8)">bool</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.revert_file">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">revert_file</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">filename</span></em>, <em class="sig-param"><span class="n">commit</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#revert_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.revert_file" title="Permalink to this definition"></a></dt>
<dd><p>Revert the contents of a file to that of a previous commit</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- filename to revert</p></li>
<li><p><strong>commit</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Commit hash</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>OId of the new commit</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>Git.OId</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.revert_recipe">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">revert_recipe</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">recipe_name</span></em>, <em class="sig-param"><span class="n">commit</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#revert_recipe"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.revert_recipe" title="Permalink to this definition"></a></dt>
<dd><p>Revert the contents of a recipe to that of a previous commit</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>recipe_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Recipe name to revert</p></li>
<li><p><strong>commit</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Commit hash</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>OId of the new commit</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>Git.OId</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.tag_file_commit">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">tag_file_commit</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">filename</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#tag_file_commit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.tag_file_commit" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Tag a file's most recent commit</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Filename to tag</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Tag id or None if it failed.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>Git.OId</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit</p>
</dd>
</dl>
<p>This uses git tags, of the form <cite>refs/tags/&lt;branch&gt;/&lt;filename&gt;/r&lt;revision&gt;</cite>
Only the most recent recipe commit can be tagged to prevent out of order tagging.
Revisions start at 1 and increment for each new commit that is tagged.
If the commit has already been tagged it will return false.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.tag_recipe_commit">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">tag_recipe_commit</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">recipe_name</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#tag_recipe_commit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.tag_recipe_commit" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Tag a file's most recent commit</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>recipe_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Recipe name to tag</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Tag id or None if it failed.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>Git.OId</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit</p>
</dd>
</dl>
<p>Uses tag_file_commit()</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.recipes.write_commit">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.recipes.</code><code class="sig-name descname">write_commit</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">filename</span></em>, <em class="sig-param"><span class="n">message</span></em>, <em class="sig-param"><span class="n">content</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/recipes.html#write_commit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.recipes.write_commit" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Make a new commit to a repository's branch</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>filename</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- full path of the file to add</p></li>
<li><p><strong>message</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The commit message</p></li>
<li><p><strong>content</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The data to write</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>OId of the new commit</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>Git.OId</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>Can raise errors from Ggit</p>
</dd>
</dl>
</dd></dl>
2018-08-13 23:44:47 +00:00
</div>
<div class="section" id="module-pylorax.api.regexes">
<span id="pylorax-api-regexes-module"></span><h2>pylorax.api.regexes module<a class="headerlink" href="#module-pylorax.api.regexes" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="module-pylorax.api.server">
<span id="pylorax-api-server-module"></span><h2>pylorax.api.server module<a class="headerlink" href="#module-pylorax.api.server" title="Permalink to this headline"></a></h2>
2020-10-07 17:56:09 +00:00
<dl class="py class">
<dt id="pylorax.api.server.GitLock">
2020-10-07 17:56:09 +00:00
<em class="property">class </em><code class="sig-prename descclassname">pylorax.api.server.</code><code class="sig-name descname">GitLock</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">lock</span></em>, <em class="sig-param"><span class="n">dir</span></em><span class="sig-paren">)</span><a class="headerlink" href="#pylorax.api.server.GitLock" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">tuple</span></code></a></p>
2020-10-07 17:56:09 +00:00
<dl class="py attribute">
<dt id="pylorax.api.server.GitLock.dir">
2020-10-07 17:56:09 +00:00
<code class="sig-name descname">dir</code><a class="headerlink" href="#pylorax.api.server.GitLock.dir" title="Permalink to this definition"></a></dt>
<dd><p>Alias for field number 2</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py attribute">
<dt id="pylorax.api.server.GitLock.lock">
2020-10-07 17:56:09 +00:00
<code class="sig-name descname">lock</code><a class="headerlink" href="#pylorax.api.server.GitLock.lock" title="Permalink to this definition"></a></dt>
<dd><p>Alias for field number 1</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py attribute">
<dt id="pylorax.api.server.GitLock.repo">
2020-10-07 17:56:09 +00:00
<code class="sig-name descname">repo</code><a class="headerlink" href="#pylorax.api.server.GitLock.repo" title="Permalink to this definition"></a></dt>
<dd><p>Alias for field number 0</p>
</dd></dl>
</dd></dl>
2018-08-13 23:44:47 +00:00
</div>
<div class="section" id="module-pylorax.api.timestamp">
<span id="pylorax-api-timestamp-module"></span><h2>pylorax.api.timestamp module<a class="headerlink" href="#module-pylorax.api.timestamp" title="Permalink to this headline"></a></h2>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2018-08-13 23:44:47 +00:00
<dt id="pylorax.api.timestamp.timestamp_dict">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.timestamp.</code><code class="sig-name descname">timestamp_dict</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">destdir</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/timestamp.html#timestamp_dict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.timestamp.timestamp_dict" title="Permalink to this definition"></a></dt>
2018-08-13 23:44:47 +00:00
<dd></dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2018-08-13 23:44:47 +00:00
<dt id="pylorax.api.timestamp.write_timestamp">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.timestamp.</code><code class="sig-name descname">write_timestamp</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">destdir</span></em>, <em class="sig-param"><span class="n">ty</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/timestamp.html#write_timestamp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.timestamp.write_timestamp" title="Permalink to this definition"></a></dt>
2018-08-13 23:44:47 +00:00
<dd></dd></dl>
2019-06-18 22:08:20 +00:00
</div>
<div class="section" id="module-pylorax.api.toml">
<span id="pylorax-api-toml-module"></span><h2>pylorax.api.toml module<a class="headerlink" href="#module-pylorax.api.toml" title="Permalink to this headline"></a></h2>
2020-10-07 17:56:09 +00:00
<dl class="py exception">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.toml.TomlError">
2020-10-07 17:56:09 +00:00
<em class="property">exception </em><code class="sig-prename descclassname">pylorax.api.toml.</code><code class="sig-name descname">TomlError</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">msg</span></em>, <em class="sig-param"><span class="n">doc</span></em>, <em class="sig-param"><span class="n">pos</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/toml.html#TomlError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.toml.TomlError" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">toml.decoder.TomlDecodeError</span></code></p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.toml.dump">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.toml.</code><code class="sig-name descname">dump</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">o</span></em>, <em class="sig-param"><span class="n">file</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/toml.html#dump"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.toml.dump" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd></dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.toml.dumps">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.toml.</code><code class="sig-name descname">dumps</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">o</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/toml.html#dumps"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.toml.dumps" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd></dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.toml.load">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.toml.</code><code class="sig-name descname">load</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">file</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/toml.html#load"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.toml.load" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd></dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.toml.loads">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.toml.</code><code class="sig-name descname">loads</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">s</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/toml.html#loads"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.toml.loads" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd></dd></dl>
2019-10-16 23:14:02 +00:00
</div>
<div class="section" id="module-pylorax.api.utils">
<span id="pylorax-api-utils-module"></span><h2>pylorax.api.utils module<a class="headerlink" href="#module-pylorax.api.utils" title="Permalink to this headline"></a></h2>
<p>API utility functions</p>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.utils.blueprint_exists">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.utils.</code><code class="sig-name descname">blueprint_exists</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">api</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">blueprint_name</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/utils.html#blueprint_exists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.utils.blueprint_exists" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Return True if the blueprint exists</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>api</strong> (<em>Flask</em>) -- flask object</p></li>
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>recipe_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Recipe name to read</p></li>
</ul>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.utils.take_limits">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.utils.</code><code class="sig-name descname">take_limits</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">iterable</span></em>, <em class="sig-param"><span class="n">offset</span></em>, <em class="sig-param"><span class="n">limit</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/utils.html#take_limits"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.utils.take_limits" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Apply offset and limit to an iterable object</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>iterable</strong> (<em>iter</em>) -- The object to limit</p></li>
<li><p><strong>offset</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- The number of items to skip</p></li>
<li><p><strong>limit</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.8)"><em>int</em></a>) -- The total number of items to return</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A subset of the iterable</p>
</dd>
</dl>
</dd></dl>
</div>
<div class="section" id="module-pylorax.api.v0">
<span id="pylorax-api-v0-module"></span><h2>pylorax.api.v0 module<a class="headerlink" href="#module-pylorax.api.v0" title="Permalink to this headline"></a></h2>
<p>Setup v0 of the API server</p>
<p>v0_api() must be called to setup the API routes for Flask</p>
<div class="section" id="status-responses">
<h3>Status Responses<a class="headerlink" href="#status-responses" title="Permalink to this headline"></a></h3>
<p>Some requests only return a status/error response.</p>
<blockquote>
<div><p>The response will be a status response with <cite>status</cite> set to true, or an
error response with it set to false and an error message included.</p>
<p>Example response:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="n">true</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Error response:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;errors&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;ggit-error: Failed to remove entry. File isn&#39;t in the tree - jboss.toml (-1)&quot;</span><span class="p">]</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="n">false</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</div>
<div class="section" id="api-routes">
<h3>API Routes<a class="headerlink" href="#api-routes" title="Permalink to this headline"></a></h3>
<p>All of the blueprints routes support the optional <cite>branch</cite> argument. If it is not
used then the API will use the <cite>master</cite> branch for blueprints. If you want to create
a new branch use the <cite>new</cite> or <cite>workspace</cite> routes with ?branch=&lt;branch-name&gt; to
store the new blueprint on the new branch.</p>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_blueprints_changes">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_blueprints_changes</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">blueprint_names</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_blueprints_changes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_blueprints_changes" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return the changes to a blueprint or list of blueprints</p>
<p><strong>/api/v0/blueprints/changes/&lt;blueprint_names&gt;[?offset=0&amp;limit=20]</strong></p>
<blockquote>
<div><p>Return the commits to a blueprint. By default it returns the first 20 commits, this
can be changed by passing <cite>offset</cite> and/or <cite>limit</cite>. The response will include the
commit hash, summary, timestamp, and optionally the revision number. The commit
hash can be passed to <cite>/api/v0/blueprints/diff/</cite> to retrieve the exact changes.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;errors&quot;</span><span class="p">:</span> <span class="p">[],</span>
<span class="s2">&quot;limit&quot;</span><span class="p">:</span> <span class="mi">20</span><span class="p">,</span>
<span class="s2">&quot;offset&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s2">&quot;blueprints&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;changes&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;commit&quot;</span><span class="p">:</span> <span class="s2">&quot;e083921a7ed1cf2eec91ad12b9ad1e70ef3470be&quot;</span><span class="p">,</span>
<span class="s2">&quot;message&quot;</span><span class="p">:</span> <span class="s2">&quot;blueprint glusterfs, version 0.0.6 saved.&quot;</span><span class="p">,</span>
<span class="s2">&quot;revision&quot;</span><span class="p">:</span> <span class="n">null</span><span class="p">,</span>
<span class="s2">&quot;timestamp&quot;</span><span class="p">:</span> <span class="s2">&quot;2017-11-23T00:18:13Z&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;commit&quot;</span><span class="p">:</span> <span class="s2">&quot;cee5f4c20fc33ea4d54bfecf56f4ad41ad15f4f3&quot;</span><span class="p">,</span>
<span class="s2">&quot;message&quot;</span><span class="p">:</span> <span class="s2">&quot;blueprint glusterfs, version 0.0.5 saved.&quot;</span><span class="p">,</span>
<span class="s2">&quot;revision&quot;</span><span class="p">:</span> <span class="n">null</span><span class="p">,</span>
<span class="s2">&quot;timestamp&quot;</span><span class="p">:</span> <span class="s2">&quot;2017-11-11T01:00:28Z&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;commit&quot;</span><span class="p">:</span> <span class="s2">&quot;29b492f26ed35d80800b536623bafc51e2f0eff2&quot;</span><span class="p">,</span>
<span class="s2">&quot;message&quot;</span><span class="p">:</span> <span class="s2">&quot;blueprint glusterfs, version 0.0.4 saved.&quot;</span><span class="p">,</span>
<span class="s2">&quot;revision&quot;</span><span class="p">:</span> <span class="n">null</span><span class="p">,</span>
<span class="s2">&quot;timestamp&quot;</span><span class="p">:</span> <span class="s2">&quot;2017-11-11T00:28:30Z&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;commit&quot;</span><span class="p">:</span> <span class="s2">&quot;03374adbf080fe34f5c6c29f2e49cc2b86958bf2&quot;</span><span class="p">,</span>
<span class="s2">&quot;message&quot;</span><span class="p">:</span> <span class="s2">&quot;blueprint glusterfs, version 0.0.3 saved.&quot;</span><span class="p">,</span>
<span class="s2">&quot;revision&quot;</span><span class="p">:</span> <span class="n">null</span><span class="p">,</span>
<span class="s2">&quot;timestamp&quot;</span><span class="p">:</span> <span class="s2">&quot;2017-11-10T23:15:52Z&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;commit&quot;</span><span class="p">:</span> <span class="s2">&quot;0e08ecbb708675bfabc82952599a1712a843779d&quot;</span><span class="p">,</span>
<span class="s2">&quot;message&quot;</span><span class="p">:</span> <span class="s2">&quot;blueprint glusterfs, version 0.0.2 saved.&quot;</span><span class="p">,</span>
<span class="s2">&quot;revision&quot;</span><span class="p">:</span> <span class="n">null</span><span class="p">,</span>
<span class="s2">&quot;timestamp&quot;</span><span class="p">:</span> <span class="s2">&quot;2017-11-10T23:14:56Z&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;commit&quot;</span><span class="p">:</span> <span class="s2">&quot;3e11eb87a63d289662cba4b1804a0947a6843379&quot;</span><span class="p">,</span>
<span class="s2">&quot;message&quot;</span><span class="p">:</span> <span class="s2">&quot;blueprint glusterfs, version 0.0.1 saved.&quot;</span><span class="p">,</span>
<span class="s2">&quot;revision&quot;</span><span class="p">:</span> <span class="n">null</span><span class="p">,</span>
<span class="s2">&quot;timestamp&quot;</span><span class="p">:</span> <span class="s2">&quot;2017-11-08T00:02:47Z&quot;</span>
<span class="p">}</span>
<span class="p">],</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs&quot;</span><span class="p">,</span>
<span class="s2">&quot;total&quot;</span><span class="p">:</span> <span class="mi">6</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
2019-06-18 22:08:20 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_blueprints_delete">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_blueprints_delete</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">blueprint_name</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_blueprints_delete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_blueprints_delete" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Delete a blueprint from git</p>
<p><strong>DELETE /api/v0/blueprints/delete/&lt;blueprint_name&gt;</strong></p>
<blockquote>
<div><p>Delete a blueprint. The blueprint is deleted from the branch, and will no longer
be listed by the <cite>list</cite> route. A blueprint can be undeleted using the <cite>undo</cite> route
2019-03-27 23:44:17 +00:00
to revert to a previous commit. This will also delete the workspace copy of the
blueprint.</p>
<p>The response will be a status response with <cite>status</cite> set to true, or an
error response with it set to false and an error message included.</p>
</div></blockquote>
2019-06-18 22:08:20 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_blueprints_delete_workspace">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_blueprints_delete_workspace</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">blueprint_name</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_blueprints_delete_workspace"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_blueprints_delete_workspace" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Delete a blueprint from the workspace</p>
<p><strong>DELETE /api/v0/blueprints/workspace/&lt;blueprint_name&gt;</strong></p>
<blockquote>
<div><p>Remove the temporary workspace copy of a blueprint. The <cite>info</cite> route will now
return the most recent commit of the blueprint. Any changes that were in the
workspace will be lost.</p>
<p>The response will be a status response with <cite>status</cite> set to true, or an
error response with it set to false and an error message included.</p>
</div></blockquote>
2019-06-18 22:08:20 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_blueprints_depsolve">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_blueprints_depsolve</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">blueprint_names</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_blueprints_depsolve"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_blueprints_depsolve" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return the dependencies for a blueprint</p>
<p><strong>/api/v0/blueprints/depsolve/&lt;blueprint_names&gt;</strong></p>
<blockquote>
2019-06-18 22:08:20 +00:00
<div><p>Depsolve the blueprint using yum, return the blueprint used, and the NEVRAs of the packages
chosen to satisfy the blueprint's requirements. The response will include a list of results,
with the full dependency list in <cite>dependencies</cite>, the NEVRAs for the blueprint's direct modules
and packages in <cite>modules</cite>, and any error will be in <cite>errors</cite>.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;errors&quot;</span><span class="p">:</span> <span class="p">[],</span>
<span class="s2">&quot;blueprints&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;dependencies&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;arch&quot;</span><span class="p">:</span> <span class="s2">&quot;noarch&quot;</span><span class="p">,</span>
<span class="s2">&quot;epoch&quot;</span><span class="p">:</span> <span class="s2">&quot;0&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;2ping&quot;</span><span class="p">,</span>
<span class="s2">&quot;release&quot;</span><span class="p">:</span> <span class="s2">&quot;2.el7&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;3.2.1&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;arch&quot;</span><span class="p">:</span> <span class="s2">&quot;x86_64&quot;</span><span class="p">,</span>
<span class="s2">&quot;epoch&quot;</span><span class="p">:</span> <span class="s2">&quot;0&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;acl&quot;</span><span class="p">,</span>
<span class="s2">&quot;release&quot;</span><span class="p">:</span> <span class="s2">&quot;12.el7&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;2.2.51&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;arch&quot;</span><span class="p">:</span> <span class="s2">&quot;x86_64&quot;</span><span class="p">,</span>
<span class="s2">&quot;epoch&quot;</span><span class="p">:</span> <span class="s2">&quot;0&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;audit-libs&quot;</span><span class="p">,</span>
<span class="s2">&quot;release&quot;</span><span class="p">:</span> <span class="s2">&quot;3.el7&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;2.7.6&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;arch&quot;</span><span class="p">:</span> <span class="s2">&quot;x86_64&quot;</span><span class="p">,</span>
<span class="s2">&quot;epoch&quot;</span><span class="p">:</span> <span class="s2">&quot;0&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;avahi-libs&quot;</span><span class="p">,</span>
<span class="s2">&quot;release&quot;</span><span class="p">:</span> <span class="s2">&quot;17.el7&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.6.31&quot;</span>
<span class="p">},</span>
<span class="o">...</span>
<span class="p">],</span>
<span class="s2">&quot;modules&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;arch&quot;</span><span class="p">:</span> <span class="s2">&quot;noarch&quot;</span><span class="p">,</span>
<span class="s2">&quot;epoch&quot;</span><span class="p">:</span> <span class="s2">&quot;0&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;2ping&quot;</span><span class="p">,</span>
<span class="s2">&quot;release&quot;</span><span class="p">:</span> <span class="s2">&quot;2.el7&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;3.2.1&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;arch&quot;</span><span class="p">:</span> <span class="s2">&quot;x86_64&quot;</span><span class="p">,</span>
<span class="s2">&quot;epoch&quot;</span><span class="p">:</span> <span class="s2">&quot;0&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs&quot;</span><span class="p">,</span>
<span class="s2">&quot;release&quot;</span><span class="p">:</span> <span class="s2">&quot;18.4.el7&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;3.8.4&quot;</span>
<span class="p">},</span>
<span class="o">...</span>
<span class="p">],</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;An example GlusterFS server with samba&quot;</span><span class="p">,</span>
<span class="s2">&quot;modules&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;3.7.*&quot;</span>
<span class="p">},</span>
<span class="o">...</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
2019-06-18 22:08:20 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_blueprints_diff">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_blueprints_diff</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">blueprint_name</span></em>, <em class="sig-param"><span class="n">from_commit</span></em>, <em class="sig-param"><span class="n">to_commit</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_blueprints_diff"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_blueprints_diff" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return the differences between two commits of a blueprint</p>
<p><strong>/api/v0/blueprints/diff/&lt;blueprint_name&gt;/&lt;from_commit&gt;/&lt;to_commit&gt;</strong></p>
<blockquote>
2019-06-18 22:08:20 +00:00
<div><p>Return the differences between two commits, or the workspace. The commit hash
from the <cite>changes</cite> response can be used here, or several special strings:</p>
<ul class="simple">
<li><p>NEWEST will select the newest git commit. This works for <cite>from_commit</cite> or <cite>to_commit</cite></p></li>
<li><p>WORKSPACE will select the workspace copy. This can only be used in <cite>to_commit</cite></p></li>
</ul>
<p>eg. <cite>/api/v0/blueprints/diff/glusterfs/NEWEST/WORKSPACE</cite> will return the differences
between the most recent git commit and the contents of the workspace.</p>
<p>Each entry in the response's diff object contains the old blueprint value and the new one.
If old is null and new is set, then it was added.
If new is null and old is set, then it was removed.
If both are set, then it was changed.</p>
<p>The old/new entries will have the name of the blueprint field that was changed. This
can be one of: Name, Description, Version, Module, or Package.
The contents for these will be the old/new values for them.</p>
<p>In the example below the version was changed and the ping package was added.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;diff&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;new&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;Version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.6&quot;</span>
<span class="p">},</span>
<span class="s2">&quot;old&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;Version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.5&quot;</span>
<span class="p">}</span>
<span class="p">},</span>
2019-06-18 22:08:20 +00:00
<span class="p">{</span>
<span class="s2">&quot;new&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;Package&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;ping&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;3.2.1&quot;</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="s2">&quot;old&quot;</span><span class="p">:</span> <span class="n">null</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
2019-06-18 22:08:20 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_blueprints_freeze">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_blueprints_freeze</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">blueprint_names</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_blueprints_freeze"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_blueprints_freeze" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return the blueprint with the exact modules and packages selected by depsolve</p>
<p><strong>/api/v0/blueprints/freeze/&lt;blueprint_names&gt;</strong></p>
<blockquote>
2019-06-18 22:08:20 +00:00
<div><p>Return a JSON representation of the blueprint with the package and module versions set
to the exact versions chosen by depsolving the blueprint.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;errors&quot;</span><span class="p">:</span> <span class="p">[],</span>
<span class="s2">&quot;blueprints&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;An example GlusterFS server with samba&quot;</span><span class="p">,</span>
<span class="s2">&quot;modules&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;3.8.4-18.4.el7.x86_64&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs-cli&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;3.8.4-18.4.el7.x86_64&quot;</span>
<span class="p">}</span>
2019-06-18 22:08:20 +00:00
<span class="p">],</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs&quot;</span><span class="p">,</span>
<span class="s2">&quot;packages&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;ping&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;2:3.2.1-2.el7.noarch&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;samba&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;4.6.2-8.el7.x86_64&quot;</span>
<span class="p">}</span>
<span class="p">],</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.6&quot;</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
2019-06-18 22:08:20 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_blueprints_info">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_blueprints_info</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">blueprint_names</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_blueprints_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_blueprints_info" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return the contents of the blueprint, or a list of blueprints</p>
<p><strong>/api/v0/blueprints/info/&lt;blueprint_names&gt;[?format=&lt;json|toml&gt;]</strong></p>
<blockquote>
2019-06-18 22:08:20 +00:00
<div><p>Return the JSON representation of the blueprint. This includes 3 top level
objects. <cite>changes</cite> which lists whether or not the workspace is different from
the most recent commit. <cite>blueprints</cite> which lists the JSON representation of the
blueprint, and <cite>errors</cite> which will list any errors, like non-existant blueprints.</p>
<p>By default the response is JSON, but if <cite>?format=toml</cite> is included in the URL's
arguments it will return the response as the blueprint's raw TOML content.
<em>Unless</em> there is an error which will only return a 400 and a standard error
<a class="reference internal" href="#status-responses">Status Responses</a>.</p>
<p>If there is an error when JSON is requested the successful blueprints and the
errors will both be returned.</p>
<p>Example of json response:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;changes&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;changed&quot;</span><span class="p">:</span> <span class="n">false</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs&quot;</span>
<span class="p">}</span>
<span class="p">],</span>
<span class="s2">&quot;errors&quot;</span><span class="p">:</span> <span class="p">[],</span>
<span class="s2">&quot;blueprints&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;An example GlusterFS server with samba&quot;</span><span class="p">,</span>
<span class="s2">&quot;modules&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;3.7.*&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs-cli&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;3.7.*&quot;</span>
<span class="p">}</span>
<span class="p">],</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs&quot;</span><span class="p">,</span>
<span class="s2">&quot;packages&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;2ping&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;3.2.1&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;samba&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;4.2.*&quot;</span>
<span class="p">}</span>
<span class="p">],</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.6&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
2019-06-18 22:08:20 +00:00
<p>Error example:</p>
2018-06-04 23:34:57 +00:00
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;changes&quot;</span><span class="p">:</span> <span class="p">[],</span>
<span class="s2">&quot;errors&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;ggit-error: the path &#39;missing.toml&#39; does not exist in the given tree (-3)&quot;</span><span class="p">]</span>
<span class="s2">&quot;blueprints&quot;</span><span class="p">:</span> <span class="p">[]</span>
2018-06-04 23:34:57 +00:00
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
2019-06-18 22:08:20 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_blueprints_list">
2019-07-30 22:48:40 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_blueprints_list</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_blueprints_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_blueprints_list" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>List the available blueprints on a branch.</p>
<p><strong>/api/v0/blueprints/list</strong></p>
2018-06-04 23:34:57 +00:00
<blockquote>
2019-06-18 22:08:20 +00:00
<div><p>List the available blueprints:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span> <span class="s2">&quot;limit&quot;</span><span class="p">:</span> <span class="mi">20</span><span class="p">,</span>
<span class="s2">&quot;offset&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s2">&quot;blueprints&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="s2">&quot;atlas&quot;</span><span class="p">,</span>
<span class="s2">&quot;development&quot;</span><span class="p">,</span>
<span class="s2">&quot;glusterfs&quot;</span><span class="p">,</span>
<span class="s2">&quot;http-server&quot;</span><span class="p">,</span>
<span class="s2">&quot;jboss&quot;</span><span class="p">,</span>
<span class="s2">&quot;kubernetes&quot;</span> <span class="p">],</span>
<span class="s2">&quot;total&quot;</span><span class="p">:</span> <span class="mi">6</span> <span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_blueprints_new">
2019-07-30 22:48:40 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_blueprints_new</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_blueprints_new"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_blueprints_new" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Commit a new blueprint</p>
<p><strong>POST /api/v0/blueprints/new</strong></p>
<blockquote>
<div><p>Create a new blueprint, or update an existing blueprint. This supports both JSON and TOML
for the blueprint format. The blueprint should be in the body of the request with the
<cite>Content-Type</cite> header set to either <cite>application/json</cite> or <cite>text/x-toml</cite>.</p>
<p>The response will be a status response with <cite>status</cite> set to true, or an
error response with it set to false and an error message included.</p>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_blueprints_tag">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_blueprints_tag</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">blueprint_name</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_blueprints_tag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_blueprints_tag" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Tag a blueprint's latest blueprint commit as a 'revision'</p>
<p><strong>POST /api/v0/blueprints/tag/&lt;blueprint_name&gt;</strong></p>
<blockquote>
<div><p>Tag a blueprint as a new release. This uses git tags with a special format.
<cite>refs/tags/&lt;branch&gt;/&lt;filename&gt;/r&lt;revision&gt;</cite>. Only the most recent blueprint commit
can be tagged. Revisions start at 1 and increment for each new tag
(per-blueprint). If the commit has already been tagged it will return false.</p>
<p>The response will be a status response with <cite>status</cite> set to true, or an
error response with it set to false and an error message included.</p>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_blueprints_undo">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_blueprints_undo</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">blueprint_name</span></em>, <em class="sig-param"><span class="n">commit</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_blueprints_undo"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_blueprints_undo" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Undo changes to a blueprint by reverting to a previous commit.</p>
<p><strong>POST /api/v0/blueprints/undo/&lt;blueprint_name&gt;/&lt;commit&gt;</strong></p>
<blockquote>
<div><p>This will revert the blueprint to a previous commit. The commit hash from the <cite>changes</cite>
route can be used in this request.</p>
<p>The response will be a status response with <cite>status</cite> set to true, or an
error response with it set to false and an error message included.</p>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_blueprints_workspace">
2019-07-30 22:48:40 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_blueprints_workspace</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_blueprints_workspace"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_blueprints_workspace" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Write a blueprint to the workspace</p>
<p><strong>POST /api/v0/blueprints/workspace</strong></p>
<blockquote>
<div><p>Write a blueprint to the temporary workspace. This works exactly the same as <cite>new</cite> except
that it does not create a commit. JSON and TOML bodies are supported.</p>
<p>The workspace is meant to be used as a temporary blueprint storage for clients.
It will be read by the <cite>info</cite> and <cite>diff</cite> routes if it is different from the
most recent commit.</p>
<p>The response will be a status response with <cite>status</cite> set to true, or an
error response with it set to false and an error message included.</p>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_compose_cancel">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_compose_cancel</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_compose_cancel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_compose_cancel" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Cancel a running compose and delete its results directory</p>
<p><strong>DELETE /api/v0/compose/cancel/&lt;uuid&gt;</strong></p>
<blockquote>
<div><p>Cancel the build, if it is not finished, and delete the results. It will return a
status of True if it is successful.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;uuid&quot;</span><span class="p">:</span> <span class="s2">&quot;03397f8d-acff-4cdb-bd31-f629b7a948f5&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_compose_delete">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_compose_delete</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">uuids</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_compose_delete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_compose_delete" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Delete the compose results for the listed uuids</p>
<p><strong>DELETE /api/v0/compose/delete/&lt;uuids&gt;</strong></p>
<blockquote>
<div><p>Delete the list of comma-separated uuids from the compose results.</p>
2018-06-04 23:34:57 +00:00
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;errors&quot;</span><span class="p">:</span> <span class="p">[],</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;uuids&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;uuid&quot;</span><span class="p">:</span> <span class="s2">&quot;ae1bf7e3-7f16-4c9f-b36e-3726a1093fd0&quot;</span>
2018-06-04 23:34:57 +00:00
<span class="p">}</span>
2019-06-18 22:08:20 +00:00
<span class="p">]</span>
2018-06-04 23:34:57 +00:00
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
2019-06-18 22:08:20 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_compose_failed">
2019-07-30 22:48:40 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_compose_failed</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_compose_failed"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_compose_failed" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return the list of failed composes</p>
<p><strong>/api/v0/compose/failed</strong></p>
<blockquote>
<div><p>Return the details on all of the failed composes on the system.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;failed&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;8c8435ef-d6bd-4c68-9bf1-a2ef832e6b1a&quot;</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="s2">&quot;http-server&quot;</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="s2">&quot;FAILED&quot;</span><span class="p">,</span>
<span class="s2">&quot;job_created&quot;</span><span class="p">:</span> <span class="mf">1517523249.9301329</span><span class="p">,</span>
<span class="s2">&quot;job_started&quot;</span><span class="p">:</span> <span class="mf">1517523249.9314211</span><span class="p">,</span>
<span class="s2">&quot;job_finished&quot;</span><span class="p">:</span> <span class="mf">1517523255.5623411</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.2&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
2018-06-04 23:34:57 +00:00
</div>
2019-06-18 22:08:20 +00:00
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_compose_finished">
2019-07-30 22:48:40 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_compose_finished</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_compose_finished"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_compose_finished" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return the list of finished composes</p>
<p><strong>/api/v0/compose/finished</strong></p>
2018-06-04 23:34:57 +00:00
<blockquote>
2019-06-18 22:08:20 +00:00
<div><p>Return the details on all of the finished composes on the system.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;finished&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;70b84195-9817-4b8a-af92-45e380f39894&quot;</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs&quot;</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="s2">&quot;FINISHED&quot;</span><span class="p">,</span>
<span class="s2">&quot;job_created&quot;</span><span class="p">:</span> <span class="mf">1517351003.8210032</span><span class="p">,</span>
<span class="s2">&quot;job_started&quot;</span><span class="p">:</span> <span class="mf">1517351003.8230415</span><span class="p">,</span>
<span class="s2">&quot;job_finished&quot;</span><span class="p">:</span> <span class="mf">1517359234.1003145</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.6&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;e695affd-397f-4af9-9022-add2636e7459&quot;</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs&quot;</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="s2">&quot;FINISHED&quot;</span><span class="p">,</span>
<span class="s2">&quot;job_created&quot;</span><span class="p">:</span> <span class="mf">1517362289.7193348</span><span class="p">,</span>
<span class="s2">&quot;job_started&quot;</span><span class="p">:</span> <span class="mf">1517362289.9751132</span><span class="p">,</span>
<span class="s2">&quot;job_finished&quot;</span><span class="p">:</span> <span class="mf">1517363500.1234567</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.6&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_compose_image">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_compose_image</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_compose_image"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_compose_image" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return the output image for the build</p>
<p><strong>/api/v0/compose/image/&lt;uuid&gt;</strong></p>
<blockquote>
<div><p>Returns the output image from the build. The filename is set to the filename
from the build with the UUID as a prefix. eg. UUID-root.tar.xz or UUID-boot.iso.</p>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_compose_info">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_compose_info</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_compose_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_compose_info" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return detailed info about a compose</p>
<p><strong>/api/v0/compose/info/&lt;uuid&gt;</strong></p>
<blockquote>
<div><p>Get detailed information about the compose. The returned JSON string will
contain the following information:</p>
<blockquote>
<div><ul class="simple">
<li><p>id - The uuid of the comoposition</p></li>
<li><p>config - containing the configuration settings used to run Anaconda</p></li>
<li><p>blueprint - The depsolved blueprint used to generate the kickstart</p></li>
<li><p>commit - The (local) git commit hash for the blueprint used</p></li>
<li><p>deps - The NEVRA of all of the dependencies used in the composition</p></li>
<li><p>compose_type - The type of output generated (tar, iso, etc.)</p></li>
<li><p>queue_status - The final status of the composition (FINISHED or FAILED)</p></li>
2018-06-04 23:34:57 +00:00
</ul>
2019-06-18 22:08:20 +00:00
</div></blockquote>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;commit&quot;</span><span class="p">:</span> <span class="s2">&quot;7078e521a54b12eae31c3fd028680da7a0815a4d&quot;</span><span class="p">,</span>
<span class="s2">&quot;compose_type&quot;</span><span class="p">:</span> <span class="s2">&quot;tar&quot;</span><span class="p">,</span>
<span class="s2">&quot;config&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;anaconda_args&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="s2">&quot;armplatform&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="s2">&quot;compress_args&quot;</span><span class="p">:</span> <span class="p">[],</span>
<span class="s2">&quot;compression&quot;</span><span class="p">:</span> <span class="s2">&quot;xz&quot;</span><span class="p">,</span>
<span class="s2">&quot;image_name&quot;</span><span class="p">:</span> <span class="s2">&quot;root.tar.xz&quot;</span><span class="p">,</span>
<span class="o">...</span>
<span class="p">},</span>
<span class="s2">&quot;deps&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;packages&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;arch&quot;</span><span class="p">:</span> <span class="s2">&quot;x86_64&quot;</span><span class="p">,</span>
<span class="s2">&quot;epoch&quot;</span><span class="p">:</span> <span class="s2">&quot;0&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;acl&quot;</span><span class="p">,</span>
<span class="s2">&quot;release&quot;</span><span class="p">:</span> <span class="s2">&quot;14.el7&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;2.2.51&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">},</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;c30b7d80-523b-4a23-ad52-61b799739ce8&quot;</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="s2">&quot;FINISHED&quot;</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;An example kubernetes master&quot;</span><span class="p">,</span>
<span class="o">...</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_compose_log_tail">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_compose_log_tail</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_compose_log_tail"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_compose_log_tail" title="Permalink to this definition"></a></dt>
2019-07-30 22:48:40 +00:00
<dd><p>Return the tail of the most currently relevant log</p>
<p><strong>/api/v0/compose/log/&lt;uuid&gt;[?size=KiB]</strong></p>
2019-06-18 22:08:20 +00:00
<blockquote>
2019-07-30 22:48:40 +00:00
<div><p>Returns the end of either the anaconda log, the packaging log, or the
composer logs, depending on the progress of the compose. The size
parameter is optional and defaults to 1 MiB if it is not included. The
returned data is raw text from the end of the log file, starting on a
line boundary.</p>
2019-06-18 22:08:20 +00:00
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">12</span><span class="p">:</span><span class="mi">59</span><span class="p">:</span><span class="mi">24</span><span class="p">,</span><span class="mi">222</span> <span class="n">INFO</span> <span class="n">anaconda</span><span class="p">:</span> <span class="n">Running</span> <span class="n">Thread</span><span class="p">:</span> <span class="n">AnaConfigurationThread</span> <span class="p">(</span><span class="mi">140629395244800</span><span class="p">)</span>
<span class="mi">12</span><span class="p">:</span><span class="mi">59</span><span class="p">:</span><span class="mi">24</span><span class="p">,</span><span class="mi">223</span> <span class="n">INFO</span> <span class="n">anaconda</span><span class="p">:</span> <span class="n">Configuring</span> <span class="n">installed</span> <span class="n">system</span>
<span class="mi">12</span><span class="p">:</span><span class="mi">59</span><span class="p">:</span><span class="mi">24</span><span class="p">,</span><span class="mi">912</span> <span class="n">INFO</span> <span class="n">anaconda</span><span class="p">:</span> <span class="n">Configuring</span> <span class="n">installed</span> <span class="n">system</span>
<span class="mi">12</span><span class="p">:</span><span class="mi">59</span><span class="p">:</span><span class="mi">24</span><span class="p">,</span><span class="mi">912</span> <span class="n">INFO</span> <span class="n">anaconda</span><span class="p">:</span> <span class="n">Creating</span> <span class="n">users</span>
<span class="mi">12</span><span class="p">:</span><span class="mi">59</span><span class="p">:</span><span class="mi">24</span><span class="p">,</span><span class="mi">913</span> <span class="n">INFO</span> <span class="n">anaconda</span><span class="p">:</span> <span class="n">Clearing</span> <span class="n">libuser</span><span class="o">.</span><span class="n">conf</span> <span class="n">at</span> <span class="o">/</span><span class="n">tmp</span><span class="o">/</span><span class="n">libuser</span><span class="o">.</span><span class="n">Dyy8Gj</span>
<span class="mi">12</span><span class="p">:</span><span class="mi">59</span><span class="p">:</span><span class="mi">25</span><span class="p">,</span><span class="mi">154</span> <span class="n">INFO</span> <span class="n">anaconda</span><span class="p">:</span> <span class="n">Creating</span> <span class="n">users</span>
<span class="mi">12</span><span class="p">:</span><span class="mi">59</span><span class="p">:</span><span class="mi">25</span><span class="p">,</span><span class="mi">155</span> <span class="n">INFO</span> <span class="n">anaconda</span><span class="p">:</span> <span class="n">Configuring</span> <span class="n">addons</span>
<span class="mi">12</span><span class="p">:</span><span class="mi">59</span><span class="p">:</span><span class="mi">25</span><span class="p">,</span><span class="mi">155</span> <span class="n">INFO</span> <span class="n">anaconda</span><span class="p">:</span> <span class="n">Configuring</span> <span class="n">addons</span>
<span class="mi">12</span><span class="p">:</span><span class="mi">59</span><span class="p">:</span><span class="mi">25</span><span class="p">,</span><span class="mi">155</span> <span class="n">INFO</span> <span class="n">anaconda</span><span class="p">:</span> <span class="n">Generating</span> <span class="n">initramfs</span>
<span class="mi">12</span><span class="p">:</span><span class="mi">59</span><span class="p">:</span><span class="mi">49</span><span class="p">,</span><span class="mi">467</span> <span class="n">INFO</span> <span class="n">anaconda</span><span class="p">:</span> <span class="n">Generating</span> <span class="n">initramfs</span>
<span class="mi">12</span><span class="p">:</span><span class="mi">59</span><span class="p">:</span><span class="mi">49</span><span class="p">,</span><span class="mi">467</span> <span class="n">INFO</span> <span class="n">anaconda</span><span class="p">:</span> <span class="n">Running</span> <span class="n">post</span><span class="o">-</span><span class="n">installation</span> <span class="n">scripts</span>
<span class="mi">12</span><span class="p">:</span><span class="mi">59</span><span class="p">:</span><span class="mi">49</span><span class="p">,</span><span class="mi">467</span> <span class="n">INFO</span> <span class="n">anaconda</span><span class="p">:</span> <span class="n">Running</span> <span class="n">kickstart</span> <span class="o">%%</span><span class="n">post</span> <span class="n">script</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
<span class="mi">12</span><span class="p">:</span><span class="mi">59</span><span class="p">:</span><span class="mi">50</span><span class="p">,</span><span class="mi">782</span> <span class="n">INFO</span> <span class="n">anaconda</span><span class="p">:</span> <span class="n">All</span> <span class="n">kickstart</span> <span class="o">%%</span><span class="n">post</span> <span class="n">script</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="n">have</span> <span class="n">been</span> <span class="n">run</span>
<span class="mi">12</span><span class="p">:</span><span class="mi">59</span><span class="p">:</span><span class="mi">50</span><span class="p">,</span><span class="mi">782</span> <span class="n">INFO</span> <span class="n">anaconda</span><span class="p">:</span> <span class="n">Running</span> <span class="n">post</span><span class="o">-</span><span class="n">installation</span> <span class="n">scripts</span>
<span class="mi">12</span><span class="p">:</span><span class="mi">59</span><span class="p">:</span><span class="mi">50</span><span class="p">,</span><span class="mi">784</span> <span class="n">INFO</span> <span class="n">anaconda</span><span class="p">:</span> <span class="n">Thread</span> <span class="n">Done</span><span class="p">:</span> <span class="n">AnaConfigurationThread</span> <span class="p">(</span><span class="mi">140629395244800</span><span class="p">)</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_compose_logs">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_compose_logs</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_compose_logs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_compose_logs" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return a tar of the metadata for the build</p>
<p><strong>/api/v0/compose/logs/&lt;uuid&gt;</strong></p>
<blockquote>
<div><p>Returns a .tar of the anaconda build logs. The tar is not compressed, but is
not large.</p>
<p>The mime type is set to 'application/x-tar' and the filename is set to
UUID-logs.tar</p>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_compose_metadata">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_compose_metadata</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_compose_metadata"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_compose_metadata" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return a tar of the metadata for the build</p>
<p><strong>/api/v0/compose/metadata/&lt;uuid&gt;</strong></p>
<blockquote>
<div><p>Returns a .tar of the metadata used for the build. This includes all the
information needed to reproduce the build, including the final kickstart
populated with repository and package NEVRA.</p>
<p>The mime type is set to 'application/x-tar' and the filename is set to
UUID-metadata.tar</p>
<p>The .tar is uncompressed, but is not large.</p>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_compose_queue">
2019-07-30 22:48:40 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_compose_queue</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_compose_queue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_compose_queue" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return the status of the new and running queues</p>
<p><strong>/api/v0/compose/queue</strong></p>
<blockquote>
<div><p>Return the status of the build queue. It includes information about the builds waiting,
and the build that is running.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;new&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;45502a6d-06e8-48a5-a215-2b4174b3614b&quot;</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs&quot;</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="s2">&quot;WAITING&quot;</span><span class="p">,</span>
<span class="s2">&quot;job_created&quot;</span><span class="p">:</span> <span class="mf">1517362647.4570868</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.6&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;6d292bd0-bec7-4825-8d7d-41ef9c3e4b73&quot;</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="s2">&quot;kubernetes&quot;</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="s2">&quot;WAITING&quot;</span><span class="p">,</span>
<span class="s2">&quot;job_created&quot;</span><span class="p">:</span> <span class="mf">1517362659.0034983</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.1&quot;</span>
<span class="p">}</span>
<span class="p">],</span>
<span class="s2">&quot;run&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;745712b2-96db-44c0-8014-fe925c35e795&quot;</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs&quot;</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="s2">&quot;RUNNING&quot;</span><span class="p">,</span>
<span class="s2">&quot;job_created&quot;</span><span class="p">:</span> <span class="mf">1517362633.7965999</span><span class="p">,</span>
<span class="s2">&quot;job_started&quot;</span><span class="p">:</span> <span class="mf">1517362633.8001345</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.6&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_compose_results">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_compose_results</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_compose_results"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_compose_results" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return a tar of the metadata and the results for the build</p>
<p><strong>/api/v0/compose/results/&lt;uuid&gt;</strong></p>
<blockquote>
<div><p>Returns a .tar of the metadata, logs, and output image of the build. This
includes all the information needed to reproduce the build, including the
final kickstart populated with repository and package NEVRA. The output image
is already in compressed form so the returned tar is not compressed.</p>
<p>The mime type is set to 'application/x-tar' and the filename is set to
UUID.tar</p>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_compose_start">
2019-07-30 22:48:40 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_compose_start</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_compose_start"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_compose_start" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Start a compose</p>
<dl class="simple">
<dt>The body of the post should have these fields:</dt><dd><p>blueprint_name - The blueprint name from /blueprints/list/
compose_type - The type of output to create, from /compose/types
branch - Optional, defaults to master, selects the git branch to use for the blueprint.</p>
</dd>
</dl>
<p><strong>POST /api/v0/compose</strong></p>
<blockquote>
<div><p>Start a compose. The content type should be 'application/json' and the body of the POST
should look like this</p>
2018-06-04 23:34:57 +00:00
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;blueprint_name&quot;</span><span class="p">:</span> <span class="s2">&quot;http-server&quot;</span><span class="p">,</span>
<span class="s2">&quot;compose_type&quot;</span><span class="p">:</span> <span class="s2">&quot;tar&quot;</span><span class="p">,</span>
<span class="s2">&quot;branch&quot;</span><span class="p">:</span> <span class="s2">&quot;master&quot;</span>
2018-06-04 23:34:57 +00:00
<span class="p">}</span>
</pre></div>
</div>
2019-06-18 22:08:20 +00:00
<p>Pass it the name of the blueprint, the type of output (from '/api/v0/compose/types'), and the
blueprint branch to use. 'branch' is optional and will default to master. It will create a new
build and add it to the queue. It returns the build uuid and a status if it succeeds</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;build_id&quot;</span><span class="p">:</span> <span class="s2">&quot;e6fa6db4-9c81-4b70-870f-a697ca405cdf&quot;</span><span class="p">,</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="n">true</span>
<span class="p">}</span>
</pre></div>
2018-06-04 23:34:57 +00:00
</div>
</div></blockquote>
2019-06-18 22:08:20 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_compose_status">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_compose_status</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">uuids</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_compose_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_compose_status" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return the status of the listed uuids</p>
<p><strong>/api/v0/compose/status/&lt;uuids&gt;[?blueprint=&lt;blueprint_name&gt;&amp;status=&lt;compose_status&gt;&amp;type=&lt;compose_type&gt;]</strong></p>
<blockquote>
2019-06-18 22:08:20 +00:00
<div><p>Return the details for each of the comma-separated list of uuids. A uuid of '*' will return
details for all composes.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;uuids&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;8c8435ef-d6bd-4c68-9bf1-a2ef832e6b1a&quot;</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="s2">&quot;http-server&quot;</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="s2">&quot;FINISHED&quot;</span><span class="p">,</span>
<span class="s2">&quot;job_created&quot;</span><span class="p">:</span> <span class="mf">1517523644.2384307</span><span class="p">,</span>
<span class="s2">&quot;job_started&quot;</span><span class="p">:</span> <span class="mf">1517523644.2551234</span><span class="p">,</span>
<span class="s2">&quot;job_finished&quot;</span><span class="p">:</span> <span class="mf">1517523689.9864314</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.2&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;45502a6d-06e8-48a5-a215-2b4174b3614b&quot;</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs&quot;</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="s2">&quot;FINISHED&quot;</span><span class="p">,</span>
<span class="s2">&quot;job_created&quot;</span><span class="p">:</span> <span class="mf">1517363442.188399</span><span class="p">,</span>
<span class="s2">&quot;job_started&quot;</span><span class="p">:</span> <span class="mf">1517363442.325324</span><span class="p">,</span>
<span class="s2">&quot;job_finished&quot;</span><span class="p">:</span> <span class="mf">1517363451.653621</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.6&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
2019-06-18 22:08:20 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_compose_types">
2019-07-30 22:48:40 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_compose_types</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_compose_types"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_compose_types" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return the list of enabled output types</p>
<p>(only enabled types are returned)</p>
<p><strong>/api/v0/compose/types</strong></p>
<blockquote>
2019-06-18 22:08:20 +00:00
<div><p>Returns the list of supported output types that are valid for use with 'POST /api/v0/compose'</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;types&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;enabled&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;tar&quot;</span>
<span class="p">}</span>
2019-06-18 22:08:20 +00:00
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
2019-06-18 22:08:20 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_modules_info">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_modules_info</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">module_names</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_modules_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_modules_info" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return detailed information about the listed modules</p>
<p><strong>/api/v0/modules/info/&lt;module_names&gt;</strong></p>
<blockquote>
2019-03-27 23:44:17 +00:00
<div><p>Return the module's dependencies, and the information about the module.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;modules&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;dependencies&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;arch&quot;</span><span class="p">:</span> <span class="s2">&quot;noarch&quot;</span><span class="p">,</span>
<span class="s2">&quot;epoch&quot;</span><span class="p">:</span> <span class="s2">&quot;0&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;basesystem&quot;</span><span class="p">,</span>
<span class="s2">&quot;release&quot;</span><span class="p">:</span> <span class="s2">&quot;7.el7&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;10.0&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;arch&quot;</span><span class="p">:</span> <span class="s2">&quot;x86_64&quot;</span><span class="p">,</span>
<span class="s2">&quot;epoch&quot;</span><span class="p">:</span> <span class="s2">&quot;0&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;bash&quot;</span><span class="p">,</span>
<span class="s2">&quot;release&quot;</span><span class="p">:</span> <span class="s2">&quot;28.el7&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;4.2.46&quot;</span>
<span class="p">},</span>
<span class="o">...</span>
<span class="p">],</span>
<span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;The GNU tar program saves ...&quot;</span><span class="p">,</span>
<span class="s2">&quot;homepage&quot;</span><span class="p">:</span> <span class="s2">&quot;http://www.gnu.org/software/tar/&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;tar&quot;</span><span class="p">,</span>
<span class="s2">&quot;summary&quot;</span><span class="p">:</span> <span class="s2">&quot;A GNU file archiving program&quot;</span><span class="p">,</span>
<span class="s2">&quot;upstream_vcs&quot;</span><span class="p">:</span> <span class="s2">&quot;UPSTREAM_VCS&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
2019-06-18 22:08:20 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_modules_list">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_modules_list</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">module_names</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_modules_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_modules_list" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>List available modules, filtering by module_names</p>
<p><strong>/api/v0/modules/list[?offset=0&amp;limit=20]</strong></p>
<blockquote>
2019-06-18 22:08:20 +00:00
<div><p>Return a list of all of the available modules. This includes the name and the
group_type, which is always &quot;rpm&quot; for lorax-composer. By default this returns
the first 20 items. This can be changed by setting the <cite>offset</cite> and <cite>limit</cite>
arguments.</p>
2019-03-27 23:44:17 +00:00
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;limit&quot;</span><span class="p">:</span> <span class="mi">20</span><span class="p">,</span>
<span class="s2">&quot;modules&quot;</span><span class="p">:</span> <span class="p">[</span>
2019-03-27 23:44:17 +00:00
<span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;group_type&quot;</span><span class="p">:</span> <span class="s2">&quot;rpm&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;0ad&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;group_type&quot;</span><span class="p">:</span> <span class="s2">&quot;rpm&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;0ad-data&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;group_type&quot;</span><span class="p">:</span> <span class="s2">&quot;rpm&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;0install&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;group_type&quot;</span><span class="p">:</span> <span class="s2">&quot;rpm&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;2048-cli&quot;</span>
<span class="p">},</span>
<span class="o">...</span>
2019-03-27 23:44:17 +00:00
<span class="p">]</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;total&quot;</span><span class="p">:</span> <span class="mi">21770</span>
2019-03-27 23:44:17 +00:00
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
2019-06-18 22:08:20 +00:00
<p><strong>/api/v0/modules/list/&lt;module_names&gt;[?offset=0&amp;limit=20]</strong></p>
<blockquote>
2019-06-18 22:08:20 +00:00
<div><p>Return the list of comma-separated modules. Output is the same as <cite>/modules/list</cite></p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;limit&quot;</span><span class="p">:</span> <span class="mi">20</span><span class="p">,</span>
<span class="s2">&quot;modules&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;group_type&quot;</span><span class="p">:</span> <span class="s2">&quot;rpm&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;tar&quot;</span>
<span class="p">}</span>
<span class="p">],</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;offset&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s2">&quot;total&quot;</span><span class="p">:</span> <span class="mi">1</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
2019-06-18 22:08:20 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_projects_depsolve">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_projects_depsolve</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">project_names</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_projects_depsolve"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_projects_depsolve" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return detailed information about the listed projects</p>
<p><strong>/api/v0/projects/depsolve/&lt;project_names&gt;</strong></p>
<blockquote>
2019-06-18 22:08:20 +00:00
<div><p>Depsolve the comma-separated list of projects and return the list of NEVRAs needed
to satisfy the request.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;projects&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;arch&quot;</span><span class="p">:</span> <span class="s2">&quot;noarch&quot;</span><span class="p">,</span>
<span class="s2">&quot;epoch&quot;</span><span class="p">:</span> <span class="s2">&quot;0&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;basesystem&quot;</span><span class="p">,</span>
<span class="s2">&quot;release&quot;</span><span class="p">:</span> <span class="s2">&quot;7.el7&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;10.0&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;arch&quot;</span><span class="p">:</span> <span class="s2">&quot;x86_64&quot;</span><span class="p">,</span>
<span class="s2">&quot;epoch&quot;</span><span class="p">:</span> <span class="s2">&quot;0&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;bash&quot;</span><span class="p">,</span>
<span class="s2">&quot;release&quot;</span><span class="p">:</span> <span class="s2">&quot;28.el7&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;4.2.46&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;arch&quot;</span><span class="p">:</span> <span class="s2">&quot;x86_64&quot;</span><span class="p">,</span>
<span class="s2">&quot;epoch&quot;</span><span class="p">:</span> <span class="s2">&quot;0&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;filesystem&quot;</span><span class="p">,</span>
<span class="s2">&quot;release&quot;</span><span class="p">:</span> <span class="s2">&quot;21.el7&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;3.2&quot;</span>
<span class="p">},</span>
<span class="o">...</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
2019-06-18 22:08:20 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_projects_info">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_projects_info</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">project_names</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_projects_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_projects_info" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return detailed information about the listed projects</p>
<p><strong>/api/v0/projects/info/&lt;project_names&gt;</strong></p>
<blockquote>
2019-06-18 22:08:20 +00:00
<div><p>Return information about the comma-separated list of projects. It includes the description
of the package along with the list of available builds.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;projects&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;builds&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;arch&quot;</span><span class="p">:</span> <span class="s2">&quot;x86_64&quot;</span><span class="p">,</span>
<span class="s2">&quot;build_config_ref&quot;</span><span class="p">:</span> <span class="s2">&quot;BUILD_CONFIG_REF&quot;</span><span class="p">,</span>
<span class="s2">&quot;build_env_ref&quot;</span><span class="p">:</span> <span class="s2">&quot;BUILD_ENV_REF&quot;</span><span class="p">,</span>
<span class="s2">&quot;build_time&quot;</span><span class="p">:</span> <span class="s2">&quot;2017-03-01T08:39:23&quot;</span><span class="p">,</span>
<span class="s2">&quot;changelog&quot;</span><span class="p">:</span> <span class="s2">&quot;- restore incremental backups correctly, files ...&quot;</span><span class="p">,</span>
<span class="s2">&quot;epoch&quot;</span><span class="p">:</span> <span class="s2">&quot;2&quot;</span><span class="p">,</span>
<span class="s2">&quot;metadata&quot;</span><span class="p">:</span> <span class="p">{},</span>
<span class="s2">&quot;release&quot;</span><span class="p">:</span> <span class="s2">&quot;32.el7&quot;</span><span class="p">,</span>
<span class="s2">&quot;source&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;license&quot;</span><span class="p">:</span> <span class="s2">&quot;GPLv3+&quot;</span><span class="p">,</span>
<span class="s2">&quot;metadata&quot;</span><span class="p">:</span> <span class="p">{},</span>
<span class="s2">&quot;source_ref&quot;</span><span class="p">:</span> <span class="s2">&quot;SOURCE_REF&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;1.26&quot;</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">],</span>
<span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;The GNU tar program saves many ...&quot;</span><span class="p">,</span>
<span class="s2">&quot;homepage&quot;</span><span class="p">:</span> <span class="s2">&quot;http://www.gnu.org/software/tar/&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;tar&quot;</span><span class="p">,</span>
<span class="s2">&quot;summary&quot;</span><span class="p">:</span> <span class="s2">&quot;A GNU file archiving program&quot;</span><span class="p">,</span>
<span class="s2">&quot;upstream_vcs&quot;</span><span class="p">:</span> <span class="s2">&quot;UPSTREAM_VCS&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
2019-06-18 22:08:20 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_projects_list">
2019-07-30 22:48:40 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_projects_list</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_projects_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_projects_list" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>List all of the available projects/packages</p>
<p><strong>/api/v0/projects/list[?offset=0&amp;limit=20]</strong></p>
<blockquote>
2019-06-18 22:08:20 +00:00
<div><p>List all of the available projects. By default this returns the first 20 items,
but this can be changed by setting the <cite>offset</cite> and <cite>limit</cite> arguments.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;limit&quot;</span><span class="p">:</span> <span class="mi">20</span><span class="p">,</span>
<span class="s2">&quot;offset&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
<span class="s2">&quot;projects&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;0 A.D. (pronounced &quot;</span><span class="n">zero</span> <span class="n">ey</span><span class="o">-</span><span class="n">dee</span><span class="s2">&quot;) is a ...&quot;</span><span class="p">,</span>
<span class="s2">&quot;homepage&quot;</span><span class="p">:</span> <span class="s2">&quot;http://play0ad.com&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;0ad&quot;</span><span class="p">,</span>
<span class="s2">&quot;summary&quot;</span><span class="p">:</span> <span class="s2">&quot;Cross-Platform RTS Game of Ancient Warfare&quot;</span><span class="p">,</span>
<span class="s2">&quot;upstream_vcs&quot;</span><span class="p">:</span> <span class="s2">&quot;UPSTREAM_VCS&quot;</span>
<span class="p">},</span>
2019-06-18 22:08:20 +00:00
<span class="o">...</span>
<span class="p">],</span>
<span class="s2">&quot;total&quot;</span><span class="p">:</span> <span class="mi">21770</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
2019-06-18 22:08:20 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_projects_source_delete">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_projects_source_delete</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">source_name</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_projects_source_delete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_projects_source_delete" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Delete the named source and return a status response</p>
<p><strong>DELETE /api/v0/projects/source/delete/&lt;source-name&gt;</strong></p>
<blockquote>
2019-06-18 22:08:20 +00:00
<div><p>Delete a user added source. This will fail if a system source is passed to
it.</p>
<p>The response will be a status response with <cite>status</cite> set to true, or an
error response with it set to false and an error message included.</p>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_projects_source_info">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_projects_source_info</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">source_names</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_projects_source_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_projects_source_info" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return detailed info about the list of sources</p>
<p><strong>/api/v0/projects/source/info/&lt;source-names&gt;</strong></p>
<blockquote>
<div><p>Return information about the comma-separated list of source names. Or all of the
sources if '*' is passed. Note that general globbing is not supported, only '*'.</p>
<p>immutable system sources will have the &quot;system&quot; field set to true. User added sources
will have it set to false. System sources cannot be changed or deleted.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;errors&quot;</span><span class="p">:</span> <span class="p">[],</span>
<span class="s2">&quot;sources&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;fedora&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;check_gpg&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;check_ssl&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;gpgkey_urls&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="s2">&quot;file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-28-x86_64&quot;</span>
<span class="p">],</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;fedora&quot;</span><span class="p">,</span>
<span class="s2">&quot;proxy&quot;</span><span class="p">:</span> <span class="s2">&quot;http://proxy.brianlane.com:8123&quot;</span><span class="p">,</span>
<span class="s2">&quot;system&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;yum-metalink&quot;</span><span class="p">,</span>
<span class="s2">&quot;url&quot;</span><span class="p">:</span> <span class="s2">&quot;https://mirrors.fedoraproject.org/metalink?repo=fedora-28&amp;arch=x86_64&quot;</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
2019-06-18 22:08:20 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_projects_source_list">
2019-07-30 22:48:40 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_projects_source_list</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_projects_source_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_projects_source_list" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Return the list of source names</p>
<p><strong>/api/v0/projects/source/list</strong></p>
<blockquote>
2019-06-18 22:08:20 +00:00
<div><p>Return the list of repositories used for depsolving and installing packages.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;sources&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="s2">&quot;fedora&quot;</span><span class="p">,</span>
<span class="s2">&quot;fedora-cisco-openh264&quot;</span><span class="p">,</span>
<span class="s2">&quot;fedora-updates-testing&quot;</span><span class="p">,</span>
<span class="s2">&quot;fedora-updates&quot;</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
2019-06-18 22:08:20 +00:00
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-06-18 22:08:20 +00:00
<dt id="pylorax.api.v0.v0_projects_source_new">
2019-07-30 22:48:40 +00:00
<code class="sig-prename descclassname">pylorax.api.v0.</code><code class="sig-name descname">v0_projects_source_new</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v0.html#v0_projects_source_new"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v0.v0_projects_source_new" title="Permalink to this definition"></a></dt>
2019-06-18 22:08:20 +00:00
<dd><p>Add a new package source. Or change an existing one</p>
<p><strong>POST /api/v0/projects/source/new</strong></p>
<blockquote>
2019-06-18 22:08:20 +00:00
<div><p>Add (or change) a source for use when depsolving blueprints and composing images.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">proxy</span></code> and <code class="docutils literal notranslate"><span class="pre">gpgkey_urls</span></code> entries are optional. All of the others are required. The supported
types for the urls are:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">yum-baseurl</span></code> is a URL to a yum repository.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">yum-mirrorlist</span></code> is a URL for a mirrorlist.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">yum-metalink</span></code> is a URL for a metalink.</p></li>
</ul>
2019-06-18 22:08:20 +00:00
<p>If <code class="docutils literal notranslate"><span class="pre">check_ssl</span></code> is true the https certificates must be valid. If they are self-signed you can either set
this to false, or add your Certificate Authority to the host system.</p>
<p>If <code class="docutils literal notranslate"><span class="pre">check_gpg</span></code> is true the GPG key must either be installed on the host system, or <code class="docutils literal notranslate"><span class="pre">gpgkey_urls</span></code>
should point to it.</p>
<p>You can edit an existing source (other than system sources), by doing a POST
of the new version of the source. It will overwrite the previous one.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
2019-06-18 22:08:20 +00:00
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;custom-source-1&quot;</span><span class="p">,</span>
<span class="s2">&quot;url&quot;</span><span class="p">:</span> <span class="s2">&quot;https://url/path/to/repository/&quot;</span><span class="p">,</span>
<span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;yum-baseurl&quot;</span><span class="p">,</span>
<span class="s2">&quot;check_ssl&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;check_gpg&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;gpgkey_urls&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="s2">&quot;https://url/path/to/gpg-key&quot;</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
</div>
2019-10-16 23:14:02 +00:00
</div>
<div class="section" id="module-pylorax.api.v1">
<span id="pylorax-api-v1-module"></span><h2>pylorax.api.v1 module<a class="headerlink" href="#module-pylorax.api.v1" title="Permalink to this headline"></a></h2>
<p>Setup v1 of the API server</p>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.v1.v1_compose_failed">
<code class="sig-prename descclassname">pylorax.api.v1.</code><code class="sig-name descname">v1_compose_failed</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v1.html#v1_compose_failed"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v1.v1_compose_failed" title="Permalink to this definition"></a></dt>
<dd><p>Return the list of failed composes</p>
<p><strong>/api/v1/compose/failed</strong></p>
<blockquote>
<div><p>Return the details on all of the failed composes on the system.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;failed&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;8c8435ef-d6bd-4c68-9bf1-a2ef832e6b1a&quot;</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="s2">&quot;http-server&quot;</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="s2">&quot;FAILED&quot;</span><span class="p">,</span>
<span class="s2">&quot;job_created&quot;</span><span class="p">:</span> <span class="mf">1517523249.9301329</span><span class="p">,</span>
<span class="s2">&quot;job_started&quot;</span><span class="p">:</span> <span class="mf">1517523249.9314211</span><span class="p">,</span>
<span class="s2">&quot;job_finished&quot;</span><span class="p">:</span> <span class="mf">1517523255.5623411</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.2&quot;</span><span class="p">,</span>
<span class="s2">&quot;uploads&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;creation_time&quot;</span><span class="p">:</span> <span class="mf">1568150660.524401</span><span class="p">,</span>
<span class="s2">&quot;image_name&quot;</span><span class="p">:</span> <span class="s2">&quot;http-server&quot;</span><span class="p">,</span>
<span class="s2">&quot;image_path&quot;</span><span class="p">:</span> <span class="n">null</span><span class="p">,</span>
<span class="s2">&quot;provider_name&quot;</span><span class="p">:</span> <span class="s2">&quot;azure&quot;</span><span class="p">,</span>
<span class="s2">&quot;settings&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;client_id&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;location&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;resource_group&quot;</span><span class="p">:</span> <span class="s2">&quot;group&quot;</span><span class="p">,</span>
<span class="s2">&quot;secret&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_account_name&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_container&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;subscription_id&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;tenant&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span>
<span class="p">},</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;WAITING&quot;</span><span class="p">,</span>
<span class="s2">&quot;uuid&quot;</span><span class="p">:</span> <span class="s2">&quot;21898dfd-9ac9-4e22-bb1d-7f12d0129e65&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.v1.v1_compose_finished">
<code class="sig-prename descclassname">pylorax.api.v1.</code><code class="sig-name descname">v1_compose_finished</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v1.html#v1_compose_finished"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v1.v1_compose_finished" title="Permalink to this definition"></a></dt>
<dd><p>Return the list of finished composes</p>
<p><strong>/api/v1/compose/finished</strong></p>
<blockquote>
<div><p>Return the details on all of the finished composes on the system.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;finished&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;70b84195-9817-4b8a-af92-45e380f39894&quot;</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs&quot;</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="s2">&quot;FINISHED&quot;</span><span class="p">,</span>
<span class="s2">&quot;job_created&quot;</span><span class="p">:</span> <span class="mf">1517351003.8210032</span><span class="p">,</span>
<span class="s2">&quot;job_started&quot;</span><span class="p">:</span> <span class="mf">1517351003.8230415</span><span class="p">,</span>
<span class="s2">&quot;job_finished&quot;</span><span class="p">:</span> <span class="mf">1517359234.1003145</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.6&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;e695affd-397f-4af9-9022-add2636e7459&quot;</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs&quot;</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="s2">&quot;FINISHED&quot;</span><span class="p">,</span>
<span class="s2">&quot;job_created&quot;</span><span class="p">:</span> <span class="mf">1517362289.7193348</span><span class="p">,</span>
<span class="s2">&quot;job_started&quot;</span><span class="p">:</span> <span class="mf">1517362289.9751132</span><span class="p">,</span>
<span class="s2">&quot;job_finished&quot;</span><span class="p">:</span> <span class="mf">1517363500.1234567</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.6&quot;</span><span class="p">,</span>
<span class="s2">&quot;uploads&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;creation_time&quot;</span><span class="p">:</span> <span class="mf">1568150660.524401</span><span class="p">,</span>
<span class="s2">&quot;image_name&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs server&quot;</span><span class="p">,</span>
<span class="s2">&quot;image_path&quot;</span><span class="p">:</span> <span class="s2">&quot;/var/lib/lorax/composer/results/e695affd-397f-4af9-9022-add2636e7459/disk.vhd&quot;</span><span class="p">,</span>
<span class="s2">&quot;provider_name&quot;</span><span class="p">:</span> <span class="s2">&quot;azure&quot;</span><span class="p">,</span>
<span class="s2">&quot;settings&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;client_id&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;location&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;resource_group&quot;</span><span class="p">:</span> <span class="s2">&quot;group&quot;</span><span class="p">,</span>
<span class="s2">&quot;secret&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_account_name&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_container&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;subscription_id&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;tenant&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span>
<span class="p">},</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;WAITING&quot;</span><span class="p">,</span>
<span class="s2">&quot;uuid&quot;</span><span class="p">:</span> <span class="s2">&quot;21898dfd-9ac9-4e22-bb1d-7f12d0129e65&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.v1.v1_compose_info">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v1.</code><code class="sig-name descname">v1_compose_info</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v1.html#v1_compose_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v1.v1_compose_info" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Return detailed info about a compose</p>
<p><strong>/api/v1/compose/info/&lt;uuid&gt;</strong></p>
<blockquote>
<div><p>Get detailed information about the compose. The returned JSON string will
contain the following information:</p>
<blockquote>
<div><ul class="simple">
<li><p>id - The uuid of the comoposition</p></li>
<li><p>config - containing the configuration settings used to run Anaconda</p></li>
<li><p>blueprint - The depsolved blueprint used to generate the kickstart</p></li>
<li><p>commit - The (local) git commit hash for the blueprint used</p></li>
<li><p>deps - The NEVRA of all of the dependencies used in the composition</p></li>
<li><p>compose_type - The type of output generated (tar, iso, etc.)</p></li>
<li><p>queue_status - The final status of the composition (FINISHED or FAILED)</p></li>
</ul>
</div></blockquote>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;commit&quot;</span><span class="p">:</span> <span class="s2">&quot;7078e521a54b12eae31c3fd028680da7a0815a4d&quot;</span><span class="p">,</span>
<span class="s2">&quot;compose_type&quot;</span><span class="p">:</span> <span class="s2">&quot;tar&quot;</span><span class="p">,</span>
<span class="s2">&quot;config&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;anaconda_args&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="s2">&quot;armplatform&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="s2">&quot;compress_args&quot;</span><span class="p">:</span> <span class="p">[],</span>
<span class="s2">&quot;compression&quot;</span><span class="p">:</span> <span class="s2">&quot;xz&quot;</span><span class="p">,</span>
<span class="s2">&quot;image_name&quot;</span><span class="p">:</span> <span class="s2">&quot;root.tar.xz&quot;</span><span class="p">,</span>
<span class="o">...</span>
<span class="p">},</span>
<span class="s2">&quot;deps&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;packages&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;arch&quot;</span><span class="p">:</span> <span class="s2">&quot;x86_64&quot;</span><span class="p">,</span>
<span class="s2">&quot;epoch&quot;</span><span class="p">:</span> <span class="s2">&quot;0&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;acl&quot;</span><span class="p">,</span>
<span class="s2">&quot;release&quot;</span><span class="p">:</span> <span class="s2">&quot;14.el7&quot;</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;2.2.51&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">},</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;c30b7d80-523b-4a23-ad52-61b799739ce8&quot;</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="s2">&quot;FINISHED&quot;</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;description&quot;</span><span class="p">:</span> <span class="s2">&quot;An example kubernetes master&quot;</span><span class="p">,</span>
<span class="o">...</span>
<span class="p">},</span>
<span class="s2">&quot;uploads&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;creation_time&quot;</span><span class="p">:</span> <span class="mf">1568150660.524401</span><span class="p">,</span>
<span class="s2">&quot;image_name&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs server&quot;</span><span class="p">,</span>
<span class="s2">&quot;image_path&quot;</span><span class="p">:</span> <span class="s2">&quot;/var/lib/lorax/composer/results/c30b7d80-523b-4a23-ad52-61b799739ce8/disk.vhd&quot;</span><span class="p">,</span>
<span class="s2">&quot;provider_name&quot;</span><span class="p">:</span> <span class="s2">&quot;azure&quot;</span><span class="p">,</span>
<span class="s2">&quot;settings&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;client_id&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;location&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;resource_group&quot;</span><span class="p">:</span> <span class="s2">&quot;group&quot;</span><span class="p">,</span>
<span class="s2">&quot;secret&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_account_name&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_container&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;subscription_id&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;tenant&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span>
<span class="p">},</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;FAILED&quot;</span><span class="p">,</span>
<span class="s2">&quot;uuid&quot;</span><span class="p">:</span> <span class="s2">&quot;21898dfd-9ac9-4e22-bb1d-7f12d0129e65&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.v1.v1_compose_queue">
<code class="sig-prename descclassname">pylorax.api.v1.</code><code class="sig-name descname">v1_compose_queue</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v1.html#v1_compose_queue"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v1.v1_compose_queue" title="Permalink to this definition"></a></dt>
<dd><p>Return the status of the new and running queues</p>
<p><strong>/api/v1/compose/queue</strong></p>
<blockquote>
<div><p>Return the status of the build queue. It includes information about the builds waiting,
and the build that is running.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;new&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;45502a6d-06e8-48a5-a215-2b4174b3614b&quot;</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs&quot;</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="s2">&quot;WAITING&quot;</span><span class="p">,</span>
<span class="s2">&quot;job_created&quot;</span><span class="p">:</span> <span class="mf">1517362647.4570868</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.6&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;6d292bd0-bec7-4825-8d7d-41ef9c3e4b73&quot;</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="s2">&quot;kubernetes&quot;</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="s2">&quot;WAITING&quot;</span><span class="p">,</span>
<span class="s2">&quot;job_created&quot;</span><span class="p">:</span> <span class="mf">1517362659.0034983</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.1&quot;</span>
<span class="p">}</span>
<span class="p">],</span>
<span class="s2">&quot;run&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;745712b2-96db-44c0-8014-fe925c35e795&quot;</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs&quot;</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="s2">&quot;RUNNING&quot;</span><span class="p">,</span>
<span class="s2">&quot;job_created&quot;</span><span class="p">:</span> <span class="mf">1517362633.7965999</span><span class="p">,</span>
<span class="s2">&quot;job_started&quot;</span><span class="p">:</span> <span class="mf">1517362633.8001345</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.6&quot;</span><span class="p">,</span>
<span class="s2">&quot;uploads&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;creation_time&quot;</span><span class="p">:</span> <span class="mf">1568150660.524401</span><span class="p">,</span>
<span class="s2">&quot;image_name&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs server&quot;</span><span class="p">,</span>
<span class="s2">&quot;image_path&quot;</span><span class="p">:</span> <span class="n">null</span><span class="p">,</span>
<span class="s2">&quot;provider_name&quot;</span><span class="p">:</span> <span class="s2">&quot;azure&quot;</span><span class="p">,</span>
<span class="s2">&quot;settings&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;client_id&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;location&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;resource_group&quot;</span><span class="p">:</span> <span class="s2">&quot;group&quot;</span><span class="p">,</span>
<span class="s2">&quot;secret&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_account_name&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_container&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;subscription_id&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;tenant&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span>
<span class="p">},</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;WAITING&quot;</span><span class="p">,</span>
<span class="s2">&quot;uuid&quot;</span><span class="p">:</span> <span class="s2">&quot;21898dfd-9ac9-4e22-bb1d-7f12d0129e65&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.v1.v1_compose_start">
<code class="sig-prename descclassname">pylorax.api.v1.</code><code class="sig-name descname">v1_compose_start</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v1.html#v1_compose_start"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v1.v1_compose_start" title="Permalink to this definition"></a></dt>
<dd><p>Start a compose</p>
<dl class="simple">
<dt>The body of the post should have these fields:</dt><dd><p>blueprint_name - The blueprint name from /blueprints/list/
compose_type - The type of output to create, from /compose/types
branch - Optional, defaults to master, selects the git branch to use for the blueprint.</p>
</dd>
</dl>
<p><strong>POST /api/v1/compose</strong></p>
<blockquote>
<div><p>Start a compose. The content type should be 'application/json' and the body of the POST
should look like this. The &quot;upload&quot; object is optional.</p>
<p>The upload object can specify either a pre-existing profile to use (as returned by
<cite>/uploads/providers</cite>) or one-time use settings for the provider.</p>
<p>Example with upload profile:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;blueprint_name&quot;</span><span class="p">:</span> <span class="s2">&quot;http-server&quot;</span><span class="p">,</span>
<span class="s2">&quot;compose_type&quot;</span><span class="p">:</span> <span class="s2">&quot;tar&quot;</span><span class="p">,</span>
<span class="s2">&quot;branch&quot;</span><span class="p">:</span> <span class="s2">&quot;master&quot;</span><span class="p">,</span>
<span class="s2">&quot;upload&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;image_name&quot;</span><span class="p">:</span> <span class="s2">&quot;My Image&quot;</span><span class="p">,</span>
<span class="s2">&quot;provider&quot;</span><span class="p">:</span> <span class="s2">&quot;azure&quot;</span><span class="p">,</span>
<span class="s2">&quot;profile&quot;</span><span class="p">:</span> <span class="s2">&quot;production-azure-settings&quot;</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Example with upload settings:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;blueprint_name&quot;</span><span class="p">:</span> <span class="s2">&quot;http-server&quot;</span><span class="p">,</span>
<span class="s2">&quot;compose_type&quot;</span><span class="p">:</span> <span class="s2">&quot;tar&quot;</span><span class="p">,</span>
<span class="s2">&quot;branch&quot;</span><span class="p">:</span> <span class="s2">&quot;master&quot;</span><span class="p">,</span>
<span class="s2">&quot;upload&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;image_name&quot;</span><span class="p">:</span> <span class="s2">&quot;My Image&quot;</span><span class="p">,</span>
<span class="s2">&quot;provider&quot;</span><span class="p">:</span> <span class="s2">&quot;azure&quot;</span><span class="p">,</span>
<span class="s2">&quot;settings&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;resource_group&quot;</span><span class="p">:</span> <span class="s2">&quot;SOMEBODY&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_account_name&quot;</span><span class="p">:</span> <span class="s2">&quot;ONCE&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_container&quot;</span><span class="p">:</span> <span class="s2">&quot;TOLD&quot;</span><span class="p">,</span>
<span class="s2">&quot;location&quot;</span><span class="p">:</span> <span class="s2">&quot;ME&quot;</span><span class="p">,</span>
<span class="s2">&quot;subscription_id&quot;</span><span class="p">:</span> <span class="s2">&quot;THE&quot;</span><span class="p">,</span>
<span class="s2">&quot;client_id&quot;</span><span class="p">:</span> <span class="s2">&quot;WORLD&quot;</span><span class="p">,</span>
<span class="s2">&quot;secret&quot;</span><span class="p">:</span> <span class="s2">&quot;IS&quot;</span><span class="p">,</span>
<span class="s2">&quot;tenant&quot;</span><span class="p">:</span> <span class="s2">&quot;GONNA&quot;</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Pass it the name of the blueprint, the type of output (from
'/api/v1/compose/types'), and the blueprint branch to use. 'branch' is
optional and will default to master. It will create a new build and add
it to the queue. It returns the build uuid and a status if it succeeds.
If an &quot;upload&quot; is given, it will schedule an upload to run when the build
finishes.</p>
<p>Example response:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;build_id&quot;</span><span class="p">:</span> <span class="s2">&quot;e6fa6db4-9c81-4b70-870f-a697ca405cdf&quot;</span><span class="p">,</span>
<span class="s2">&quot;upload_id&quot;</span><span class="p">:</span> <span class="s2">&quot;572eb0d0-5348-4600-9666-14526ba628bb&quot;</span><span class="p">,</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="n">true</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.v1.v1_compose_status">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v1.</code><code class="sig-name descname">v1_compose_status</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">uuids</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v1.html#v1_compose_status"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v1.v1_compose_status" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Return the status of the listed uuids</p>
<p><strong>/api/v1/compose/status/&lt;uuids&gt;[?blueprint=&lt;blueprint_name&gt;&amp;status=&lt;compose_status&gt;&amp;type=&lt;compose_type&gt;]</strong></p>
<blockquote>
<div><p>Return the details for each of the comma-separated list of uuids. A uuid of '*' will return
details for all composes.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;uuids&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;8c8435ef-d6bd-4c68-9bf1-a2ef832e6b1a&quot;</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="s2">&quot;http-server&quot;</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="s2">&quot;FINISHED&quot;</span><span class="p">,</span>
<span class="s2">&quot;job_created&quot;</span><span class="p">:</span> <span class="mf">1517523644.2384307</span><span class="p">,</span>
<span class="s2">&quot;job_started&quot;</span><span class="p">:</span> <span class="mf">1517523644.2551234</span><span class="p">,</span>
<span class="s2">&quot;job_finished&quot;</span><span class="p">:</span> <span class="mf">1517523689.9864314</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.2&quot;</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;45502a6d-06e8-48a5-a215-2b4174b3614b&quot;</span><span class="p">,</span>
<span class="s2">&quot;blueprint&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs&quot;</span><span class="p">,</span>
<span class="s2">&quot;queue_status&quot;</span><span class="p">:</span> <span class="s2">&quot;FINISHED&quot;</span><span class="p">,</span>
<span class="s2">&quot;job_created&quot;</span><span class="p">:</span> <span class="mf">1517363442.188399</span><span class="p">,</span>
<span class="s2">&quot;job_started&quot;</span><span class="p">:</span> <span class="mf">1517363442.325324</span><span class="p">,</span>
<span class="s2">&quot;job_finished&quot;</span><span class="p">:</span> <span class="mf">1517363451.653621</span><span class="p">,</span>
<span class="s2">&quot;version&quot;</span><span class="p">:</span> <span class="s2">&quot;0.0.6&quot;</span><span class="p">,</span>
<span class="s2">&quot;uploads&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="p">{</span>
<span class="s2">&quot;creation_time&quot;</span><span class="p">:</span> <span class="mf">1568150660.524401</span><span class="p">,</span>
<span class="s2">&quot;image_name&quot;</span><span class="p">:</span> <span class="s2">&quot;glusterfs server&quot;</span><span class="p">,</span>
<span class="s2">&quot;image_path&quot;</span><span class="p">:</span> <span class="n">null</span><span class="p">,</span>
<span class="s2">&quot;provider_name&quot;</span><span class="p">:</span> <span class="s2">&quot;azure&quot;</span><span class="p">,</span>
<span class="s2">&quot;settings&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;client_id&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;location&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;resource_group&quot;</span><span class="p">:</span> <span class="s2">&quot;group&quot;</span><span class="p">,</span>
<span class="s2">&quot;secret&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_account_name&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_container&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;subscription_id&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span><span class="p">,</span>
<span class="s2">&quot;tenant&quot;</span><span class="p">:</span> <span class="s2">&quot;need&quot;</span>
<span class="p">},</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;WAITING&quot;</span><span class="p">,</span>
<span class="s2">&quot;uuid&quot;</span><span class="p">:</span> <span class="s2">&quot;21898dfd-9ac9-4e22-bb1d-7f12d0129e65&quot;</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.v1.v1_compose_uploads_delete">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v1.</code><code class="sig-name descname">v1_compose_uploads_delete</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">upload_uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v1.html#v1_compose_uploads_delete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v1.v1_compose_uploads_delete" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Delete an upload and disassociate it from its compose</p>
<p><strong>DELETE /api/v1/upload/delete/&lt;upload_uuid&gt;</strong></p>
<blockquote>
<div><p>Example response:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;upload_id&quot;</span><span class="p">:</span> <span class="s2">&quot;572eb0d0-5348-4600-9666-14526ba628bb&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.v1.v1_compose_uploads_schedule">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v1.</code><code class="sig-name descname">v1_compose_uploads_schedule</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">compose_uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v1.html#v1_compose_uploads_schedule"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v1.v1_compose_uploads_schedule" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Schedule an upload of a compose to a given cloud provider</p>
<p><strong>POST /api/v1/uploads/schedule/&lt;compose_uuid&gt;</strong></p>
<blockquote>
<div><p>The body can specify either a pre-existing profile to use (as returned by
<cite>/uploads/providers</cite>) or one-time use settings for the provider.</p>
<p>Example with upload profile:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;image_name&quot;</span><span class="p">:</span> <span class="s2">&quot;My Image&quot;</span><span class="p">,</span>
<span class="s2">&quot;provider&quot;</span><span class="p">:</span> <span class="s2">&quot;azure&quot;</span><span class="p">,</span>
<span class="s2">&quot;profile&quot;</span><span class="p">:</span> <span class="s2">&quot;production-azure-settings&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Example with upload settings:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;image_name&quot;</span><span class="p">:</span> <span class="s2">&quot;My Image&quot;</span><span class="p">,</span>
<span class="s2">&quot;provider&quot;</span><span class="p">:</span> <span class="s2">&quot;azure&quot;</span><span class="p">,</span>
<span class="s2">&quot;settings&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;resource_group&quot;</span><span class="p">:</span> <span class="s2">&quot;SOMEBODY&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_account_name&quot;</span><span class="p">:</span> <span class="s2">&quot;ONCE&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_container&quot;</span><span class="p">:</span> <span class="s2">&quot;TOLD&quot;</span><span class="p">,</span>
<span class="s2">&quot;location&quot;</span><span class="p">:</span> <span class="s2">&quot;ME&quot;</span><span class="p">,</span>
<span class="s2">&quot;subscription_id&quot;</span><span class="p">:</span> <span class="s2">&quot;THE&quot;</span><span class="p">,</span>
<span class="s2">&quot;client_id&quot;</span><span class="p">:</span> <span class="s2">&quot;WORLD&quot;</span><span class="p">,</span>
<span class="s2">&quot;secret&quot;</span><span class="p">:</span> <span class="s2">&quot;IS&quot;</span><span class="p">,</span>
<span class="s2">&quot;tenant&quot;</span><span class="p">:</span> <span class="s2">&quot;GONNA&quot;</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Example response:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;upload_id&quot;</span><span class="p">:</span> <span class="s2">&quot;572eb0d0-5348-4600-9666-14526ba628bb&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.v1.v1_projects_source_info">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v1.</code><code class="sig-name descname">v1_projects_source_info</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">source_ids</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v1.html#v1_projects_source_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v1.v1_projects_source_info" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Return detailed info about the list of sources</p>
<p><strong>/api/v1/projects/source/info/&lt;source-ids&gt;</strong></p>
<blockquote>
<div><p>Return information about the comma-separated list of source ids. Or all of the
sources if '*' is passed. Note that general globbing is not supported, only '*'.</p>
<p>Immutable system sources will have the &quot;system&quot; field set to true. User added sources
will have it set to false. System sources cannot be changed or deleted.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;errors&quot;</span><span class="p">:</span> <span class="p">[],</span>
<span class="s2">&quot;sources&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;fedora&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;check_gpg&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;check_ssl&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;gpgkey_urls&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="s2">&quot;file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-28-x86_64&quot;</span>
<span class="p">],</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;fedora&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Fedora $releasever - $basearch&quot;</span><span class="p">,</span>
<span class="s2">&quot;proxy&quot;</span><span class="p">:</span> <span class="s2">&quot;http://proxy.brianlane.com:8123&quot;</span><span class="p">,</span>
<span class="s2">&quot;system&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;yum-metalink&quot;</span><span class="p">,</span>
<span class="s2">&quot;url&quot;</span><span class="p">:</span> <span class="s2">&quot;https://mirrors.fedoraproject.org/metalink?repo=fedora-28&amp;arch=x86_64&quot;</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
<p>In v0 the <code class="docutils literal notranslate"><span class="pre">name</span></code> field was used for the id (a short name for the repo). In v1 <code class="docutils literal notranslate"><span class="pre">name</span></code> changed
to <code class="docutils literal notranslate"><span class="pre">id</span></code> and <code class="docutils literal notranslate"><span class="pre">name</span></code> is now used for the longer descriptive name of the repository.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.v1.v1_projects_source_new">
<code class="sig-prename descclassname">pylorax.api.v1.</code><code class="sig-name descname">v1_projects_source_new</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v1.html#v1_projects_source_new"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v1.v1_projects_source_new" title="Permalink to this definition"></a></dt>
<dd><p>Add a new package source. Or change an existing one</p>
<p><strong>POST /api/v1/projects/source/new</strong></p>
<blockquote>
<div><p>Add (or change) a source for use when depsolving blueprints and composing images.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">proxy</span></code> and <code class="docutils literal notranslate"><span class="pre">gpgkey_urls</span></code> entries are optional. All of the others are required. The supported
types for the urls are:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">yum-baseurl</span></code> is a URL to a yum repository.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">yum-mirrorlist</span></code> is a URL for a mirrorlist.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">yum-metalink</span></code> is a URL for a metalink.</p></li>
</ul>
<p>If <code class="docutils literal notranslate"><span class="pre">check_ssl</span></code> is true the https certificates must be valid. If they are self-signed you can either set
this to false, or add your Certificate Authority to the host system.</p>
<p>If <code class="docutils literal notranslate"><span class="pre">check_gpg</span></code> is true the GPG key must either be installed on the host system, or <code class="docutils literal notranslate"><span class="pre">gpgkey_urls</span></code>
should point to it.</p>
<p>You can edit an existing source (other than system sources), by doing a POST
of the new version of the source. It will overwrite the previous one.</p>
<p>Example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="s2">&quot;custom-source-1&quot;</span><span class="p">,</span>
<span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;Custom Package Source #1&quot;</span><span class="p">,</span>
<span class="s2">&quot;url&quot;</span><span class="p">:</span> <span class="s2">&quot;https://url/path/to/repository/&quot;</span><span class="p">,</span>
<span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;yum-baseurl&quot;</span><span class="p">,</span>
<span class="s2">&quot;check_ssl&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;check_gpg&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;gpgkey_urls&quot;</span><span class="p">:</span> <span class="p">[</span>
<span class="s2">&quot;https://url/path/to/gpg-key&quot;</span>
<span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
<p>In v0 the <code class="docutils literal notranslate"><span class="pre">name</span></code> field was used for the id (a short name for the repo). In v1 <code class="docutils literal notranslate"><span class="pre">name</span></code> changed
to <code class="docutils literal notranslate"><span class="pre">id</span></code> and <code class="docutils literal notranslate"><span class="pre">name</span></code> is now used for the longer descriptive name of the repository.</p>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.v1.v1_providers_delete">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v1.</code><code class="sig-name descname">v1_providers_delete</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">provider_name</span></em>, <em class="sig-param"><span class="n">profile</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v1.html#v1_providers_delete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v1.v1_providers_delete" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Delete a provider's profile settings</p>
<p><strong>DELETE /api/v1/upload/providers/delete/&lt;provider_name&gt;/&lt;profile&gt;</strong></p>
<blockquote>
<div><p>Example response:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="n">true</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.v1.v1_providers_save">
<code class="sig-prename descclassname">pylorax.api.v1.</code><code class="sig-name descname">v1_providers_save</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v1.html#v1_providers_save"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v1.v1_providers_save" title="Permalink to this definition"></a></dt>
<dd><p>Save provider settings as a profile for later use</p>
<p><strong>POST /api/v1/upload/providers/save</strong></p>
<blockquote>
<div><p>Example request:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;provider&quot;</span><span class="p">:</span> <span class="s2">&quot;azure&quot;</span><span class="p">,</span>
<span class="s2">&quot;profile&quot;</span><span class="p">:</span> <span class="s2">&quot;my-profile&quot;</span><span class="p">,</span>
<span class="s2">&quot;settings&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;resource_group&quot;</span><span class="p">:</span> <span class="s2">&quot;SOMEBODY&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_account_name&quot;</span><span class="p">:</span> <span class="s2">&quot;ONCE&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_container&quot;</span><span class="p">:</span> <span class="s2">&quot;TOLD&quot;</span><span class="p">,</span>
<span class="s2">&quot;location&quot;</span><span class="p">:</span> <span class="s2">&quot;ME&quot;</span><span class="p">,</span>
<span class="s2">&quot;subscription_id&quot;</span><span class="p">:</span> <span class="s2">&quot;THE&quot;</span><span class="p">,</span>
<span class="s2">&quot;client_id&quot;</span><span class="p">:</span> <span class="s2">&quot;WORLD&quot;</span><span class="p">,</span>
<span class="s2">&quot;secret&quot;</span><span class="p">:</span> <span class="s2">&quot;IS&quot;</span><span class="p">,</span>
<span class="s2">&quot;tenant&quot;</span><span class="p">:</span> <span class="s2">&quot;GONNA&quot;</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Saving to an existing profile will overwrite it.</p>
<p>Example response:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="n">true</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.v1.v1_upload_cancel">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v1.</code><code class="sig-name descname">v1_upload_cancel</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">upload_uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v1.html#v1_upload_cancel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v1.v1_upload_cancel" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Cancel an upload that is either queued or in progress</p>
2019-12-19 21:50:22 +00:00
<p><strong>DELETE /api/v1/upload/cancel/&lt;upload_uuid&gt;</strong></p>
2019-10-16 23:14:02 +00:00
<blockquote>
<div><p>Example response:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;upload_id&quot;</span><span class="p">:</span> <span class="s2">&quot;037a3d56-b421-43e9-9935-c98350c89996&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.v1.v1_upload_info">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v1.</code><code class="sig-name descname">v1_upload_info</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">upload_uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v1.html#v1_upload_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v1.v1_upload_info" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Returns information about a given upload</p>
<p><strong>GET /api/v1/upload/info/&lt;upload_uuid&gt;</strong></p>
<blockquote>
<div><p>Example response:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;upload&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;creation_time&quot;</span><span class="p">:</span> <span class="mf">1565620940.069004</span><span class="p">,</span>
<span class="s2">&quot;image_name&quot;</span><span class="p">:</span> <span class="s2">&quot;My Image&quot;</span><span class="p">,</span>
<span class="s2">&quot;image_path&quot;</span><span class="p">:</span> <span class="s2">&quot;/var/lib/lorax/composer/results/b6218e8f-0fa2-48ec-9394-f5c2918544c4/disk.vhd&quot;</span><span class="p">,</span>
<span class="s2">&quot;provider_name&quot;</span><span class="p">:</span> <span class="s2">&quot;azure&quot;</span><span class="p">,</span>
<span class="s2">&quot;settings&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;resource_group&quot;</span><span class="p">:</span> <span class="s2">&quot;SOMEBODY&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_account_name&quot;</span><span class="p">:</span> <span class="s2">&quot;ONCE&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_container&quot;</span><span class="p">:</span> <span class="s2">&quot;TOLD&quot;</span><span class="p">,</span>
<span class="s2">&quot;location&quot;</span><span class="p">:</span> <span class="s2">&quot;ME&quot;</span><span class="p">,</span>
<span class="s2">&quot;subscription_id&quot;</span><span class="p">:</span> <span class="s2">&quot;THE&quot;</span><span class="p">,</span>
<span class="s2">&quot;client_id&quot;</span><span class="p">:</span> <span class="s2">&quot;WORLD&quot;</span><span class="p">,</span>
<span class="s2">&quot;secret&quot;</span><span class="p">:</span> <span class="s2">&quot;IS&quot;</span><span class="p">,</span>
<span class="s2">&quot;tenant&quot;</span><span class="p">:</span> <span class="s2">&quot;GONNA&quot;</span>
<span class="p">},</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="s2">&quot;FAILED&quot;</span><span class="p">,</span>
<span class="s2">&quot;uuid&quot;</span><span class="p">:</span> <span class="s2">&quot;b637c411-9d9d-4279-b067-6c8d38e3b211&quot;</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.v1.v1_upload_log">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v1.</code><code class="sig-name descname">v1_upload_log</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">upload_uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v1.html#v1_upload_log"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v1.v1_upload_log" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Returns an upload's log</p>
<p><strong>GET /api/v1/upload/log/&lt;upload_uuid&gt;</strong></p>
<blockquote>
<div><p>Example response:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;upload_id&quot;</span><span class="p">:</span> <span class="s2">&quot;b637c411-9d9d-4279-b067-6c8d38e3b211&quot;</span><span class="p">,</span>
<span class="s2">&quot;log&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt; PLAY [localhost] &gt;...&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.v1.v1_upload_providers">
<code class="sig-prename descclassname">pylorax.api.v1.</code><code class="sig-name descname">v1_upload_providers</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v1.html#v1_upload_providers"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v1.v1_upload_providers" title="Permalink to this definition"></a></dt>
<dd><p>Return the information about all upload providers, including their
display names, expected settings, and saved profiles. Refer to the
<cite>resolve_provider</cite> function.</p>
<p><strong>GET /api/v1/upload/providers</strong></p>
<blockquote>
<div><p>Example response:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;providers&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;azure&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;display&quot;</span><span class="p">:</span> <span class="s2">&quot;Azure&quot;</span><span class="p">,</span>
<span class="s2">&quot;profiles&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;default&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;client_id&quot;</span><span class="p">:</span> <span class="s2">&quot;example&quot;</span><span class="p">,</span>
<span class="o">...</span>
<span class="p">}</span>
<span class="p">},</span>
<span class="s2">&quot;settings-info&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;client_id&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;display&quot;</span><span class="p">:</span> <span class="s2">&quot;Client ID&quot;</span><span class="p">,</span>
<span class="s2">&quot;placeholder&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="s2">&quot;regex&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;string&quot;</span>
<span class="p">},</span>
<span class="o">...</span>
<span class="p">},</span>
<span class="s2">&quot;supported_types&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;vhd&quot;</span><span class="p">]</span>
<span class="p">},</span>
<span class="o">...</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
2019-10-16 23:14:02 +00:00
<dt id="pylorax.api.v1.v1_upload_reset">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.v1.</code><code class="sig-name descname">v1_upload_reset</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">upload_uuid</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/v1.html#v1_upload_reset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.v1.v1_upload_reset" title="Permalink to this definition"></a></dt>
2019-10-16 23:14:02 +00:00
<dd><p>Reset an upload so it can be attempted again</p>
<p><strong>POST /api/v1/upload/reset/&lt;upload_uuid&gt;</strong></p>
<blockquote>
<div><p>Optionally pass in a new image name and/or new settings.</p>
<p>Example request:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;image_name&quot;</span><span class="p">:</span> <span class="s2">&quot;My renamed image&quot;</span><span class="p">,</span>
<span class="s2">&quot;settings&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;resource_group&quot;</span><span class="p">:</span> <span class="s2">&quot;ROLL&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_account_name&quot;</span><span class="p">:</span> <span class="s2">&quot;ME&quot;</span><span class="p">,</span>
<span class="s2">&quot;storage_container&quot;</span><span class="p">:</span> <span class="s2">&quot;I&quot;</span><span class="p">,</span>
<span class="s2">&quot;location&quot;</span><span class="p">:</span> <span class="s2">&quot;AIN&#39;T&quot;</span><span class="p">,</span>
<span class="s2">&quot;subscription_id&quot;</span><span class="p">:</span> <span class="s2">&quot;THE&quot;</span><span class="p">,</span>
<span class="s2">&quot;client_id&quot;</span><span class="p">:</span> <span class="s2">&quot;SHARPEST&quot;</span><span class="p">,</span>
<span class="s2">&quot;secret&quot;</span><span class="p">:</span> <span class="s2">&quot;TOOL&quot;</span><span class="p">,</span>
<span class="s2">&quot;tenant&quot;</span><span class="p">:</span> <span class="s2">&quot;IN&quot;</span>
<span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Example response:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;status&quot;</span><span class="p">:</span> <span class="n">true</span><span class="p">,</span>
<span class="s2">&quot;upload_id&quot;</span><span class="p">:</span> <span class="s2">&quot;c75d5d62-9d26-42fc-a8ef-18bb14679fc7&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
</div>
<div class="section" id="module-pylorax.api.workspace">
<span id="pylorax-api-workspace-module"></span><h2>pylorax.api.workspace module<a class="headerlink" href="#module-pylorax.api.workspace" title="Permalink to this headline"></a></h2>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.workspace.workspace_delete">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.workspace.</code><code class="sig-name descname">workspace_delete</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">recipe_name</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/workspace.html#workspace_delete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.workspace.workspace_delete" title="Permalink to this definition"></a></dt>
<dd><p>Delete the recipe from the workspace</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>recipe_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The name of the recipe</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>None</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p>IO related errors</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.workspace.workspace_dir">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.workspace.</code><code class="sig-name descname">workspace_dir</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/workspace.html#workspace_dir"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.workspace.workspace_dir" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Create the workspace's path from a Repository and branch</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The path to the branch's workspace directory</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
2019-03-27 23:44:17 +00:00
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.workspace.workspace_exists">
<code class="sig-prename descclassname">pylorax.api.workspace.</code><code class="sig-name descname">workspace_exists</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">recipe_name</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/workspace.html#workspace_exists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.workspace.workspace_exists" title="Permalink to this definition"></a></dt>
<dd><p>Return true of the workspace recipe exists</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>recipe_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The name of the recipe</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True if the file exists</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.8)">bool</a></p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pylorax.api.workspace.workspace_filename">
<code class="sig-prename descclassname">pylorax.api.workspace.</code><code class="sig-name descname">workspace_filename</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">recipe_name</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/workspace.html#workspace_filename"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.workspace.workspace_filename" title="Permalink to this definition"></a></dt>
<dd><p>Return the path and filename of the workspace recipe</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>recipe_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The name of the recipe</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>workspace recipe path and filename</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)">str</a></p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pylorax.api.workspace.workspace_read">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.workspace.</code><code class="sig-name descname">workspace_read</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">recipe_name</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/workspace.html#workspace_read"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.workspace.workspace_read" title="Permalink to this definition"></a></dt>
2019-03-27 23:44:17 +00:00
<dd><p>Read a Recipe from the branch's workspace</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
<li><p><strong>recipe_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- The name of the recipe</p></li>
2019-03-27 23:44:17 +00:00
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The workspace copy of the recipe, or None if it doesn't exist</p>
</dd>
<dt class="field-odd">Return type</dt>
2019-10-16 23:14:02 +00:00
<dd class="field-odd"><p><a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe">Recipe</a> or <a class="reference external" href="https://docs.python.org/3/library/constants.html#None" title="(in Python v3.8)">None</a></p>
2019-03-27 23:44:17 +00:00
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p>RecipeFileError</p>
</dd>
</dl>
</dd></dl>
2020-10-07 17:56:09 +00:00
<dl class="py function">
<dt id="pylorax.api.workspace.workspace_write">
2020-10-07 17:56:09 +00:00
<code class="sig-prename descclassname">pylorax.api.workspace.</code><code class="sig-name descname">workspace_write</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repo</span></em>, <em class="sig-param"><span class="n">branch</span></em>, <em class="sig-param"><span class="n">recipe</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pylorax/api/workspace.html#workspace_write"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pylorax.api.workspace.workspace_write" title="Permalink to this definition"></a></dt>
<dd><p>Write a recipe to the workspace</p>
2019-03-27 23:44:17 +00:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>repo</strong> (<em>Git.Repository</em>) -- Open repository</p></li>
2019-10-16 23:14:02 +00:00
<li><p><strong>branch</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.8)"><em>str</em></a>) -- Branch name</p></li>
2019-03-27 23:44:17 +00:00
<li><p><strong>recipe</strong> (<a class="reference internal" href="#pylorax.api.recipes.Recipe" title="pylorax.api.recipes.Recipe"><em>Recipe</em></a>) -- The recipe to write to the workspace</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>None</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p>IO related errors</p>
</dd>
</dl>
</dd></dl>
</div>
<div class="section" id="module-pylorax.api">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-pylorax.api" title="Permalink to this headline"></a></h2>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
2019-03-27 23:44:17 +00:00
<a href="pylorax.html" class="btn btn-neutral float-left" title="pylorax package" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
2019-03-27 23:44:17 +00:00
&copy; Copyright 2018, Red Hat, Inc.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
2018-06-04 23:34:57 +00:00
SphinxRtdTheme.Navigation.enable(true);
});
2019-03-27 23:44:17 +00:00
</script>
</body>
</html>