forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Wang , Deng Ke <wangdengke2@huawei.com> Co-committed-by: Wang , Deng Ke <wangdengke2@huawei.com>
148 lines
14 KiB
HTML
148 lines
14 KiB
HTML
<a name="rds_09_0002"></a><a name="rds_09_0002"></a>
|
|
|
|
<h1 class="topictitle1">Setting an Automated Backup Policy</h1>
|
|
<div id="body1537345764988"><div class="section" id="rds_09_0002__section117711820496"><h4 class="sectiontitle">Function</h4><p id="rds_09_0002__p1639433018917">This API is used to set an automated backup policy.</p>
|
|
<ul id="rds_09_0002__ul12259155218373"><li id="rds_09_0002__en-us_topic_0240111818_li836513175363">Before calling an API, you need to understand the API in <a href="rds_03_0001.html">Authentication</a>.</li><li id="rds_09_0002__en-us_topic_0240111818_li1991981933613">Before calling this API, obtain the required <a href="https://docs.otc.t-systems.com/en-us/endpoint/index.html" target="_blank" rel="noopener noreferrer">region and endpoint</a>.</li></ul>
|
|
</div>
|
|
<div class="section" id="rds_09_0002__section422711193501"><h4 class="sectiontitle">Constraints</h4><p id="rds_09_0002__p631818241502">Disabling Automated Backup Policy is not allowed for SQL Server Primary/Standby and Cluster instances.</p>
|
|
</div>
|
|
<div class="section" id="rds_09_0002__section12081471012"><h4 class="sectiontitle">URI</h4><ul id="rds_09_0002__ul13194498"><li id="rds_09_0002__li51641620">URI format<p id="rds_09_0002__p62121397"><a name="rds_09_0002__li51641620"></a><a name="li51641620"></a>PUT https://{<em id="rds_09_0002__i53461422191616">Endpoint</em>}/v3/{project_id}/instances/{instance_id}/backups/policy</p>
|
|
</li><li id="rds_09_0002__li22221662">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_09_0002__table65777232" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="rds_09_0002__row46529701"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.3.2.2.1.2.4.1.1"><p id="rds_09_0002__p10809459"><strong id="rds_09_0002__b816381818349">Name</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.3.2.2.1.2.4.1.2"><p id="rds_09_0002__p3150961"><strong id="rds_09_0002__b12164141813340">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.3.2.2.1.2.4.1.3"><p id="rds_09_0002__p53901255"><strong id="rds_09_0002__b11165418153417">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="rds_09_0002__row3925534"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.2.2.1.2.4.1.1 "><p id="rds_09_0002__p49532829">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.2.2.1.2.4.1.2 "><p id="rds_09_0002__p52736237">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.2.2.1.2.4.1.3 "><p id="rds_09_0002__p43776822">Specifies the project ID of a tenant in a region.</p>
|
|
<p id="rds_09_0002__p186761044260">For details about how to obtain the project ID, see <a href="rds_03_0002.html">Obtaining a Project ID</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="rds_09_0002__row19780235152911"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.2.2.1.2.4.1.1 "><p id="rds_09_0002__p41557789155220">instance_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.2.2.1.2.4.1.2 "><p id="rds_09_0002__p10737742155220">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.2.2.1.2.4.1.3 "><p id="rds_09_0002__p64450739155220">Specifies the DB instance ID.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="rds_09_0002__section420839121019"><h4 class="sectiontitle">Request</h4><ul id="rds_09_0002__ul83080566431"><li id="rds_09_0002__li1830813567439">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="rds_09_0002__table6426756154514" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="rds_09_0002__row142645664510"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.1.1.2.5.1.1"><p id="rds_09_0002__p17490046"><strong id="rds_09_0002__b18185101873416">Name</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.1.1.2.5.1.2"><p id="rds_09_0002__p7407659"><strong id="rds_09_0002__b6187121816344">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.1.1.2.5.1.3"><p id="rds_09_0002__p63149496"><strong id="rds_09_0002__b121881918133414">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.1.1.2.5.1.4"><p id="rds_09_0002__p14835533"><strong id="rds_09_0002__b3190101803419">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="rds_09_0002__row34264566458"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.1.2.5.1.1 "><p id="rds_09_0002__p28083633">backup_policy</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.1.2.5.1.2 "><p id="rds_09_0002__p60181840">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.1.2.5.1.3 "><p id="rds_09_0002__p42890904">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.1.2.5.1.4 "><p id="rds_09_0002__p61847473">Specifies the backup policy objects, including the backup retention period (days) and backup start time.</p>
|
|
<p id="rds_09_0002__p11824922203914">For details, see <a href="#rds_09_0002__table163715367507">Table 3</a>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="rds_09_0002__table163715367507"></a><a name="table163715367507"></a><table cellpadding="4" cellspacing="0" summary="" id="rds_09_0002__table163715367507" frame="border" border="1" rules="all"><caption><b>Table 3 </b>backup_policy field data structure description</caption><thead align="left"><tr id="rds_09_0002__row9637103616501"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.1.2.2.5.1.1"><p id="rds_09_0002__p6927161055116"><strong id="rds_09_0002__b11211151813415">Name</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.1.2.2.5.1.2"><p id="rds_09_0002__p139288103515"><strong id="rds_09_0002__b11213918143411">Mandatory</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.1.2.2.5.1.3"><p id="rds_09_0002__p1792911005118"><strong id="rds_09_0002__b6214118143412">Type</strong></p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.1.2.2.5.1.4"><p id="rds_09_0002__p16930810145119"><strong id="rds_09_0002__b521541813344">Description</strong></p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="rds_09_0002__row1863793617509"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.2.2.5.1.1 "><p id="rds_09_0002__p22303345174853">keep_days</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.2.2.5.1.2 "><p id="rds_09_0002__p61740531174853">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.2.2.5.1.3 "><p id="rds_09_0002__p34927138174853">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.2.2.5.1.4 "><p id="rds_09_0002__p30482871191015">Specifies the number of days to retain the generated backup files.</p>
|
|
<p id="rds_09_0002__p5563313">The value range is from 0 to 732. The value <strong id="rds_09_0002__b842352706115136">0</strong> indicates that the automated backup policy is disabled. To extend the retention period, contact customer service. Automated backups can be retained for up to 2562 days.</p>
|
|
<div class="notice" id="rds_09_0002__note25229308132657"><span class="noticetitle"> NOTICE: </span><div class="noticebody"><ul id="rds_09_0002__ul13503226145714"><li id="rds_09_0002__li1250313268571">Once the automated backup policy is disabled, automated backups are no longer created and all incremental backups are deleted immediately. Operations related to the incremental backups, including downloads, replications, restorations, and rebuilds, may fail.</li><li id="rds_09_0002__li145421528165718">Disabling Automated Backup Policy is not allowed for SQL Server Primary/Standby and Cluster instances. So "keep_days" cannot be set to 0 for SQL Server Primary/Standby and Cluster instances.</li></ul>
|
|
</div></div>
|
|
</td>
|
|
</tr>
|
|
<tr id="rds_09_0002__row1637173618507"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.2.2.5.1.1 "><p id="rds_09_0002__p8056259175641">start_time</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.2.2.5.1.2 "><p id="rds_09_0002__p48577249175641">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.2.2.5.1.3 "><p id="rds_09_0002__p42443136175641">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.2.2.5.1.4 "><p id="rds_09_0002__p8983181183415">Specifies the backup time window. Automated backups will be triggered during the backup time window. This parameter is mandatory except that the automated backup policy is disabled.</p>
|
|
<p id="rds_09_0002__p144363282818">The value must be a valid value in the "hh:mm-HH:MM" format. The current time is in the UTC format.</p>
|
|
<ul id="rds_09_0002__ul73551635192814"><li id="rds_09_0002__li13765154012810">The <strong id="rds_09_0002__b1743121315413">HH</strong> value must be 1 greater than the <strong id="rds_09_0002__b774310134416">hh</strong> value.</li><li id="rds_09_0002__li1510111915298">The values of <strong id="rds_09_0002__b75708229414">mm</strong> and <strong id="rds_09_0002__b19570822049">MM</strong> must be the same and must be set to any of the following: <strong id="rds_09_0002__b1657215221947">00</strong>, <strong id="rds_09_0002__b057210229411">15</strong>, <strong id="rds_09_0002__b757310221742">30</strong>, or <strong id="rds_09_0002__b457332211413">45</strong>.</li></ul>
|
|
<p id="rds_09_0002__p59342194324">Example value:</p>
|
|
<ul id="rds_09_0002__ul1210322243217"><li id="rds_09_0002__li17296724143217">08:15-09:15</li><li id="rds_09_0002__li18103722163216">23:00-00:00</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="rds_09_0002__row166371436195010"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.2.2.5.1.1 "><p id="rds_09_0002__p146385361506">period</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.2.2.5.1.2 "><p id="rds_09_0002__p6638736145019">No</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.2.2.5.1.3 "><p id="rds_09_0002__p1363812362509">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.2.2.5.1.4 "><p id="rds_09_0002__p11638173615018">Specifies the backup cycle configuration. Data will be automatically backed up on the selected days every week. This parameter is mandatory except that the automated backup policy is disabled.</p>
|
|
<p id="rds_09_0002__p79691359132716">Value range: The value is digits separated by commas (,), indicating the day of the week and starting from Monday.</p>
|
|
<p id="rds_09_0002__p185631411195613">For example, the value <strong id="rds_09_0002__b13680142354411">1,2,3,4</strong> indicates that the backup period is Monday, Tuesday, Wednesday, and Thursday.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li><li id="rds_09_0002__li4411135064210">Example<p id="rds_09_0002__p1454414211213"><a name="rds_09_0002__li4411135064210"></a><a name="li4411135064210"></a>PUT https://rds.eu-de.otc.t-systems.com/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in01/backups/policy</p>
|
|
</li><li id="rds_09_0002__li14637152124414">Request example<p id="rds_09_0002__p11341520164416"><a name="rds_09_0002__li14637152124414"></a><a name="li14637152124414"></a>Modifying the automated backup policy:</p>
|
|
<pre class="codeblock" id="rds_09_0002__codeblock1937174033214">{
|
|
"backup_policy": {
|
|
"keep_days": 7,
|
|
"start_time": "19:00-20:00",
|
|
"period": "1,2"
|
|
}
|
|
}</pre>
|
|
<p id="rds_09_0002__p933111517554"></p>
|
|
<p id="rds_09_0002__p18804124173817">Disabling the automated backup policy:</p>
|
|
<pre class="codeblock" id="rds_09_0002__codeblock4666627153212">{
|
|
"backup_policy": {
|
|
"keep_days": 0
|
|
}
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="rds_09_0002__section1229512143106"><h4 class="sectiontitle">Response</h4><ul id="rds_09_0002__ul396612717394"><li id="rds_09_0002__li49661427193912">Normal response<p id="rds_09_0002__p824011811104"><a name="rds_09_0002__li49661427193912"></a><a name="li49661427193912"></a>None</p>
|
|
</li><li id="rds_09_0002__li8200143916396">Abnormal Response<p id="rds_09_0002__p29415884"><a name="rds_09_0002__li8200143916396"></a><a name="li8200143916396"></a>For details, see <a href="en-us_topic_0032488197.html">Abnormal Request Results</a>.</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="rds_09_0002__section4778540915440"><h4 class="sectiontitle">Status Code</h4><ul id="rds_09_0002__en-us_topic_0032347778_ul7858132212142"><li id="rds_09_0002__en-us_topic_0032347778_li58581622171411">Normal<p id="rds_09_0002__en-us_topic_0032347778_p1040982941020"><a name="rds_09_0002__en-us_topic_0032347778_li58581622171411"></a><a name="en-us_topic_0032347778_li58581622171411"></a>200</p>
|
|
</li><li id="rds_09_0002__en-us_topic_0032347778_li11583183218149">Abnormal<p id="rds_09_0002__en-us_topic_0032347778_p0723374409"><a name="rds_09_0002__en-us_topic_0032347778_li11583183218149"></a><a name="en-us_topic_0032347778_li11583183218149"></a>For details, see <a href="en-us_topic_0032488240.html">Status Codes</a>.</p>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="rds_09_0002__section1183074220016"><h4 class="sectiontitle">Error Code</h4><p id="rds_09_0002__en-us_topic_0032347778_p19357163913406">For details, see <a href="en-us_topic_0032488241.html">Error Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0032347777.html">Backup and Restoration</a></div>
|
|
</div>
|
|
</div>
|
|
|