doc-exports/docs/dds/api-ref/dds_api_0031.html
Wang , Deng Ke 60010eb9d0 dds api 2.0.38sp24 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>
2023-01-13 08:55:41 +00:00

136 lines
11 KiB
HTML

<a name="dds_api_0031"></a><a name="dds_api_0031"></a>
<h1 class="topictitle1">Setting an Automated Backup Policy</h1>
<div id="body1473065741978"><div class="section" id="dds_api_0031__section117711820496"><h4 class="sectiontitle">Function</h4><p id="dds_api_0031__p1639433018917">This API is used to set an automated backup policy.</p>
</div>
<div class="section" id="dds_api_0031__section12081471012"><h4 class="sectiontitle">URI</h4><ul id="dds_api_0031__ul13194498"><li id="dds_api_0031__li51641620">URI format<p id="dds_api_0031__p62121397"><a name="dds_api_0031__li51641620"></a><a name="li51641620"></a>PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/backups/policy</p>
</li><li id="dds_api_0031__li22221662">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0031__table65777232" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="dds_api_0031__row46529701"><th align="left" class="cellrowborder" valign="top" width="28.002800280028005%" id="mcps1.3.2.2.2.1.2.4.1.1"><p id="dds_api_0031__p10809459">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="28.12281228122812%" id="mcps1.3.2.2.2.1.2.4.1.2"><p id="dds_api_0031__p3150961">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="43.874387438743874%" id="mcps1.3.2.2.2.1.2.4.1.3"><p id="dds_api_0031__p2775334615440">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dds_api_0031__row3925534"><td class="cellrowborder" valign="top" width="28.002800280028005%" headers="mcps1.3.2.2.2.1.2.4.1.1 "><p id="dds_api_0031__p49532829">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="28.12281228122812%" headers="mcps1.3.2.2.2.1.2.4.1.2 "><p id="dds_api_0031__p52736237">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="43.874387438743874%" headers="mcps1.3.2.2.2.1.2.4.1.3 "><p id="dds_api_0031__p43776822">Specifies the project ID of a tenant in a region.</p>
</td>
</tr>
<tr id="dds_api_0031__row19780235152911"><td class="cellrowborder" valign="top" width="28.002800280028005%" headers="mcps1.3.2.2.2.1.2.4.1.1 "><p id="dds_api_0031__p41557789155220">instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="28.12281228122812%" headers="mcps1.3.2.2.2.1.2.4.1.2 "><p id="dds_api_0031__p10737742155220">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="43.874387438743874%" headers="mcps1.3.2.2.2.1.2.4.1.3 "><p id="dds_api_0031__p64450739155220">Specifies the instance ID, which can be obtained by calling the API for querying instances. If you do not have an instance, you can call the API used for creating an instance.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="dds_api_0031__section420839121019"><h4 class="sectiontitle">Requests</h4><ul id="dds_api_0031__ul83080566431"><li id="dds_api_0031__li1830813567439">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0031__table6426756154514" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="dds_api_0031__row142645664510"><th align="left" class="cellrowborder" valign="top" width="21.782178217821784%" id="mcps1.3.3.2.1.1.2.5.1.1"><p id="dds_api_0031__p17490046">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.801980198019802%" id="mcps1.3.3.2.1.1.2.5.1.2"><p id="dds_api_0031__p7407659">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.772277227722775%" id="mcps1.3.3.2.1.1.2.5.1.3"><p id="dds_api_0031__p63149496">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="35.64356435643564%" id="mcps1.3.3.2.1.1.2.5.1.4"><p id="dds_api_0031__p3731431542">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dds_api_0031__row34264566458"><td class="cellrowborder" valign="top" width="21.782178217821784%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="dds_api_0031__p28083633">backup_policy</p>
</td>
<td class="cellrowborder" valign="top" width="19.801980198019802%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="dds_api_0031__p60181840">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="22.772277227722775%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="dds_api_0031__p1516193155717">Object</p>
</td>
<td class="cellrowborder" valign="top" width="35.64356435643564%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="dds_api_0031__p61847473">Specifies the backup policy object, including the backup retention period (days) and start time. For more information, see <a href="#dds_api_0031__table163715367507">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="dds_api_0031__table163715367507"></a><a name="table163715367507"></a><table cellpadding="4" cellspacing="0" summary="" id="dds_api_0031__table163715367507" frame="border" border="1" rules="all"><caption><b>Table 3 </b>backup_policy field data structure description</caption><thead align="left"><tr id="dds_api_0031__row9637103616501"><th align="left" class="cellrowborder" valign="top" width="22%" id="mcps1.3.3.2.1.2.2.5.1.1"><p id="dds_api_0031__p6927161055116">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.1.2.2.5.1.2"><p id="dds_api_0031__p139288103515">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23%" id="mcps1.3.3.2.1.2.2.5.1.3"><p id="dds_api_0031__p1792911005118">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="35%" id="mcps1.3.3.2.1.2.2.5.1.4"><p id="dds_api_0031__p1027310471944">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dds_api_0031__row1863793617509"><td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="dds_api_0031__p22303345174853">keep_days</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="dds_api_0031__p61740531174853">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="dds_api_0031__p34927138174853">String</p>
</td>
<td class="cellrowborder" valign="top" width="35%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="dds_api_0031__p30482871191015">Specifies the number of days to retain the generated backup files.</p>
<p id="dds_api_0031__p5563313">The value range is from 0 to 732. The value <strong id="dds_api_0031__b842352706115136">0</strong> indicates that the automated backup policy is disabled.</p>
</td>
</tr>
<tr id="dds_api_0031__row1637173618507"><td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="dds_api_0031__p8056259175641">start_time</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="dds_api_0031__p48577249175641">No</p>
</td>
<td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="dds_api_0031__p42443136175641">String</p>
</td>
<td class="cellrowborder" valign="top" width="35%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="dds_api_0031__p1735859183518">Specifies the backup time window. Automated backups will be triggered during the backup time window. This parameter is mandatory if the automated backup policy is enabled. This parameter is not transferred if the automated backup policy is disabled.</p>
<p id="dds_api_0031__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="dds_api_0031__ul73551635192814"><li id="dds_api_0031__li13765154012810">The <strong id="dds_api_0031__b14795751184511">HH</strong> value must be 1 greater than the <strong id="dds_api_0031__b1479645194513">hh</strong> value.</li><li id="dds_api_0031__li1510111915298">The values of <strong id="dds_api_0031__b14851153510463">mm</strong> and <strong id="dds_api_0031__b6852835124616">MM</strong> must be the same and must be set to <strong id="dds_api_0031__b20852133517466">00</strong>.</li></ul>
<p id="dds_api_0031__p59342194324">Example value:</p>
<p id="dds_api_0031__p69311040122">23:00-00:00</p>
</td>
</tr>
<tr id="dds_api_0031__row166371436195010"><td class="cellrowborder" valign="top" width="22%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="dds_api_0031__p146385361506">period</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="dds_api_0031__p6638736145019">No</p>
</td>
<td class="cellrowborder" valign="top" width="23%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="dds_api_0031__p1363812362509">String</p>
</td>
<td class="cellrowborder" valign="top" width="35%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="dds_api_0031__p11638173615018">Specifies the backup cycle configuration. Data will be automatically backed up on the selected days every week.</p>
<p id="dds_api_0031__p185631411195613">Value range: The value is a number separated by DBS case commas (,). The number indicates the week. The restrictions on the backup retention period are as follows:</p>
<ul id="dds_api_0031__ul31781314172934"><li id="dds_api_0031__li3295155616101">This parameter is not transferred if its value is set to <strong id="dds_api_0031__b18824750192519">0</strong>.</li><li id="dds_api_0031__li24149656172934">If you set the retention period to 1 to 6 days, data is automatically backed up each day of the week. Set the parameter value to <strong id="dds_api_0031__b8834928143614">1,2,3,4,5,6,7</strong>.</li><li id="dds_api_0031__li16020317172934">If you set the retention period to 7 to 732 days, select at least one day of the week for the backup cycle. Example value: <strong id="dds_api_0031__b18995154194019">1,2,3,4</strong></li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="dds_api_0031__li14637152124414">Example request<div class="p" id="dds_api_0031__p1951902614334"><a name="dds_api_0031__li14637152124414"></a><a name="li14637152124414"></a>PUT https://dds.eu-de.otc.t-systems.com/v3/97b026aa9cc4417888c14c84a1ad9860/instances/cc6345c64cec47499182467ea0dd432ain02/backups/policy<pre class="codeblock" id="dds_api_0031__codeblock351982617338">{
"backup_policy": {
"keep_days": 9,
"start_time": "23:00-00:00",
"period": "1,4,5,6,7"
}
}</pre>
</div>
<div class="p" id="dds_api_0031__p10519132613312">Disable an automated backup policy.<pre class="codeblock" id="dds_api_0031__codeblock1951952673318">{
"backup_policy": {
"keep_days": 0
}
}</pre>
</div>
</li></ul>
</div>
<div class="section" id="dds_api_0031__section1229512143106"><h4 class="sectiontitle">Responses</h4><pre class="codeblock" id="dds_api_0031__codeblock1374214201917">{}</pre>
</div>
<div class="section" id="dds_api_0031__section5382712154838"><h4 class="sectiontitle">Status Code</h4><p id="dds_api_0031__dds_api_0018_p16131712193312">Status Code:200.</p>
<p id="dds_api_0031__dds_api_0018_p480617135329">For more information, see <a href="dds_status_code.html">Status Code</a>.</p>
</div>
<div class="section" id="dds_api_0031__section6522193710339"><h4 class="sectiontitle">Error Code</h4><p id="dds_api_0031__dds_api_0018_p20466124120334">For more information, see <a href="dds_error_code.html">Error Code</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dds_backup_restore.html">Backup and Restoration</a></div>
</div>
</div>