doc-exports/docs/rds/api-ref/en-us_topic_0037138973.html
Wang , Deng Ke 5208dcae7b RDS API 20221104 version
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>
2022-11-10 09:55:48 +00:00

116 lines
9.7 KiB
HTML

<a name="en-us_topic_0037138973"></a><a name="en-us_topic_0037138973"></a>
<h1 class="topictitle1">Setting an Automated Backup Policy</h1>
<div id="body1473065741978"><div class="section" id="en-us_topic_0037138973__section4850156117316"><h4 class="sectiontitle">Function</h4><p id="en-us_topic_0037138973__p3631239417316">This API is used to set an automated backup policy.</p>
</div>
<div class="section" id="en-us_topic_0037138973__section28961517113719"><h4 class="sectiontitle">URI</h4><ul id="en-us_topic_0037138973__ul3084351717316"><li id="en-us_topic_0037138973__li915620217316">URI format<p id="en-us_topic_0037138973__p51813626145142"><a name="en-us_topic_0037138973__li915620217316"></a><a name="li915620217316"></a>PATH: /rds/v1/{project_id}/instances/{instanceId}/backups/policy</p>
<p id="en-us_topic_0037138973__p39686020154843">Method: PUT</p>
</li><li id="en-us_topic_0037138973__li21405046">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0037138973__table58427690" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="en-us_topic_0037138973__row1482002"><th align="left" class="cellrowborder" valign="top" width="21.11%" id="mcps1.3.2.2.2.1.2.4.1.1"><p id="en-us_topic_0037138973__p52933326"><strong id="en-us_topic_0037138973__b842352706102328_1">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="28.26%" id="mcps1.3.2.2.2.1.2.4.1.2"><p id="en-us_topic_0037138973__p59740974"><strong id="en-us_topic_0037138973__b842352706102346_1">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50.629999999999995%" id="mcps1.3.2.2.2.1.2.4.1.3"><p id="en-us_topic_0037138973__p7180698"><strong id="en-us_topic_0037138973__b842352706163417_1">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0037138973__row44765691"><td class="cellrowborder" valign="top" width="21.11%" headers="mcps1.3.2.2.2.1.2.4.1.1 "><p id="en-us_topic_0037138973__p2142393">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="28.26%" headers="mcps1.3.2.2.2.1.2.4.1.2 "><p id="en-us_topic_0037138973__p39316155">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="50.629999999999995%" headers="mcps1.3.2.2.2.1.2.4.1.3 "><p id="en-us_topic_0037138973__p5743665516325">Specifies the project ID of a tenant in a region.</p>
</td>
</tr>
<tr id="en-us_topic_0037138973__row17748274153725"><td class="cellrowborder" valign="top" width="21.11%" headers="mcps1.3.2.2.2.1.2.4.1.1 "><p id="en-us_topic_0037138973__p25516740153725">instanceId</p>
</td>
<td class="cellrowborder" valign="top" width="28.26%" headers="mcps1.3.2.2.2.1.2.4.1.2 "><p id="en-us_topic_0037138973__p53590098153725">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="50.629999999999995%" headers="mcps1.3.2.2.2.1.2.4.1.3 "><p id="en-us_topic_0037138973__p7417132564016">Specifies the primary node ID of the DB instance.</p>
<div class="note" id="en-us_topic_0037138973__note18250133224019"><span class="notetitle"> NOTE: </span><div class="notebody"><p id="en-us_topic_0037138973__p142501332164011">This field is not the DB instance ID. You are advised to use API v3 and the DB instance ID to perform related operations.</p>
</div></div>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="en-us_topic_0037138973__section3074340117316"><h4 class="sectiontitle">Request</h4><ul id="en-us_topic_0037138973__ul992722175857"><li id="en-us_topic_0037138973__li42068415175857">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0037138973__table11236435" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="en-us_topic_0037138973__row61525259"><th align="left" class="cellrowborder" valign="top" width="19.73%" id="mcps1.3.3.2.1.1.2.5.1.1"><p id="en-us_topic_0037138973__p17490046"><strong id="en-us_topic_0037138973__b842352706102328_3">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="24.63%" id="mcps1.3.3.2.1.1.2.5.1.2"><p id="en-us_topic_0037138973__p7407659"><strong id="en-us_topic_0037138973__b842352706102346_5">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="30.64%" id="mcps1.3.3.2.1.1.2.5.1.3"><p id="en-us_topic_0037138973__p63149496"><strong id="en-us_topic_0037138973__b842352706164541_1">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.1.1.2.5.1.4"><p id="en-us_topic_0037138973__p14835533"><strong id="en-us_topic_0037138973__b842352706163417_5">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0037138973__row60827539"><td class="cellrowborder" valign="top" width="19.73%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="en-us_topic_0037138973__p28083633">policy</p>
</td>
<td class="cellrowborder" valign="top" width="24.63%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="en-us_topic_0037138973__p60181840">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="30.64%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="en-us_topic_0037138973__p42890904">Dictionary data structure. For details, see <a href="#en-us_topic_0037138973__table35260043174853">Table 3</a>.</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="en-us_topic_0037138973__p49586916144357">Specifies the backup policy objects, including the backup retention period (days) and backup start time.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="en-us_topic_0037138973__table35260043174853"></a><a name="table35260043174853"></a><table cellpadding="4" cellspacing="0" summary="" id="en-us_topic_0037138973__table35260043174853" frame="border" border="1" rules="all"><caption><b>Table 3 </b>policy field data structure description</caption><thead align="left"><tr id="en-us_topic_0037138973__row29173707174853"><th align="left" class="cellrowborder" valign="top" width="19.919999999999998%" id="mcps1.3.3.2.1.2.2.5.1.1"><p id="en-us_topic_0037138973__p14260042174853"><strong id="en-us_topic_0037138973__b842352706102328_5">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="24.44%" id="mcps1.3.3.2.1.2.2.5.1.2"><p id="en-us_topic_0037138973__p14212742174853"><strong id="en-us_topic_0037138973__b842352706102346_7">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="30.64%" id="mcps1.3.3.2.1.2.2.5.1.3"><p id="en-us_topic_0037138973__p10381414174853"><strong id="en-us_topic_0037138973__b842352706164541_3">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.3.2.1.2.2.5.1.4"><p id="en-us_topic_0037138973__p35588178174853"><strong id="en-us_topic_0037138973__b842352706163417_7">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0037138973__row64070195174853"><td class="cellrowborder" valign="top" width="19.919999999999998%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="en-us_topic_0037138973__p22303345174853">keepday</p>
</td>
<td class="cellrowborder" valign="top" width="24.44%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="en-us_topic_0037138973__p61740531174853">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="30.64%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="en-us_topic_0037138973__p34927138174853">Int</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="en-us_topic_0037138973__p30482871191015">Specifies the number of days to retain the generated backup files.</p>
<p id="en-us_topic_0037138973__p5563313">The value range is from 0 to 732. If this parameter is <strong id="en-us_topic_0037138973__b842352706112318">0</strong>, the automated backup policy is not set. To extend the retention period, contact customer service. Automated backups can be retained for up to 2562 days.</p>
</td>
</tr>
<tr id="en-us_topic_0037138973__row43181693175641"><td class="cellrowborder" valign="top" width="19.919999999999998%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="en-us_topic_0037138973__p8056259175641">starttime</p>
</td>
<td class="cellrowborder" valign="top" width="24.44%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="en-us_topic_0037138973__p48577249175641">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="30.64%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="en-us_topic_0037138973__p42443136175641">String</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="en-us_topic_0037138973__p40942168155958">Indicates the backup start time that has been set.</p>
<p id="en-us_topic_0037138973__p57223682">Valid value: </p>
<p id="en-us_topic_0037138973__p29612155144531">The value cannot be empty. The format can be hh:mm:ss or hh:mm and must be valid. The time is in the UTC format.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
<ul id="en-us_topic_0037138973__ul10190321"><li id="en-us_topic_0037138973__li24604028">Request example<pre class="codeblock" id="en-us_topic_0037138973__codeblock42014849183350">{
"policy": {
"keepday": 7,
"starttime": "00:00:00"
}
}</pre>
</li></ul>
</div>
<div class="section" id="en-us_topic_0037138973__section28521534113742"><h4 class="sectiontitle">Normal Response</h4><p id="en-us_topic_0037138973__p718753317316">{}</p>
</div>
<div class="section" id="en-us_topic_0037138973__section51597550"><h4 class="sectiontitle">Abnormal Response</h4><p id="en-us_topic_0037138973__p28475059">For details, see <a href="en-us_topic_0032488197.html">Abnormal Request Results</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rds_06_0018.html">Backup and Restoration</a></div>
</div>
</div>