Skip to content

Commit

Permalink
Deployed 52e97bb with MkDocs version: 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Jens Kürten committed Mar 5, 2024
1 parent ed5cad6 commit 2256897
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions getting_started/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ <h3 id="file-structure">File structure</h3>
<p>A minimal Function implementation consists of three files:</p>
<ul>
<li><code>environment.yaml</code> describes the environment and the Functions contained in it</li>
<li><code>requirements.txt</code> contains the dependencies of you Functions (usually only contactsoftware-functions)</li>
<li><code>requirements.txt</code> contains the dependencies of your Functions (usually only contactsoftware-functions)</li>
<li><code>mymodule.py</code> a Python file containing the code of your Functions (feel free to pick a different name)</li>
</ul>
<p>Here is the complete structure:</p>
Expand All @@ -693,7 +693,7 @@ <h3 id="function-code">Function Code</h3>
<a id="__codelineno-2-5" name="__codelineno-2-5" href="#__codelineno-2-5"></a> <span class="o">...</span>
</code></pre></div>
<p>While you don't have to use type annotations, it is highly recommended because it enables autocomplete in your IDE and helps you spot mistakes faster.
For our example we only need the DocumentReleaseEvent. It contains a list of documents that were released. Typically this will only be a single document, however it is best practices to iterate over all of the documents.</p>
For our example we only need the <a href="../reference/events/#documentreleaseevent">DocumentReleaseEvent</a>. It contains a list of documents that were released. Typically this will only be a single document, however it is best practices to iterate over all of the documents.</p>
<div class="highlight"><span class="filename">mymodule.py</span><pre><span></span><code><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><span class="kn">import</span> <span class="nn">requests</span>
<a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a><span class="kn">import</span> <span class="nn">json</span>
<a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a>
Expand All @@ -713,6 +713,8 @@ <h3 id="function-code">Function Code</h3>
<a id="__codelineno-3-17" name="__codelineno-3-17" href="#__codelineno-3-17"></a> <span class="k">if</span> <span class="n">res</span><span class="o">.</span><span class="n">status_code</span> <span class="o">!=</span> <span class="mi">200</span><span class="p">:</span>
<a id="__codelineno-3-18" name="__codelineno-3-18" href="#__codelineno-3-18"></a> <span class="k">return</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Failed to upload document to ERP. Got response code </span><span class="si">{</span><span class="n">res</span><span class="o">.</span><span class="n">status_code</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
</code></pre></div>
<p>Here we send a payload, containing a few attributes from the released document, to <a href="https://example.com">example.com</a>. This is just for illustration purposes!
Please refer to the documentation of your ERP system on how the request needs to be formatted and which endpoint and credentials to use.</p>
<h3 id="register-the-function">Register the Function</h3>
<p>The Function needs to be registered in the <code>environment.yaml</code>:</p>
<div class="highlight"><span class="filename">environment.yaml</span><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a><span class="nt">runtime</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">python3.10</span>
Expand Down
4 changes: 2 additions & 2 deletions reference/runtime/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@
<h1>Python runtime</h1>

<p>This section is aimed at developers that want to build their own Functions-SDK.
If are building Functions with <strong>csfunctions</strong> you can skip this part.</p>
If you are building Functions with <strong>csfunctions</strong> you can skip this part.</p>
<h2 id="architecture">Architecture</h2>
<p>Function environment are docker containers that run in AWS-lambda. The Python runtime utilizes awslambdaric to handle the requests. The Python runtime is part of the CIM Database Cloud Functions infrastructure and currently cannot be customized.</p>
<h2 id="lambda-execute-function-request">Lambda "execute" Function request</h2>
Expand All @@ -592,7 +592,7 @@ <h2 id="lambda-execute-function-request">Lambda "execute" Function request</h2>
</code></pre></div></p>
<p>The return value of the execute method is the json encoded response payload.</p>
<h2 id="payloads">Payloads</h2>
<p>The Request and response payloads are described in the CIM Database Cloud documentation. The functions-sdk-python GitHub repository also contains the complete JSON-schema files.</p>
<p>The Request and response payloads are described in the CIM Database Cloud documentation. The <a href="https://github.com/cslab/functions-sdk-python">functions-sdk-python</a> GitHub repository also contains the complete <a href="https://github.com/cslab/functions-sdk-python/tree/main/json_schemas">JSON-schema files</a>.</p>



Expand Down
Loading

0 comments on commit 2256897

Please sign in to comment.