blob: 63a9c21a1c01ae895cddfdda5fa5befdcd5a253a [file] [log] [blame]
<!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">
<title>aria.storage &mdash; ARIA TOSCA 0.1.1 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html"/>
<link rel="top" title="ARIA TOSCA 0.1.1 documentation" href="index.html"/>
<link rel="next" title="aria.utils" href="aria.utils.html"/>
<link rel="prev" title="aria.parser.validation" href="aria.parser.validation.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> ARIA TOSCA
</a>
<div class="version">
0.1.1
</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>
<li class="toctree-l1"><a class="reference internal" href="cli.html">CLI</a></li>
<li class="toctree-l1"><a class="reference internal" href="rest.html">REST</a></li>
</ul>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="aria.html"><code class="docutils literal"><span class="pre">aria</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.cli.html"><code class="docutils literal"><span class="pre">aria.cli</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.modeling.html"><code class="docutils literal"><span class="pre">aria.modeling</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.modeling.models.html"><code class="docutils literal"><span class="pre">aria.modeling.models</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.orchestrator.html"><code class="docutils literal"><span class="pre">aria.orchestrator</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.orchestrator.context.html"><code class="docutils literal"><span class="pre">aria.orchestrator.context</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.orchestrator.execution_plugin.html"><code class="docutils literal"><span class="pre">aria.orchestrator.execution_plugin</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.orchestrator.execution_plugin.ctx_proxy.html"><code class="docutils literal"><span class="pre">aria.orchestrator.execution_plugin.ctx_proxy</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.orchestrator.execution_plugin.ssh.html"><code class="docutils literal"><span class="pre">aria.orchestrator.execution_plugin.ssh</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.orchestrator.workflows.html"><code class="docutils literal"><span class="pre">aria.orchestrator.workflows</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.orchestrator.workflows.api.html"><code class="docutils literal"><span class="pre">aria.orchestrator.workflows.api</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.orchestrator.workflows.builtin.html"><code class="docutils literal"><span class="pre">aria.orchestrator.workflows.builtin</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.orchestrator.workflows.executor.html"><code class="docutils literal"><span class="pre">aria.orchestrator.workflows.executor</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.parser.html"><code class="docutils literal"><span class="pre">aria.parser</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.parser.consumption.html"><code class="docutils literal"><span class="pre">aria.parser.consumption</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.parser.loading.html"><code class="docutils literal"><span class="pre">aria.parser.loading</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.parser.modeling.html"><code class="docutils literal"><span class="pre">aria.parser.modeling</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.parser.presentation.html"><code class="docutils literal"><span class="pre">aria.parser.presentation</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.parser.reading.html"><code class="docutils literal"><span class="pre">aria.parser.reading</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria.parser.validation.html"><code class="docutils literal"><span class="pre">aria.parser.validation</span></code></a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#"><code class="docutils literal"><span class="pre">aria.storage</span></code></a><ul>
<li class="toctree-l2"><a class="reference internal" href="#module-aria.storage.api"><code class="docutils literal"><span class="pre">aria.storage.api</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-aria.storage.collection_instrumentation"><code class="docutils literal"><span class="pre">aria.storage.collection_instrumentation</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-aria.storage.core"><code class="docutils literal"><span class="pre">aria.storage.core</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-aria.storage.exceptions"><code class="docutils literal"><span class="pre">aria.storage.exceptions</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-aria.storage.filesystem_rapi"><code class="docutils literal"><span class="pre">aria.storage.filesystem_rapi</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-aria.storage.sql_mapi"><code class="docutils literal"><span class="pre">aria.storage.sql_mapi</span></code></a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="aria.utils.html"><code class="docutils literal"><span class="pre">aria.utils</span></code></a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="aria_extension_tosca.simple_v1_0.html"><code class="docutils literal"><span class="pre">aria_extension_tosca.simple_v1_0</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria_extension_tosca.simple_v1_0.modeling.html"><code class="docutils literal"><span class="pre">aria_extension_tosca.simple_v1_0.modeling</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria_extension_tosca.simple_v1_0.presentation.html"><code class="docutils literal"><span class="pre">aria_extension_tosca.simple_v1_0.presentation</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="aria_extension_tosca.simple_nfv_v1_0.html"><code class="docutils literal"><span class="pre">aria_extension_tosca.simple_nfv_v1_0</span></code></a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">ARIA TOSCA</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><code class="docutils literal"><span class="pre">aria.storage</span></code></li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/aria.storage.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="module-aria.storage">
<span id="aria-storage"></span><h1><a class="reference internal" href="#module-aria.storage" title="aria.storage"><code class="xref py py-mod docutils literal"><span class="pre">aria.storage</span></code></a><a class="headerlink" href="#module-aria.storage" title="Permalink to this headline"></a></h1>
<p>Storage package.</p>
<dl class="class">
<dt id="aria.storage.Storage">
<em class="property">class </em><code class="descclassname">aria.storage.</code><code class="descname">Storage</code><span class="sig-paren">(</span><em>api_cls</em>, <em>api_kwargs=None</em>, <em>items=()</em>, <em>initiator=None</em>, <em>initiator_kwargs=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.Storage" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="aria.html#aria.logger.LoggerMixin" title="aria.logger.LoggerMixin"><code class="xref py py-class docutils literal"><span class="pre">aria.logger.LoggerMixin</span></code></a></p>
<p>Base class for storage managers.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>api_cls</strong> – API class for each entry</li>
<li><strong>api_kwargs</strong></li>
<li><strong>items</strong> – items to register</li>
<li><strong>initiator</strong> – function which initializes the storage before the first use; this function
should return a dict, this dict would be passed in addition to the API kwargs; this enables
the creation of non-serializable objects</li>
<li><strong>initiator_kwargs</strong></li>
<li><strong>kwargs</strong></li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="aria.storage.Storage.register">
<code class="descname">register</code><span class="sig-paren">(</span><em>entry</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.Storage.register" title="Permalink to this definition"></a></dt>
<dd><p>Register an API.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>entry</strong></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="aria.storage.Storage.serialization_dict">
<code class="descname">serialization_dict</code><a class="headerlink" href="#aria.storage.Storage.serialization_dict" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="aria.storage.ModelStorage">
<em class="property">class </em><code class="descclassname">aria.storage.</code><code class="descname">ModelStorage</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.ModelStorage" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#aria.storage.core.Storage" title="aria.storage.core.Storage"><code class="xref py py-class docutils literal"><span class="pre">aria.storage.core.Storage</span></code></a></p>
<p>Manages storage model APIs (“MAPIs”).</p>
<dl class="method">
<dt id="aria.storage.ModelStorage.drop">
<code class="descname">drop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.ModelStorage.drop" title="Permalink to this definition"></a></dt>
<dd><p>Drop all the tables.</p>
</dd></dl>
<dl class="method">
<dt id="aria.storage.ModelStorage.instrument">
<code class="descname">instrument</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwds</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.ModelStorage.instrument" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="aria.storage.ModelStorage.register">
<code class="descname">register</code><span class="sig-paren">(</span><em>model_cls</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.ModelStorage.register" title="Permalink to this definition"></a></dt>
<dd><p>Register a storage model API (“MAPI”).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>model_cls</strong> – model API to register</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="aria.storage.ResourceStorage">
<em class="property">class </em><code class="descclassname">aria.storage.</code><code class="descname">ResourceStorage</code><span class="sig-paren">(</span><em>api_cls</em>, <em>api_kwargs=None</em>, <em>items=()</em>, <em>initiator=None</em>, <em>initiator_kwargs=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.ResourceStorage" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#aria.storage.core.Storage" title="aria.storage.core.Storage"><code class="xref py py-class docutils literal"><span class="pre">aria.storage.core.Storage</span></code></a></p>
<p>Manages storage resource APIs (“RAPIs”).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>api_cls</strong> – API class for each entry</li>
<li><strong>api_kwargs</strong></li>
<li><strong>items</strong> – items to register</li>
<li><strong>initiator</strong> – function which initializes the storage before the first use; this function
should return a dict, this dict would be passed in addition to the API kwargs; this enables
the creation of non-serializable objects</li>
<li><strong>initiator_kwargs</strong></li>
<li><strong>kwargs</strong></li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="aria.storage.ResourceStorage.register">
<code class="descname">register</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.ResourceStorage.register" title="Permalink to this definition"></a></dt>
<dd><p>Register a storage resource API (“RAPI”).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> – name</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<div class="section" id="module-aria.storage.api">
<span id="aria-storage-api"></span><h2><a class="reference internal" href="#module-aria.storage.api" title="aria.storage.api"><code class="xref py py-mod docutils literal"><span class="pre">aria.storage.api</span></code></a><a class="headerlink" href="#module-aria.storage.api" title="Permalink to this headline"></a></h2>
<p>Storage APIs.</p>
<dl class="class">
<dt id="aria.storage.api.ModelAPI">
<em class="property">class </em><code class="descclassname">aria.storage.api.</code><code class="descname">ModelAPI</code><span class="sig-paren">(</span><em>model_cls</em>, <em>name=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.api.ModelAPI" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#aria.storage.api.StorageAPI" title="aria.storage.api.StorageAPI"><code class="xref py py-class docutils literal"><span class="pre">aria.storage.api.StorageAPI</span></code></a></p>
<p>Base class for model APIs (“MAPI”).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>model_cls</strong> – representing class of the model</li>
<li><strong>name</strong> – name of the model</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="aria.storage.api.ModelAPI.delete">
<code class="descname">delete</code><span class="sig-paren">(</span><em>entry_id</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.api.ModelAPI.delete" title="Permalink to this definition"></a></dt>
<dd><p>Deletes a model from storage.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>entry_id</strong></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="aria.storage.api.ModelAPI.get">
<code class="descname">get</code><span class="sig-paren">(</span><em>entry_id</em>, <em>filters=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.api.ModelAPI.get" title="Permalink to this definition"></a></dt>
<dd><p>Gets a model from storage.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>entry_id</strong></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="aria.storage.api.ModelAPI.iter">
<code class="descname">iter</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.api.ModelAPI.iter" title="Permalink to this definition"></a></dt>
<dd><p>Iterate over all models in storage.</p>
</dd></dl>
<dl class="attribute">
<dt id="aria.storage.api.ModelAPI.model_cls">
<code class="descname">model_cls</code><a class="headerlink" href="#aria.storage.api.ModelAPI.model_cls" title="Permalink to this definition"></a></dt>
<dd><p>Class representing the model</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body"><code class="xref py py-obj docutils literal"><span class="pre">Type</span></code></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="aria.storage.api.ModelAPI.name">
<code class="descname">name</code><a class="headerlink" href="#aria.storage.api.ModelAPI.name" title="Permalink to this definition"></a></dt>
<dd><p>Name of the class.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#basestring" title="(in Python v2.7)"><code class="xref py py-obj docutils literal"><span class="pre">basestring</span></code></a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="aria.storage.api.ModelAPI.put">
<code class="descname">put</code><span class="sig-paren">(</span><em>entry</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.api.ModelAPI.put" title="Permalink to this definition"></a></dt>
<dd><p>Puts a model in storage.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>entry</strong></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="aria.storage.api.ModelAPI.update">
<code class="descname">update</code><span class="sig-paren">(</span><em>entry</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.api.ModelAPI.update" title="Permalink to this definition"></a></dt>
<dd><p>Update a model in storage.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>entry</strong></li>
<li><strong>kwargs</strong></li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="aria.storage.api.ResourceAPI">
<em class="property">class </em><code class="descclassname">aria.storage.api.</code><code class="descname">ResourceAPI</code><span class="sig-paren">(</span><em>name</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.api.ResourceAPI" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#aria.storage.api.StorageAPI" title="aria.storage.api.StorageAPI"><code class="xref py py-class docutils literal"><span class="pre">aria.storage.api.StorageAPI</span></code></a></p>
<p>Base class for resource APIs (“RAPI”).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> – resource type</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="aria.storage.api.ResourceAPI.delete">
<code class="descname">delete</code><span class="sig-paren">(</span><em>entry_id</em>, <em>path</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.api.ResourceAPI.delete" title="Permalink to this definition"></a></dt>
<dd><p>Delete a resource from storage.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>entry_id</strong></li>
<li><strong>path</strong></li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="aria.storage.api.ResourceAPI.download">
<code class="descname">download</code><span class="sig-paren">(</span><em>entry_id</em>, <em>destination</em>, <em>path=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.api.ResourceAPI.download" title="Permalink to this definition"></a></dt>
<dd><p>Download a resource from storage.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>entry_id</strong></li>
<li><strong>destination</strong></li>
<li><strong>path</strong></li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="aria.storage.api.ResourceAPI.name">
<code class="descname">name</code><a class="headerlink" href="#aria.storage.api.ResourceAPI.name" title="Permalink to this definition"></a></dt>
<dd><p>Name of resource.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#basestring" title="(in Python v2.7)"><code class="xref py py-obj docutils literal"><span class="pre">basestring</span></code></a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="aria.storage.api.ResourceAPI.read">
<code class="descname">read</code><span class="sig-paren">(</span><em>entry_id</em>, <em>path</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.api.ResourceAPI.read" title="Permalink to this definition"></a></dt>
<dd><p>Get a bytesteam for a resource from storage.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>entry_id</strong></li>
<li><strong>path</strong></li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="aria.storage.api.ResourceAPI.upload">
<code class="descname">upload</code><span class="sig-paren">(</span><em>entry_id</em>, <em>source</em>, <em>path=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.api.ResourceAPI.upload" title="Permalink to this definition"></a></dt>
<dd><p>Upload a resource to storage.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>entry_id</strong></li>
<li><strong>source</strong></li>
<li><strong>path</strong></li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="aria.storage.api.StorageAPI">
<em class="property">class </em><code class="descclassname">aria.storage.api.</code><code class="descname">StorageAPI</code><a class="headerlink" href="#aria.storage.api.StorageAPI" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/2.7/library/functions.html#object" title="(in Python v2.7)"><code class="xref py py-class docutils literal"><span class="pre">object</span></code></a></p>
<p>Base class for storage APIs.</p>
<dl class="method">
<dt id="aria.storage.api.StorageAPI.create">
<code class="descname">create</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.api.StorageAPI.create" title="Permalink to this definition"></a></dt>
<dd><p>Create a storage API.
:param kwargs:
:return:</p>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="aria.storage.api.generate_lower_name">
<code class="descclassname">aria.storage.api.</code><code class="descname">generate_lower_name</code><span class="sig-paren">(</span><em>model_cls</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.api.generate_lower_name" title="Permalink to this definition"></a></dt>
<dd><p>Generates the name of the class from the class object, e.g. <code class="docutils literal"><span class="pre">SomeClass</span></code> -&gt; <code class="docutils literal"><span class="pre">some_class</span></code></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>model_cls</strong> – class to evaluate</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">lowercase name</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><a class="reference external" href="https://docs.python.org/2.7/library/functions.html#basestring" title="(in Python v2.7)">basestring</a></td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<div class="section" id="module-aria.storage.collection_instrumentation">
<span id="aria-storage-collection-instrumentation"></span><h2><a class="reference internal" href="#module-aria.storage.collection_instrumentation" title="aria.storage.collection_instrumentation"><code class="xref py py-mod docutils literal"><span class="pre">aria.storage.collection_instrumentation</span></code></a><a class="headerlink" href="#module-aria.storage.collection_instrumentation" title="Permalink to this headline"></a></h2>
<p>Utilities for instrumenting collections of models in storage.</p>
<dl class="function">
<dt id="aria.storage.collection_instrumentation.instrument">
<code class="descclassname">aria.storage.collection_instrumentation.</code><code class="descname">instrument</code><span class="sig-paren">(</span><em>instrumentation</em>, <em>original_model</em>, <em>mapi</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.collection_instrumentation.instrument" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
<div class="section" id="module-aria.storage.core">
<span id="aria-storage-core"></span><h2><a class="reference internal" href="#module-aria.storage.core" title="aria.storage.core"><code class="xref py py-mod docutils literal"><span class="pre">aria.storage.core</span></code></a><a class="headerlink" href="#module-aria.storage.core" title="Permalink to this headline"></a></h2>
<p>Storage API management.</p>
<dl class="class">
<dt id="aria.storage.core.Storage">
<em class="property">class </em><code class="descclassname">aria.storage.core.</code><code class="descname">Storage</code><span class="sig-paren">(</span><em>api_cls</em>, <em>api_kwargs=None</em>, <em>items=()</em>, <em>initiator=None</em>, <em>initiator_kwargs=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.core.Storage" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="aria.html#aria.logger.LoggerMixin" title="aria.logger.LoggerMixin"><code class="xref py py-class docutils literal"><span class="pre">aria.logger.LoggerMixin</span></code></a></p>
<p>Base class for storage managers.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>api_cls</strong> – API class for each entry</li>
<li><strong>api_kwargs</strong></li>
<li><strong>items</strong> – items to register</li>
<li><strong>initiator</strong> – function which initializes the storage before the first use; this function
should return a dict, this dict would be passed in addition to the API kwargs; this enables
the creation of non-serializable objects</li>
<li><strong>initiator_kwargs</strong></li>
<li><strong>kwargs</strong></li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="aria.storage.core.Storage.register">
<code class="descname">register</code><span class="sig-paren">(</span><em>entry</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.core.Storage.register" title="Permalink to this definition"></a></dt>
<dd><p>Register an API.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>entry</strong></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="aria.storage.core.Storage.serialization_dict">
<code class="descname">serialization_dict</code><a class="headerlink" href="#aria.storage.core.Storage.serialization_dict" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="aria.storage.core.ModelStorage">
<em class="property">class </em><code class="descclassname">aria.storage.core.</code><code class="descname">ModelStorage</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.core.ModelStorage" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#aria.storage.core.Storage" title="aria.storage.core.Storage"><code class="xref py py-class docutils literal"><span class="pre">aria.storage.core.Storage</span></code></a></p>
<p>Manages storage model APIs (“MAPIs”).</p>
<dl class="method">
<dt id="aria.storage.core.ModelStorage.drop">
<code class="descname">drop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.core.ModelStorage.drop" title="Permalink to this definition"></a></dt>
<dd><p>Drop all the tables.</p>
</dd></dl>
<dl class="method">
<dt id="aria.storage.core.ModelStorage.instrument">
<code class="descname">instrument</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwds</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.core.ModelStorage.instrument" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="aria.storage.core.ModelStorage.register">
<code class="descname">register</code><span class="sig-paren">(</span><em>model_cls</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.core.ModelStorage.register" title="Permalink to this definition"></a></dt>
<dd><p>Register a storage model API (“MAPI”).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>model_cls</strong> – model API to register</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="aria.storage.core.ResourceStorage">
<em class="property">class </em><code class="descclassname">aria.storage.core.</code><code class="descname">ResourceStorage</code><span class="sig-paren">(</span><em>api_cls</em>, <em>api_kwargs=None</em>, <em>items=()</em>, <em>initiator=None</em>, <em>initiator_kwargs=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.core.ResourceStorage" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#aria.storage.core.Storage" title="aria.storage.core.Storage"><code class="xref py py-class docutils literal"><span class="pre">aria.storage.core.Storage</span></code></a></p>
<p>Manages storage resource APIs (“RAPIs”).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>api_cls</strong> – API class for each entry</li>
<li><strong>api_kwargs</strong></li>
<li><strong>items</strong> – items to register</li>
<li><strong>initiator</strong> – function which initializes the storage before the first use; this function
should return a dict, this dict would be passed in addition to the API kwargs; this enables
the creation of non-serializable objects</li>
<li><strong>initiator_kwargs</strong></li>
<li><strong>kwargs</strong></li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="aria.storage.core.ResourceStorage.register">
<code class="descname">register</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.core.ResourceStorage.register" title="Permalink to this definition"></a></dt>
<dd><p>Register a storage resource API (“RAPI”).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> – name</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-aria.storage.exceptions">
<span id="aria-storage-exceptions"></span><h2><a class="reference internal" href="#module-aria.storage.exceptions" title="aria.storage.exceptions"><code class="xref py py-mod docutils literal"><span class="pre">aria.storage.exceptions</span></code></a><a class="headerlink" href="#module-aria.storage.exceptions" title="Permalink to this headline"></a></h2>
<p>Storage exceptions.</p>
<dl class="exception">
<dt id="aria.storage.exceptions.NotFoundError">
<em class="property">exception </em><code class="descclassname">aria.storage.exceptions.</code><code class="descname">NotFoundError</code><a class="headerlink" href="#aria.storage.exceptions.NotFoundError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#aria.storage.exceptions.StorageError" title="aria.storage.exceptions.StorageError"><code class="xref py py-class docutils literal"><span class="pre">aria.storage.exceptions.StorageError</span></code></a></p>
</dd></dl>
<dl class="exception">
<dt id="aria.storage.exceptions.StorageError">
<em class="property">exception </em><code class="descclassname">aria.storage.exceptions.</code><code class="descname">StorageError</code><a class="headerlink" href="#aria.storage.exceptions.StorageError" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="aria.html#aria.exceptions.AriaError" title="aria.exceptions.AriaError"><code class="xref py py-class docutils literal"><span class="pre">aria.exceptions.AriaError</span></code></a></p>
<p>General storage exception</p>
</dd></dl>
</div>
<div class="section" id="module-aria.storage.filesystem_rapi">
<span id="aria-storage-filesystem-rapi"></span><h2><a class="reference internal" href="#module-aria.storage.filesystem_rapi" title="aria.storage.filesystem_rapi"><code class="xref py py-mod docutils literal"><span class="pre">aria.storage.filesystem_rapi</span></code></a><a class="headerlink" href="#module-aria.storage.filesystem_rapi" title="Permalink to this headline"></a></h2>
<p>File system implementation of the storage resource API (“RAPI”).</p>
<dl class="class">
<dt id="aria.storage.filesystem_rapi.FileSystemResourceAPI">
<em class="property">class </em><code class="descclassname">aria.storage.filesystem_rapi.</code><code class="descname">FileSystemResourceAPI</code><span class="sig-paren">(</span><em>directory</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.filesystem_rapi.FileSystemResourceAPI" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#aria.storage.api.ResourceAPI" title="aria.storage.api.ResourceAPI"><code class="xref py py-class docutils literal"><span class="pre">aria.storage.api.ResourceAPI</span></code></a></p>
<p>File system implementation of the storage resource API (“RAPI”).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>directory</strong> – root dir for storage</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="aria.storage.filesystem_rapi.FileSystemResourceAPI.connect">
<code class="descname">connect</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwds</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.filesystem_rapi.FileSystemResourceAPI.connect" title="Permalink to this definition"></a></dt>
<dd><p>Establishes a connection and destroys it after use.</p>
</dd></dl>
<dl class="method">
<dt id="aria.storage.filesystem_rapi.FileSystemResourceAPI.create">
<code class="descname">create</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.filesystem_rapi.FileSystemResourceAPI.create" title="Permalink to this definition"></a></dt>
<dd><p>Creates a directory in by path. Tries to create the root directory as well.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> – path of directory</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="aria.storage.filesystem_rapi.FileSystemResourceAPI.delete">
<code class="descname">delete</code><span class="sig-paren">(</span><em>entry_id</em>, <em>path=None</em>, <em>**_</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.filesystem_rapi.FileSystemResourceAPI.delete" title="Permalink to this definition"></a></dt>
<dd><p>Deletes a file or directory.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>entry_id</strong> – entry ID</li>
<li><strong>path</strong> – path to delete relative to the root of the entry (otherwise all)</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="aria.storage.filesystem_rapi.FileSystemResourceAPI.download">
<code class="descname">download</code><span class="sig-paren">(</span><em>entry_id</em>, <em>destination</em>, <em>path=None</em>, <em>**_</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.filesystem_rapi.FileSystemResourceAPI.download" title="Permalink to this definition"></a></dt>
<dd><p>Downloads a file or directory.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>entry_id</strong> – entry ID</li>
<li><strong>destination</strong> – download destination</li>
<li><strong>path</strong> – path to download relative to the root of the entry (otherwise all)</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="aria.storage.filesystem_rapi.FileSystemResourceAPI.read">
<code class="descname">read</code><span class="sig-paren">(</span><em>entry_id</em>, <em>path</em>, <em>**_</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.filesystem_rapi.FileSystemResourceAPI.read" title="Permalink to this definition"></a></dt>
<dd><p>Retrieves the contents of a file.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>entry_id</strong> – entry ID</li>
<li><strong>path</strong> – path to resource</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">contents of the file</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">bytes</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="aria.storage.filesystem_rapi.FileSystemResourceAPI.upload">
<code class="descname">upload</code><span class="sig-paren">(</span><em>entry_id</em>, <em>source</em>, <em>path=None</em>, <em>**_</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.filesystem_rapi.FileSystemResourceAPI.upload" title="Permalink to this definition"></a></dt>
<dd><p>Uploads a file or directory.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>entry_id</strong> – entry ID</li>
<li><strong>source</strong> – source of the files to upload</li>
<li><strong>path</strong> – the destination of the file/s relative to the entry root dir.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-aria.storage.sql_mapi">
<span id="aria-storage-sql-mapi"></span><h2><a class="reference internal" href="#module-aria.storage.sql_mapi" title="aria.storage.sql_mapi"><code class="xref py py-mod docutils literal"><span class="pre">aria.storage.sql_mapi</span></code></a><a class="headerlink" href="#module-aria.storage.sql_mapi" title="Permalink to this headline"></a></h2>
<p>SQLAlchemy implementation of the storage model API (“MAPI”).</p>
<dl class="class">
<dt id="aria.storage.sql_mapi.ListResult">
<em class="property">class </em><code class="descclassname">aria.storage.sql_mapi.</code><code class="descname">ListResult</code><span class="sig-paren">(</span><em>metadata</em>, <em>*args</em>, <em>**qwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.sql_mapi.ListResult" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal"><span class="pre">list</span></code></p>
<p>Contains results about the requested items.</p>
</dd></dl>
<dl class="class">
<dt id="aria.storage.sql_mapi.SQLAlchemyModelAPI">
<em class="property">class </em><code class="descclassname">aria.storage.sql_mapi.</code><code class="descname">SQLAlchemyModelAPI</code><span class="sig-paren">(</span><em>engine</em>, <em>session</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.sql_mapi.SQLAlchemyModelAPI" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#aria.storage.api.ModelAPI" title="aria.storage.api.ModelAPI"><code class="xref py py-class docutils literal"><span class="pre">aria.storage.api.ModelAPI</span></code></a></p>
<p>SQLAlchemy implementation of the storage model API (“MAPI”).</p>
<dl class="method">
<dt id="aria.storage.sql_mapi.SQLAlchemyModelAPI.create">
<code class="descname">create</code><span class="sig-paren">(</span><em>checkfirst=True</em>, <em>create_all=True</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.sql_mapi.SQLAlchemyModelAPI.create" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="aria.storage.sql_mapi.SQLAlchemyModelAPI.delete">
<code class="descname">delete</code><span class="sig-paren">(</span><em>entry</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.sql_mapi.SQLAlchemyModelAPI.delete" title="Permalink to this definition"></a></dt>
<dd><p>Deletes a single result based on the model class and element ID.</p>
</dd></dl>
<dl class="method">
<dt id="aria.storage.sql_mapi.SQLAlchemyModelAPI.drop">
<code class="descname">drop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.sql_mapi.SQLAlchemyModelAPI.drop" title="Permalink to this definition"></a></dt>
<dd><p>Drops the table.</p>
</dd></dl>
<dl class="method">
<dt id="aria.storage.sql_mapi.SQLAlchemyModelAPI.get">
<code class="descname">get</code><span class="sig-paren">(</span><em>entry_id</em>, <em>include=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.sql_mapi.SQLAlchemyModelAPI.get" title="Permalink to this definition"></a></dt>
<dd><p>Returns a single result based on the model class and element ID</p>
</dd></dl>
<dl class="method">
<dt id="aria.storage.sql_mapi.SQLAlchemyModelAPI.get_by_name">
<code class="descname">get_by_name</code><span class="sig-paren">(</span><em>entry_name</em>, <em>include=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.sql_mapi.SQLAlchemyModelAPI.get_by_name" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="aria.storage.sql_mapi.SQLAlchemyModelAPI.iter">
<code class="descname">iter</code><span class="sig-paren">(</span><em>include=None</em>, <em>filters=None</em>, <em>sort=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.sql_mapi.SQLAlchemyModelAPI.iter" title="Permalink to this definition"></a></dt>
<dd><p>Returns a (possibly empty) list of <code class="docutils literal"><span class="pre">model_class</span></code> results.</p>
</dd></dl>
<dl class="method">
<dt id="aria.storage.sql_mapi.SQLAlchemyModelAPI.list">
<code class="descname">list</code><span class="sig-paren">(</span><em>include=None</em>, <em>filters=None</em>, <em>pagination=None</em>, <em>sort=None</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.sql_mapi.SQLAlchemyModelAPI.list" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="aria.storage.sql_mapi.SQLAlchemyModelAPI.put">
<code class="descname">put</code><span class="sig-paren">(</span><em>entry</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.sql_mapi.SQLAlchemyModelAPI.put" title="Permalink to this definition"></a></dt>
<dd><p>Creatse a <code class="docutils literal"><span class="pre">model_class</span></code> instance from a serializable <code class="docutils literal"><span class="pre">model</span></code> object.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>entry</strong> – dict with relevant kwargs, or an instance of a class that has a <code class="docutils literal"><span class="pre">to_dict</span></code>
method, and whose attributes match the columns of <code class="docutils literal"><span class="pre">model_class</span></code> (might also be just an
instance of <code class="docutils literal"><span class="pre">model_class</span></code>)</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">an instance of <code class="docutils literal"><span class="pre">model_class</span></code></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="aria.storage.sql_mapi.SQLAlchemyModelAPI.refresh">
<code class="descname">refresh</code><span class="sig-paren">(</span><em>entry</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.sql_mapi.SQLAlchemyModelAPI.refresh" title="Permalink to this definition"></a></dt>
<dd><p>Reloads the instance with fresh information from the database.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>entry</strong> – instance to be re-loaded from the database</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">refreshed instance</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="aria.storage.sql_mapi.SQLAlchemyModelAPI.update">
<code class="descname">update</code><span class="sig-paren">(</span><em>entry</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.sql_mapi.SQLAlchemyModelAPI.update" title="Permalink to this definition"></a></dt>
<dd><p>Adds <code class="docutils literal"><span class="pre">instance</span></code> to the database session, and attempts to commit.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">updated instance</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="aria.storage.sql_mapi.init_storage">
<code class="descclassname">aria.storage.sql_mapi.</code><code class="descname">init_storage</code><span class="sig-paren">(</span><em>base_dir</em>, <em>filename='db.sqlite'</em><span class="sig-paren">)</span><a class="headerlink" href="#aria.storage.sql_mapi.init_storage" title="Permalink to this definition"></a></dt>
<dd><p>Built-in ModelStorage initiator.</p>
<p>Creates a SQLAlchemy engine and a session to be passed to the MAPI.</p>
<p><code class="docutils literal"><span class="pre">initiator_kwargs</span></code> must be passed to the ModelStorage which must hold the <code class="docutils literal"><span class="pre">base_dir</span></code> for the
location of the database file, and an option filename. This would create an SQLite database.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>base_dir</strong> – directory of the database</li>
<li><strong>filename</strong> – database file name.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
</div>
</div>
<div class="articleComments">
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="aria.utils.html" class="btn btn-neutral float-right" title="aria.utils" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="aria.parser.validation.html" class="btn btn-neutral" title="aria.parser.validation" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2016-2017, Apache Software Foundation.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/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">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.1.1',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>