doc-exports/docs/obs/umn/obs_03_0333.html
zhangyue b55201d729 OBS UMN DOC
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com>
Co-authored-by: zhangyue <zhangyue164@huawei.com>
Co-committed-by: zhangyue <zhangyue164@huawei.com>
2024-03-18 15:39:30 +00:00

41 lines
9.2 KiB
HTML

<a name="obs_03_0333"></a><a name="obs_03_0333"></a>
<h1 class="topictitle1">Application Example: Configuring SMN-Enabled Event Notification</h1>
<div id="body1499758606807"><div class="section" id="obs_03_0333__section65368539"><h4 class="sectiontitle">Background Information</h4><p id="obs_03_0333__p29930568143324">An enterprise has a large number of files to archive but it does not want to cost much on storage resources. Therefore, the enterprise subscribes to OBS for storing files and expects that an employee can be informed of every operation performed on OBS via email.</p>
</div>
<div class="section" id="obs_03_0333__section19136019185540"><h4 class="sectiontitle">Procedure</h4><ol id="obs_03_0333__ol38006451185540"><li id="obs_03_0333__li33153663"><span>Log in to OBS Console as an enterprise user.</span></li><li id="obs_03_0333__li29947515"><a name="obs_03_0333__li29947515"></a><a name="li29947515"></a><span>Create a bucket.</span><p><p id="obs_03_0333__p6104435614510">Click <strong id="obs_03_0333__b84235270619749">Create Bucket</strong> in the upper right corner of the page. A page shown in <a href="#obs_03_0333__fig164117487446">Figure 1</a> is displayed. On the page, select a region and storage class, and specify a bucket name and other parameters. Then, click <strong id="obs_03_0333__b842352706191026">Create Now</strong>.</p>
<div class="fignone" id="obs_03_0333__fig164117487446"><a name="obs_03_0333__fig164117487446"></a><a name="fig164117487446"></a><span class="figcap"><b>Figure 1 </b>Creating a bucket</span><br><span><img id="obs_03_0333__obs_03_0306_image13179145913414" src="en-us_image_0129426050.png" title="Click to enlarge" class="imgResize"></span></div>
</p></li><li id="obs_03_0333__li44157757145057"><a name="obs_03_0333__li44157757145057"></a><a name="li44157757145057"></a><span>Create a folder.</span><p><p id="obs_03_0333__p2886513214583">Click the name of the bucket created in <a href="#obs_03_0333__li29947515">2</a> to go to the <strong id="obs_03_0333__b927017819114">Overview</strong> page. Then, choose <strong id="obs_03_0333__b1152217143113">Objects</strong> and click <strong id="obs_03_0333__b987718262114">Create Folder</strong>. In the displayed dialog box, enter a folder name and click <strong id="obs_03_0333__b103821431614">OK</strong>. In the following example, <strong id="obs_03_0333__b1972698803165726">SMN</strong> is the folder name.</p>
<div class="fignone" id="obs_03_0333__fig28070790193136"><span class="figcap"><b>Figure 2 </b>Creating a folder</span><br><span><img id="obs_03_0333__image541973219309" src="en-us_image_0129556228.png" title="Click to enlarge" class="imgResize"></span></div>
</p></li><li id="obs_03_0333__li1740525665419"><span>In the upper left corner of the page, click <span><img id="obs_03_0333__image240617562546" src="en-us_image_0000001196392484.png"></span> and choose <strong id="obs_03_0333__b2836125962411">Simple Message Notification</strong>. On the displayed SMN page, create a topic.</span><p><p id="obs_03_0333__p18229757195417">In the following example, <strong id="obs_03_0333__b64431414182715">TestTopic</strong> is the SMN topic and the notifications are sent via email.</p>
<p id="obs_03_0333__p23919077152619">Use SMN to create a notification topic for OBS as follows:</p>
<ol class="subitemlist" type="a" id="obs_03_0333__ol28294216"><li id="obs_03_0333__li53321357">Create an SMN topic.</li><li id="obs_03_0333__li10130173">Add a subscription.</li><li id="obs_03_0333__li24062695">Modify the topic policy. On the <strong id="obs_03_0333__b1380102915208">Configure Topic Policy</strong> page, select <strong id="obs_03_0333__b18947194133713">OBS</strong> under <strong id="obs_03_0333__b494844110376">Services that can publish messages to this topic</strong>.</li></ol>
<p id="obs_03_0333__p65157251171238">For details, see <a href="en-us_topic_0066088963.html#en-us_topic_0066088963__aobs_console_0039_mmccppss_table01">Table 1</a>.</p>
</p></li><li id="obs_03_0333__li27263768145631"><span>Go back to OBS Console.</span></li><li id="obs_03_0333__li18641241112811"><span>Configure an event notification rule.</span><p><ol type="a" id="obs_03_0333__ol1481103423417"><li id="obs_03_0333__li154360579345">In the bucket list, click the bucket that you have created in <a href="#obs_03_0333__li29947515">2</a>.</li><li id="obs_03_0333__li4748191423520">In the navigation pane, choose <strong id="obs_03_0333__b235794428">Basic Configurations</strong> &gt; <strong id="obs_03_0333__b1659498284">Event Notification</strong>. The <strong id="obs_03_0333__b1862200243">Event Notification</strong> page is displayed.</li><li id="obs_03_0333__li10811134103420">Click <strong id="obs_03_0333__b12967145816545">Create</strong>. The <strong id="obs_03_0333__b53941245557">Create Event Notification</strong> dialog box is displayed.</li><li id="obs_03_0333__li1167181813353">Configure event notification parameters, as shown in <a href="#obs_03_0333__fig377201314360">Figure 3</a>. After the notification is configured, an employee will be informed of all specified operations on the <strong id="obs_03_0333__b27182011101310">SMN</strong> folder in bucket <strong id="obs_03_0333__b137191111131317">testbucket</strong>. For details about the parameters, see <a href="en-us_topic_0066088963.html#en-us_topic_0066088963__aobs_console_0039_mmccppss_table01">Table 1</a>.<div class="note" id="obs_03_0333__note15207644203711"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="obs_03_0333__en-us_topic_0066088963_ul75801343183518"><li id="obs_03_0333__en-us_topic_0066088963_li195809435352">A folder path ends with a slash (/). Therefore, if you want to configure the event notification for operations on folders and you need to filter folders by suffix, the suffix must also end with a slash (/).</li><li id="obs_03_0333__en-us_topic_0066088963_li168661347193517">If neither the <strong id="obs_03_0333__en-us_topic_0066088963_b14649194213219">Prefix</strong> nor the <strong id="obs_03_0333__en-us_topic_0066088963_b16651104273212">Suffix</strong> is configured, the event notification rule applies to all objects in the bucket.</li></ul>
</div></div>
<div class="fignone" id="obs_03_0333__fig377201314360"><a name="obs_03_0333__fig377201314360"></a><a name="fig377201314360"></a><span class="figcap"><b>Figure 3 </b>Adding an event notification rule</span><br><span><img id="obs_03_0333__image18916112932717" src="en-us_image_0145403235.png" title="Click to enlarge" class="imgResize"></span></div>
</li></ol>
</p></li></ol>
</div>
<div class="section" id="obs_03_0333__section3070136715325"><h4 class="sectiontitle">Verification</h4><ol id="obs_03_0333__ol44815535153352"><li id="obs_03_0333__li686639153352"><span>Log in to OBS Console as an enterprise user.</span></li><li id="obs_03_0333__li38214839153354"><a name="obs_03_0333__li38214839153354"></a><a name="li38214839153354"></a><span>Upload the <strong id="obs_03_0333__b23132305212326">test.txt</strong> file to the folder created in <a href="#obs_03_0333__li44157757145057">Step 3</a>.</span><p><p id="obs_03_0333__p737014153916">After the file is uploaded, an employee receives an email similar to the one shown in <a href="#obs_03_0333__fig1183879515218">Figure 4</a>. Keyword <strong id="obs_03_0333__b423087349103223">ObjectCreated:Post</strong> in the email indicates that the object is successfully uploaded.</p>
<div class="note" id="obs_03_0333__note29169581713"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="obs_03_0333__p1391617587716">For details about each field in the notification content, see <a href="en-us_topic_0045853816.html">SMN-Enabled Event Notifications</a>.</p>
</div></div>
<div class="fignone" id="obs_03_0333__fig1183879515218"><a name="obs_03_0333__fig1183879515218"></a><a name="fig1183879515218"></a><span class="figcap"><b>Figure 4 </b>Email details about the object uploading</span><br><span><img id="obs_03_0333__image9989007204525" src="en-us_image_0129289372.png" title="Click to enlarge" class="imgResize"></span></div>
</p></li><li id="obs_03_0333__li25862075153645"><span>Delete the <strong id="obs_03_0333__b215568221234">test.txt</strong> file uploaded in <a href="#obs_03_0333__li38214839153354">Step 2</a>.</span><p><p id="obs_03_0333__p3986690152817">After the file is successfully deleted, an employee will receive an email similar to the one shown in <a href="#obs_03_0333__fig36929030152112">Figure 5</a>. Keyword <strong id="obs_03_0333__b945682483103123">ObjectRemoved:Delete</strong> in the email indicates that the object is successfully deleted.</p>
<div class="fignone" id="obs_03_0333__fig36929030152112"><a name="obs_03_0333__fig36929030152112"></a><a name="fig36929030152112"></a><span class="figcap"><b>Figure 5 </b>Email details about the object deleting</span><br><span><img id="obs_03_0333__image29461132204341" src="en-us_image_0129289481.png" title="Click to enlarge" class="imgResize"></span></div>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_03_0147.html">Event Notifications</a></div>
</div>
</div>
<script language="JavaScript">
<!--
image_size('.imgResize');
var msg_imageMax = "view original image";
var msg_imageClose = "close";
//--></script>