FG API 20250630 version

Reviewed-by: Topchii, Maria <mtopchii@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: chenjunjie <chenjunjie@huawei.com>
Co-committed-by: chenjunjie <chenjunjie@huawei.com>
This commit is contained in:
2025-11-18 12:28:20 +00:00
committed by zuul
parent bd13b1d3a9
commit 2d02dc5d79
30 changed files with 2820 additions and 4129 deletions

View File

@ -15,7 +15,7 @@
</li><li id="functiongraph_06_0204__li188288813429">Define a FunctionGraph function.<p id="functiongraph_06_0204__p9194425443"><a name="functiongraph_06_0204__li188288813429"></a><a name="li188288813429"></a>Open a text editor, define a function, and save the function file as <strong id="functiongraph_06_0204__b1195569185918">index.py</strong> under the same directory as the <strong id="functiongraph_06_0204__b8955119125920">helloworld.py</strong> file. The function code is as follows:</p>
<pre class="screen" id="functiongraph_06_0204__screen0893153994618">import json
import helloworld
def handler (event, context):
output =json.dumps(event)
helloworld.printhello()
@ -25,7 +25,7 @@ def handler (event, context):
<div class="section" id="functiongraph_06_0204__section17199193504710"><h4 class="sectiontitle">Step 2: Upload the Project to an OBS Bucket</h4><ol id="functiongraph_06_0204__ol24191851124820"><li id="functiongraph_06_0204__li74191151154818">In the function project, select the <strong id="functiongraph_06_0204__b1626951965917">helloworld.py</strong> and <strong id="functiongraph_06_0204__b8269171913593">index.py</strong> files and compress them into <strong id="functiongraph_06_0204__b1826991975916">fss_examples_python2.7.zip</strong>.</li><li id="functiongraph_06_0204__li1966633145116"><a name="functiongraph_06_0204__li1966633145116"></a><a name="li1966633145116"></a>Upload the <strong id="functiongraph_06_0204__b895113224599">fss_examples_python2.7.zip</strong> package to the OBS bucket and record the link URL of the OBS bucket.</li></ol>
</div>
<div class="section" id="functiongraph_06_0204__section20413632205210"><h4 class="sectiontitle">Step 3: Call the Function Creation API to Create a Function Using the Link URL of the OBS Bucket</h4><p id="functiongraph_06_0204__p14668451125116">URI: <strong id="functiongraph_06_0204__b18262164055910">POST /v2/</strong><em id="functiongraph_06_0204__i719604615596">{project_id}</em><strong id="functiongraph_06_0204__b76323421596">/fgs/functions</strong></p>
<p id="functiongraph_06_0204__p19789173461318">For details, see <a href="functiongraph_06_0108.html">Creating a Function</a>.</p>
<p id="functiongraph_06_0204__p19789173461318">For details about the API, see <a href="functiongraph_06_0108.html">Creating a Function</a>.</p>
<ul id="functiongraph_06_0204__ul104224515521"><li id="functiongraph_06_0204__li5840141415149">Sample request<pre class="screen" id="functiongraph_06_0204__screen795591013534">POST https://{Endpoint}/v2/{project_id}/fgs/functions
{
"code_type": "obs",