doc-exports/docs/opengauss/api-ref/opengauss_api_0026.html
Wang , Deng Ke a96a12ecf1 openGauss API 20221109 version
Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: Wang , Deng Ke <wangdengke2@huawei.com>
Co-committed-by: Wang , Deng Ke <wangdengke2@huawei.com>
2022-11-14 16:40:26 +00:00

149 lines
14 KiB
HTML

<a name="opengauss_api_0026"></a><a name="opengauss_api_0026"></a>
<h1 class="topictitle1">Setting an Automated Backup Policy</h1>
<div id="body1601303123333"><div class="section" id="opengauss_api_0026__sd612792150ae4b208a688aaf2ea8373a"><h4 class="sectiontitle">Function</h4><p id="opengauss_api_0026__a2cdf56d7b7d34086ae869e51663009e1">This API is used to set an automated backup policy.</p>
<ul id="opengauss_api_0026__u7bce3f5bbe93412f846d251a70fcf7c0"><li id="opengauss_api_0026__en-us_topic_0256709922_li41227910453">Before calling an API, you need to understand the API in <a href="opengauss_api_0012.html">Using APIs</a>.</li><li id="opengauss_api_0026__lb5b27d5b1c7e4fb6aa975d2581fcbcf8">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="opengauss_api_0026__s57208d65eff64f4b9f470411f0f50f52"><h4 class="sectiontitle">URI</h4><ul id="opengauss_api_0026__uef1f19e4b9f14b85a3f328139ea8aa70"><li id="opengauss_api_0026__l096c3afe8cf74f1486544604422ea030">URI format<p id="opengauss_api_0026__aa15754bfe17c4b2984693497a7f3aeea"><a name="opengauss_api_0026__l096c3afe8cf74f1486544604422ea030"></a><a name="l096c3afe8cf74f1486544604422ea030"></a>PUT https://{<em id="opengauss_api_0026__a1e43346df0ec495a8184551b098f4628">Endpoint</em>}/opengauss/v3/{<em id="opengauss_api_0026__a2fd015359cac444ea0026c3d20ffd724">project_id</em>}/instances/{<em id="opengauss_api_0026__en-us_topic_0248254028_i575217298119">instance_id</em>}/backups/policy</p>
</li><li id="opengauss_api_0026__l84fb22ebad954a54bf08e6046394c43e">Example<p id="opengauss_api_0026__a4c6544bdeb964ef093db66e55e14c237"><a name="opengauss_api_0026__l84fb22ebad954a54bf08e6046394c43e"></a><a name="l84fb22ebad954a54bf08e6046394c43e"></a>https://gaussdb.eu-de.otc.t-systems.com/opengauss/v3/0483b6b16e954cb88930a360d2c4e663/instances/dsfae23fsfdsae3435in14/backups/policy</p>
<ul id="opengauss_api_0026__u39da8dea28a742b6b8d554eecd99bc75"><li id="opengauss_api_0026__l471ae50f867640f9822e271930628a8a">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="opengauss_api_0026__tc2d8e97cd5444a20a6efb33c9e1fb44e" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="opengauss_api_0026__r3a1c61c293b84172b5588ac6b5017979"><th align="left" class="cellrowborder" valign="top" width="22.79%" id="mcps1.3.2.2.2.2.1.1.2.4.1.1"><p id="opengauss_api_0026__en-us_topic_0248254028_p178635485145">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20.880000000000003%" id="mcps1.3.2.2.2.2.1.1.2.4.1.2"><p id="opengauss_api_0026__en-us_topic_0248254028_p586384819144">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="56.330000000000005%" id="mcps1.3.2.2.2.2.1.1.2.4.1.3"><p id="opengauss_api_0026__a1b9905b948ee49b3b33c1092030cc2ac">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="opengauss_api_0026__row153821619455"><td class="cellrowborder" valign="top" width="22.79%" headers="mcps1.3.2.2.2.2.1.1.2.4.1.1 "><p id="opengauss_api_0026__en-us_topic_0128427214_p49532829">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20.880000000000003%" headers="mcps1.3.2.2.2.2.1.1.2.4.1.2 "><p id="opengauss_api_0026__en-us_topic_0128427214_p52736237">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="56.330000000000005%" headers="mcps1.3.2.2.2.2.1.1.2.4.1.3 "><p id="opengauss_api_0026__p19528455451">Specifies the project ID of a tenant in a region.</p>
<p id="opengauss_api_0026__p95284517457">For details about how to obtain the project ID, see <a href="opengauss_api_0034.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
<tr id="opengauss_api_0026__row103812684518"><td class="cellrowborder" valign="top" width="22.79%" headers="mcps1.3.2.2.2.2.1.1.2.4.1.1 "><p id="opengauss_api_0026__abe634873bf7340eeb9dde5363fb0ac9e">instance_id</p>
</td>
<td class="cellrowborder" valign="top" width="20.880000000000003%" headers="mcps1.3.2.2.2.2.1.1.2.4.1.2 "><p id="opengauss_api_0026__en-us_topic_0128427214_p246284104619">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="56.330000000000005%" headers="mcps1.3.2.2.2.2.1.1.2.4.1.3 "><p id="opengauss_api_0026__p2201242204518">Specifies the DB instance ID, which is compliant with the UUID format.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</li></ul>
</div>
<div class="section" id="opengauss_api_0026__s625a3eaa41884791aa8e5cd0fc4e3eaf"><h4 class="sectiontitle">Request</h4><ul id="opengauss_api_0026__u0969f7afa0f842f5b55521f926a419e1"><li id="opengauss_api_0026__l2513b8d78fa34005ae91425c7a160a89">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="opengauss_api_0026__tb5b832857b0e4b3bb4b0f8601734bfaa" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameter description</caption><thead align="left"><tr id="opengauss_api_0026__r18b7413528d74c7fab0b5a469e746e81"><th align="left" class="cellrowborder" valign="top" width="24.81%" id="mcps1.3.3.2.1.1.2.5.1.1"><p id="opengauss_api_0026__a96f959b310dd437780e1a91e2a840b80">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.68%" id="mcps1.3.3.2.1.1.2.5.1.2"><p id="opengauss_api_0026__en-us_topic_0151958051_p287512375212">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.75%" id="mcps1.3.3.2.1.1.2.5.1.3"><p id="opengauss_api_0026__ae1f9236ee14d45dc8dc6606d77f08ad3">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="36.76%" id="mcps1.3.3.2.1.1.2.5.1.4"><p id="opengauss_api_0026__en-us_topic_0151958051_p198753239523">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="opengauss_api_0026__rca8aff89e9dc4c42a3a9547bc749ba0f"><td class="cellrowborder" valign="top" width="24.81%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="opengauss_api_0026__a20c26b7441c949b2a71e27cd828b4f43">backup_policy</p>
</td>
<td class="cellrowborder" valign="top" width="18.68%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="opengauss_api_0026__a51c26efa248d4d3a9fc2e2c6ccccdad2">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.75%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="opengauss_api_0026__af932a46aaba3432ebb596eef47bbc28b">Object</p>
</td>
<td class="cellrowborder" valign="top" width="36.76%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="opengauss_api_0026__p880314236313">Specifies the backup policy information.</p>
<p id="opengauss_api_0026__p4803152317314">For details, see <a href="#opengauss_api_0026__table365210374319">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="opengauss_api_0026__table365210374319"></a><a name="table365210374319"></a><table cellpadding="4" cellspacing="0" summary="" id="opengauss_api_0026__table365210374319" frame="border" border="1" rules="all"><caption><b>Table 3 </b>backup_policy field data structure description</caption><thead align="left"><tr id="opengauss_api_0026__row1865263714316"><th align="left" class="cellrowborder" valign="top" width="24.81%" id="mcps1.3.3.2.1.2.2.5.1.1"><p id="opengauss_api_0026__p665214379318">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.68%" id="mcps1.3.3.2.1.2.2.5.1.2"><p id="opengauss_api_0026__p2652637103113">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.75%" id="mcps1.3.3.2.1.2.2.5.1.3"><p id="opengauss_api_0026__p76521937143110">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="36.76%" id="mcps1.3.3.2.1.2.2.5.1.4"><p id="opengauss_api_0026__p36522037143116">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="opengauss_api_0026__row9652193733112"><td class="cellrowborder" valign="top" width="24.81%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="opengauss_api_0026__p1265283703111">keep_days</p>
</td>
<td class="cellrowborder" valign="top" width="18.68%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="opengauss_api_0026__p1865223753116">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.75%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="opengauss_api_0026__p196521437173113">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="36.76%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="opengauss_api_0026__p3652113711312">Specifies the backup retention days.</p>
<p id="opengauss_api_0026__p12641612193415">The value ranges from 1 to 732.</p>
</td>
</tr>
<tr id="opengauss_api_0026__row380011963416"><td class="cellrowborder" valign="top" width="24.81%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="opengauss_api_0026__p1580061983412">start_time</p>
</td>
<td class="cellrowborder" valign="top" width="18.68%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="opengauss_api_0026__p480181917347">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.75%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="opengauss_api_0026__p2080181915346">String</p>
</td>
<td class="cellrowborder" valign="top" width="36.76%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="opengauss_api_0026__p4801419183414">Specifies the backup time window. Automated backups will be triggered during the backup time window.</p>
<p id="opengauss_api_0026__p48167350348">The value cannot be empty. It must be a valid value in the "hh:mm-HH:MM" format. The current time is in the UTC format.</p>
<p id="opengauss_api_0026__p1842354183418">The value of <strong id="opengauss_api_0026__b1914192993216">HH</strong> must be 1 greater than the value of <strong id="opengauss_api_0026__b42828491320">hh</strong>. The values of <strong id="opengauss_api_0026__b3323145415324">mm</strong> and <strong id="opengauss_api_0026__b19689115720327">MM</strong> must be the same and must be <strong id="opengauss_api_0026__b243155123310">00</strong>.</p>
<p id="opengauss_api_0026__p20138141211357">Example value:</p>
<p id="opengauss_api_0026__p11138201213516">21:00-22:00</p>
</td>
</tr>
<tr id="opengauss_api_0026__row89047171354"><td class="cellrowborder" valign="top" width="24.81%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="opengauss_api_0026__p1890501783510">period</p>
</td>
<td class="cellrowborder" valign="top" width="18.68%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="opengauss_api_0026__p9905111712351">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.75%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="opengauss_api_0026__p179051217113510">String</p>
</td>
<td class="cellrowborder" valign="top" width="36.76%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="opengauss_api_0026__p1305123963517">Specifies the full backup period. An automated full backup will be performed on the specified days of the week.</p>
<p id="opengauss_api_0026__p20664114619350">The value is a number separated by commas (,), indicating the days of the week. For example, <strong id="opengauss_api_0026__b6623171919408">1,2,3,4</strong> indicates that the backup period is Monday, Tuesday, Wednesday, and Thursday.</p>
</td>
</tr>
<tr id="opengauss_api_0026__row5883114123612"><td class="cellrowborder" valign="top" width="24.81%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="opengauss_api_0026__p128831014103616">differential_period</p>
</td>
<td class="cellrowborder" valign="top" width="18.68%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="opengauss_api_0026__p11883414193613">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.75%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="opengauss_api_0026__p17883161412363">String</p>
</td>
<td class="cellrowborder" valign="top" width="36.76%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="opengauss_api_0026__p1788320141368">Specifies the interval for automated differential backups.</p>
<p id="opengauss_api_0026__p8901638183619">The value is 15, 30, 60, 180, 360, 720, or 1440 in minute.</p>
<p id="opengauss_api_0026__p1648184963613">Example value: 30</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<ul id="opengauss_api_0026__en-us_topic_0248254028_ul66972122155"><li id="opengauss_api_0026__lb17f4a22d1e94d31ae18810fd1cf12e9">Example request<pre class="codeblock" id="opengauss_api_0026__c25293e07ffac4b2289a9efac18d75ae1">{
"backup_policy": {
"keep_days": 7,
"start_time": "19:00-20:00",
"period": "1,2,3,4,5",
"differential_period": "30"
}
}</pre>
</li></ul>
<div class="section" id="opengauss_api_0026__s67fed9781e924497857c485097160728"><h4 class="sectiontitle">Response</h4><ul id="opengauss_api_0026__ul31923327101549"><li id="opengauss_api_0026__li18874490101549">Normal response<p id="opengauss_api_0026__p7836161173816"><a name="opengauss_api_0026__li18874490101549"></a><a name="li18874490101549"></a>None</p>
</li><li id="opengauss_api_0026__li27619632">Example normal response<p id="opengauss_api_0026__p910118291344"><a name="opengauss_api_0026__li27619632"></a><a name="li27619632"></a>{}</p>
</li></ul>
</div>
<ul id="opengauss_api_0026__u9b17118ea46c4441bf032c0b300a6afb"><li id="opengauss_api_0026__l25fe8471f81d48b189d63d284e126372">Abnormal response<p id="opengauss_api_0026__a72740c637ef6476e9c3c6e424dbe5aa7"><a name="opengauss_api_0026__l25fe8471f81d48b189d63d284e126372"></a><a name="l25fe8471f81d48b189d63d284e126372"></a>For details, see <a href="opengauss_api_0031.html">Abnormal Request Results</a>.</p>
</li></ul>
<div class="section" id="opengauss_api_0026__sc7e09a4eab74431784d4cdf1918d05c1"><h4 class="sectiontitle">Status Codes</h4><p id="opengauss_api_0026__ad6824e04527a4a76a14f3ecaae2eb642">For details, see <a href="opengauss_api_0032.html">Status Codes</a>.</p>
</div>
<div class="section" id="opengauss_api_0026__sc1d8131c0dbe4ced837139a22ed27c8b"><h4 class="sectiontitle">Error Codes</h4><p id="opengauss_api_0026__a478f17fa76dc42f792612496f9e1fdba">For details, see <a href="opengauss_api_0033.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="opengauss_api_0025.html">Backup Management</a></div>
</div>
</div>