forked from docs/doc-exports
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com> Co-authored-by: Chen, Junjie <chenjunjie@huawei.com> Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
56 lines
13 KiB
HTML
56 lines
13 KiB
HTML
<a name="functiongraph_01_0206"></a><a name="functiongraph_01_0206"></a>
|
|
|
|
<h1 class="topictitle1">Using a DIS Trigger</h1>
|
|
<div id="body32001227"><p id="functiongraph_01_0206__en-us_topic_0000001251907940_p1187710482220">For details about the DIS event source, see section "Supported Event Sources".</p>
|
|
<div class="section" id="functiongraph_01_0206__en-us_topic_0000001251907940_section76949209512"><h4 class="sectiontitle">Prerequisites</h4><p id="functiongraph_01_0206__en-us_topic_0000001251907940_p244611039529">Before creating a trigger, ensure that you have prepared the following:</p>
|
|
<ul id="functiongraph_01_0206__en-us_topic_0000001251907940_ul5387217295227"><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li11939131420311">You have created a function. For details, see <a href="functiongraph_01_0153.html#functiongraph_01_0153">Creating a Function from Scratch</a>.</li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li3213305202">You have created a DIS stream, for example, <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b89681501113">dis-function</strong>. For details, see <a href="https://docs.otc.t-systems.com/data-ingestion-service/umn/getting_started/step_1_creating_a_dis_stream.html#dis-01-0601" target="_blank" rel="noopener noreferrer">Creating a DIS Stream</a>.</li></ul>
|
|
</div>
|
|
<div class="section" id="functiongraph_01_0206__en-us_topic_0000001251907940_section04468211232"><h4 class="sectiontitle">Setting an Agency</h4><p id="functiongraph_01_0206__en-us_topic_0000001251907940_p45590480111749">Before creating a DIS trigger, set an agency to delegate FunctionGraph to access DIS. For details on how to create an agency, see <a href="functiongraph_01_0920.html#functiongraph_01_0920">Configuring Agency Permissions</a>.</p>
|
|
<p id="functiongraph_01_0206__en-us_topic_0000001251907940_p41318493114620">Since you did not specify an agency while creating the <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b05811172013">HelloWorld</strong> function, specify one first.</p>
|
|
<ol id="functiongraph_01_0206__en-us_topic_0000001251907940_ol13358159102310"><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li18819169113811"><span>Log in to the FunctionGraph console. In the navigation pane, choose <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_en-us_topic_0000001251907924_b033610517502">Functions</strong> > <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_en-us_topic_0000001251907924_b183361950502">Function List</strong>.</span></li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li1181912983813"><span>Click the function to be configured to go to the function details page.</span></li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li83571982310"><span>Choose <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b148621584373">Configuration</strong> > <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b1858518103718">Permissions</strong>, and change the agency to <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b6561833143619">serverless-trust</strong> created in <a href="functiongraph_01_0920.html#functiongraph_01_0920">Configuring Agency Permissions</a>.</span></li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li13588952316"><span>Click <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b1441014181511">Save</strong>.</span></li></ol>
|
|
</div>
|
|
<div class="section" id="functiongraph_01_0206__en-us_topic_0000001251907940_section680116461234"><h4 class="sectiontitle">Creating a DIS Trigger</h4><ol id="functiongraph_01_0206__en-us_topic_0000001251907940_ol7942760103739"><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li459013421943"><span>Return to the FunctionGraph console. In the navigation pane, choose <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b61431308391524">Functions</strong> > <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b146759626491524">Function List</strong>.</span></li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li5124574412227"><span>Click the function to be configured to go to the function details page.</span></li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li41217342104721"><span>Choose <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b181812196387">Configuration</strong> > <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b138251219173817">Triggers</strong> and click <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b148251219123816">Create Trigger</strong>.</span></li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li13541655191112"><span>Set the following parameters:</span><p><ul id="functiongraph_01_0206__en-us_topic_0000001251907940_ul1846205571118"><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li1347155101115"><strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b928819200498">Trigger Type</strong>: Select <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b339171817496">Data Ingestion Service (DIS)</strong>.</li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li1876715314139"><strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b17576113319494">Stream Name</strong>: Select a DIS stream, for example, <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b71031476495">dis-function</strong>.</li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li20385184212530"><strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b135051152154317">Max. Fetch Bytes</strong>: Maximum volume of data that can be fetched in each request. Only the records smaller than this value will be fetched. The value ranges from 1 KB to 4 MB.</li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li12218443149"><strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b66801559509">Starting Position</strong>: Specify a position in the specified stream from which to start reading data.<ul id="functiongraph_01_0206__en-us_topic_0000001251907940_ul15166544111412"><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li142911155171418"><strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b1598112296454">TRIM_HORIZON</strong>: Data is read from the earliest valid records that are stored in the partition.</li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li616674416145"><strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b1573113211451">LATEST</strong>: Data is read just after the most recent record in the partition. This setting ensures that you always read the latest data.</li></ul>
|
|
</li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li38471415153"><strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b775912419502">Pull Period</strong>: Set a period for pulling data from the stream.</li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li9245538111514"><strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b1447122325212">Serial Data Processing</strong>: If this option is selected, FunctionGraph pulls data from the stream only after previous data is processed. If this option is not selected, FunctionGraph pulls data from the stream as long as the pull period ends.</li></ul>
|
|
</p></li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li57127342114154"><span>Click <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b16108183910520">OK</strong>.</span></li></ol>
|
|
</div>
|
|
<div class="section" id="functiongraph_01_0206__en-us_topic_0000001251907940_section15396107171918"><h4 class="sectiontitle">Configuring a DIS Event to Trigger the Function</h4><ol id="functiongraph_01_0206__en-us_topic_0000001251907940_ol1431912032019"><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li1414312310510"><span>Return to the FunctionGraph console. In the navigation pane, choose <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b48596496991524">Functions</strong> > <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b96263031491524">Function List</strong>.</span></li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li1080841135117"><span>Click the function to be configured to go to the function details page.</span></li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li14296112813525"><span>On the function details page, select a version.</span></li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li109080051212"><span>On the <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b84731427163711">Code</strong> tab page, click <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b1447914272376">Test</strong>. The <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b647982733717">Configure Test Event</strong> dialog box is displayed.</span></li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li1880319150209"><span>Set the parameters described in <a href="#functiongraph_01_0206__en-us_topic_0000001251907940_table187784018405">Table 1</a> and click <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b14135152235310">Save</strong>.</span><p>
|
|
<div class="tablenoborder"><a name="functiongraph_01_0206__en-us_topic_0000001251907940_table187784018405"></a><a name="en-us_topic_0000001251907940_table187784018405"></a><table cellpadding="4" cellspacing="0" summary="" id="functiongraph_01_0206__en-us_topic_0000001251907940_table187784018405" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Test event information</caption><thead align="left"><tr id="functiongraph_01_0206__en-us_topic_0000001251907940_row3778200154019"><th align="left" class="cellrowborder" valign="top" width="34%" id="mcps1.4.5.2.5.2.1.2.3.1.1"><p id="functiongraph_01_0206__en-us_topic_0000001251907940_p87782008402">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="66%" id="mcps1.4.5.2.5.2.1.2.3.1.2"><p id="functiongraph_01_0206__en-us_topic_0000001251907940_p15786100114015">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="functiongraph_01_0206__en-us_topic_0000001251907940_row578616044017"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.4.5.2.5.2.1.2.3.1.1 "><p id="functiongraph_01_0206__en-us_topic_0000001251907940_p1078618012405">Configure Test Event</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.4.5.2.5.2.1.2.3.1.2 "><p id="functiongraph_01_0206__en-us_topic_0000001251907940_p147869004017">You can choose to create a test event or edit an existing one.</p>
|
|
<p id="functiongraph_01_0206__en-us_topic_0000001251907940_p1447113114443">Use the default option <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b8423527069132">Create new test event</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_0206__en-us_topic_0000001251907940_row2786110174012"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.4.5.2.5.2.1.2.3.1.1 "><p id="functiongraph_01_0206__en-us_topic_0000001251907940_p9786190134013">Event Template</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.4.5.2.5.2.1.2.3.1.2 "><p id="functiongraph_01_0206__en-us_topic_0000001251907940_p9706184319468">Select <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b18491015184419">Data Ingestion Service (DIS)</strong> to use the built-in DIS event template.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_0206__en-us_topic_0000001251907940_row37861105408"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.4.5.2.5.2.1.2.3.1.1 "><p id="functiongraph_01_0206__en-us_topic_0000001251907940_p13786405402">Event Name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.4.5.2.5.2.1.2.3.1.2 "><p id="functiongraph_01_0206__en-us_topic_0000001251907940_p117983243365">The event name can contain 1 to 25 characters and must start with a letter and end with a letter or digit. Only letters, digits, underscores (_), and hyphens (-) are allowed. For example, <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b290403497">dis-123test</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_0206__en-us_topic_0000001251907940_row1773914911554"><td class="cellrowborder" valign="top" width="34%" headers="mcps1.4.5.2.5.2.1.2.3.1.1 "><p id="functiongraph_01_0206__en-us_topic_0000001251907940_p157391497558">Event data</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="66%" headers="mcps1.4.5.2.5.2.1.2.3.1.2 "><p id="functiongraph_01_0206__en-us_topic_0000001251907940_p1354154185610">The system automatically loads the built-in DIS event template, which is used in this example without modifications.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</p></li><li id="functiongraph_01_0206__en-us_topic_0000001251907940_li438783111548"><span>Click <strong id="functiongraph_01_0206__en-us_topic_0000001251907940_b1957149173820">Test</strong>. The function test result is displayed.</span></li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="functiongraph_01_0200.html">Creating Triggers</a></div>
|
|
</div>
|
|
</div>
|
|
|