Files
doc-exports/docs/cbr/api-ref/CreatePolicy.html
weihongmin1 5d7ef90c79 CBR API 0329 Version
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com>
Co-authored-by: weihongmin1 <weihongmin1@huawei.com>
Co-committed-by: weihongmin1 <weihongmin1@huawei.com>
2025-04-15 08:17:11 +00:00

695 lines
57 KiB
HTML

<a name="CreatePolicy"></a><a name="CreatePolicy"></a>
<h1 class="topictitle1">Creating a Policy</h1>
<div id="body1708331107508"><div class="section" id="CreatePolicy__section10241185822410"><h4 class="sectiontitle">Function</h4><p id="CreatePolicy__p2024111583242">This API is used to create a backup policy.</p>
</div>
<div class="section" id="CreatePolicy__section1924112582249"><h4 class="sectiontitle">URI</h4><p id="CreatePolicy__p824119582246">POST /v3/{project_id}/policies</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreatePolicy__table5242158172417" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr id="CreatePolicy__row124205816248"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="CreatePolicy__p924210587245">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="CreatePolicy__p1124212588244">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="CreatePolicy__p2024245810243">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="CreatePolicy__p202431458142419">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreatePolicy__row182421058172413"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="CreatePolicy__p1224312588243">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="CreatePolicy__p1724355813241">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="CreatePolicy__p424316587247">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="CreatePolicy__p122431358192414">Project ID</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreatePolicy__section122431058112414"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreatePolicy__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="CreatePolicy__row32435586247"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="CreatePolicy__p4244115812243">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="CreatePolicy__p18244205872413">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="CreatePolicy__p15244185832410">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="CreatePolicy__p6244558172416">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreatePolicy__row16243358202414"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="CreatePolicy__p17244125832417">X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="CreatePolicy__p15244115811247">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="CreatePolicy__p14244115819248">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="CreatePolicy__p22454589247">User token</p>
<p id="CreatePolicy__p724665872412">The token can be obtained by calling the IAM API used to obtain a user token. The value of <strong id="CreatePolicy__b2024625810249">X-Subject-Token</strong> in the response header is the user token.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreatePolicy__request_PolicyCreateReq" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request body parameters</caption><thead align="left"><tr id="CreatePolicy__row9246758112420"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="CreatePolicy__p182461258112417">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p id="CreatePolicy__p20246175872418">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p id="CreatePolicy__p12246145815244">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p id="CreatePolicy__p5246145882419">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreatePolicy__row112461258122414"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="CreatePolicy__p9247145882417">policy</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="CreatePolicy__p624755822415">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="CreatePolicy__p1247185813241"><a href="#CreatePolicy__request_PolicyCreate">PolicyCreate</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="CreatePolicy__p1024711584247">Request body for creating a policy</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="CreatePolicy__request_PolicyCreate"></a><a name="request_PolicyCreate"></a><table cellpadding="4" cellspacing="0" summary="" id="CreatePolicy__request_PolicyCreate" frame="border" border="1" rules="all"><caption><b>Table 4 </b>PolicyCreate</caption><thead align="left"><tr id="CreatePolicy__row142471158102417"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.1"><p id="CreatePolicy__p152481558142415">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.2"><p id="CreatePolicy__p3248165812414">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.3"><p id="CreatePolicy__p12483582244">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.4.2.5.1.4"><p id="CreatePolicy__p3248758152411">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreatePolicy__row52471458112412"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreatePolicy__p20248145817247">enabled</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreatePolicy__p15248175812411">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreatePolicy__p1824845832419">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreatePolicy__p1924813587248">Whether to enable the policy</p>
<p id="CreatePolicy__p524865816247">Default: <strong id="CreatePolicy__b202486581247">true</strong></p>
</td>
</tr>
<tr id="CreatePolicy__row182471458162418"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreatePolicy__p7248115813246">name</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreatePolicy__p824835832417">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreatePolicy__p8249258102416">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreatePolicy__p112491258142419">Specifies the policy name. The value consists of 1 to 64 characters and can contain only letters, digits, underscores (_), and hyphens (-).</p>
<p id="CreatePolicy__p524912587247">Minimum: <strong id="CreatePolicy__b224995815249">1</strong></p>
<p id="CreatePolicy__p15249135852414">Maximum: <strong id="CreatePolicy__b162492588244">64</strong></p>
</td>
</tr>
<tr id="CreatePolicy__row924718584247"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreatePolicy__p132491758162411">operation_definition</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreatePolicy__p6249858142413">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreatePolicy__p182491658102414"><a href="#CreatePolicy__request_PolicyoODCreate">PolicyoODCreate</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreatePolicy__p624935802416">Scheduling parameter</p>
</td>
</tr>
<tr id="CreatePolicy__row324716584245"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreatePolicy__p1824975810246">operation_type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreatePolicy__p1824905817245">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreatePolicy__p52493589242">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreatePolicy__p1024912582242">Protection type, which can be <strong id="CreatePolicy__b8249115820249">backup</strong> or <strong id="CreatePolicy__b14249145882417">replication</strong></p>
</td>
</tr>
<tr id="CreatePolicy__row8247195882415"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p id="CreatePolicy__p3250145862416">trigger</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p id="CreatePolicy__p1025005882410">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p id="CreatePolicy__p12501258202416"><a href="#CreatePolicy__request_PolicyTriggerReq">PolicyTriggerReq</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p id="CreatePolicy__p125016586247">Time rule for the policy execution</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="CreatePolicy__request_PolicyoODCreate"></a><a name="request_PolicyoODCreate"></a><table cellpadding="4" cellspacing="0" summary="" id="CreatePolicy__request_PolicyoODCreate" frame="border" border="1" rules="all"><caption><b>Table 5 </b>PolicyoODCreate</caption><thead align="left"><tr id="CreatePolicy__row1325016583245"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.5.2.5.1.1"><p id="CreatePolicy__p4251158112417">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.5.2.5.1.2"><p id="CreatePolicy__p13251758182419">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.5.2.5.1.3"><p id="CreatePolicy__p1325205892420">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.5.2.5.1.4"><p id="CreatePolicy__p1325212585241">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreatePolicy__row6250458162412"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p id="CreatePolicy__p925205842412">day_backups</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p id="CreatePolicy__p10252658142419">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p id="CreatePolicy__p425215832418">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p id="CreatePolicy__p425216588242">Maximum number of daily backups that can be retained. The latest backup of each day is saved in the long term. This parameter and <strong id="CreatePolicy__b3252358202410">max_backups</strong> will both be applied. The value ranges from <strong id="CreatePolicy__b1925235872418">0</strong> to <strong id="CreatePolicy__b1252135817243">100</strong>. If this parameter is configured, <strong id="CreatePolicy__b625265852418">timezone</strong> is mandatory. This parameter and <strong id="CreatePolicy__b1825275815246">retention_duration_days</strong> cannot be both applied.</p>
<p id="CreatePolicy__p11252185852417">Minimum: <strong id="CreatePolicy__b5252258102415">0</strong></p>
<p id="CreatePolicy__p825285814243">Maximum: <strong id="CreatePolicy__b19252205882418">100</strong></p>
</td>
</tr>
<tr id="CreatePolicy__row10251158182414"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p id="CreatePolicy__p17252125812417">destination_project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p id="CreatePolicy__p525265822410">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p id="CreatePolicy__p22526581243">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p id="CreatePolicy__p3252175815241">ID of the replication destination project, which is mandatory for cross-region replication</p>
</td>
</tr>
<tr id="CreatePolicy__row6251175892413"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p id="CreatePolicy__p112521958132417">destination_region</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p id="CreatePolicy__p8252155816249">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p id="CreatePolicy__p1325345832412">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p id="CreatePolicy__p172530585246">Replication destination region, which is mandatory for cross-region replication. The destination region cannot be the same as the current region. The value contains 0 to 255 characters, including only letters, digits, underscores (_), and hyphens (-).</p>
</td>
</tr>
<tr id="CreatePolicy__row2025119583240"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p id="CreatePolicy__p2025375862411">max_backups</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p id="CreatePolicy__p1253458192415">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p id="CreatePolicy__p12253458182418">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p id="CreatePolicy__p122531158132416">Maximum number of backups that can be automatically created for an object. The value can be -1 or 1-99999. If the value is set to -1, backups will not be cleared by the quantity of backups. If this parameter and retention_duration_days are both left blank, backups will be retained permanently. This field and retention_duration_days cannot be both set.</p>
<p id="CreatePolicy__p62531858122416">Minimum: <strong id="CreatePolicy__b3253175872418">1</strong></p>
<p id="CreatePolicy__p3253195802413">Maximum: <strong id="CreatePolicy__b1925385882419">99999</strong></p>
<p id="CreatePolicy__p8254115810249">Default: <strong id="CreatePolicy__b1025415589243">-1</strong></p>
</td>
</tr>
<tr id="CreatePolicy__row1025111589244"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p id="CreatePolicy__p1725455819248">month_backups</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p id="CreatePolicy__p172549580245">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p id="CreatePolicy__p11254185817249">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p id="CreatePolicy__p92541958172411">Maximum number of monthly backups that can be retained. The latest backup of each month is saved in the long term. This parameter and <strong id="CreatePolicy__b62541258152419">max_backups</strong> will both be applied. The value ranges from <strong id="CreatePolicy__b11254758112414">0</strong> to <strong id="CreatePolicy__b025455832410">100</strong>. If this parameter is configured, <strong id="CreatePolicy__b16254125811242">timezone</strong> is mandatory. This parameter and <strong id="CreatePolicy__b1125411589241">retention_duration_days</strong> cannot be both applied.</p>
<p id="CreatePolicy__p1325415816247">Minimum: <strong id="CreatePolicy__b14254205811241">0</strong></p>
<p id="CreatePolicy__p19254125813242">Maximum: <strong id="CreatePolicy__b125419588245">100</strong></p>
</td>
</tr>
<tr id="CreatePolicy__row132516583244"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p id="CreatePolicy__p18254165819247">retention_duration_days</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p id="CreatePolicy__p725419581245">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p id="CreatePolicy__p0255658122419">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p id="CreatePolicy__p225535819246">Duration of retaining a backup, in days. The maximum value is <strong id="CreatePolicy__b9255175872414">99999</strong>. If the value is set to <strong id="CreatePolicy__b82551758192418">-1</strong>, backups will not be cleared by retention duration. If this parameter and <strong id="CreatePolicy__b225595811243">max_backups</strong> are left blank at the same time, the backups will be retained permanently. This parameter cannot be applied together with <strong id="CreatePolicy__b925510581246">max_backups</strong>, <strong id="CreatePolicy__b17255458192417">day_backups</strong>, <strong id="CreatePolicy__b025510583245">week_backups</strong>, <strong id="CreatePolicy__b122554583241">month_backups</strong>, and <strong id="CreatePolicy__b102553588242">year_backups</strong>.</p>
<p id="CreatePolicy__p2255958132410">Minimum: <strong id="CreatePolicy__b12552586240">1</strong></p>
<p id="CreatePolicy__p1925515832420">Maximum: <strong id="CreatePolicy__b102551581244">99999</strong></p>
<p id="CreatePolicy__p925545872412">Default: <strong id="CreatePolicy__b225565872412">-1</strong></p>
</td>
</tr>
<tr id="CreatePolicy__row7251125862416"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p id="CreatePolicy__p0255958132416">timezone</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p id="CreatePolicy__p1255155872420">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p id="CreatePolicy__p225514588248">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p id="CreatePolicy__p19256175813242">Time zone where the user is located. The format is UTC+01:00. If any of the parameters of yearly, monthly, weekly, or daily backup is selected, this parameter cannot be left empty.</p>
</td>
</tr>
<tr id="CreatePolicy__row82516589245"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p id="CreatePolicy__p1725655818247">week_backups</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p id="CreatePolicy__p0256658162418">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p id="CreatePolicy__p7256958122419">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p id="CreatePolicy__p1925675852419">Maximum number of weekly backups that can be retained. The latest backup of each week is saved in the long term. This parameter and <strong id="CreatePolicy__b182564582247">max_backups</strong> will both be applied. The value ranges from <strong id="CreatePolicy__b14256658112412">0</strong> to <strong id="CreatePolicy__b102569585249">100</strong>. If this parameter is configured, <strong id="CreatePolicy__b9256195815249">timezone</strong> is mandatory. This parameter and <strong id="CreatePolicy__b6256175811241">retention_duration_days</strong> cannot be both applied.</p>
</td>
</tr>
<tr id="CreatePolicy__row18251115818248"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p id="CreatePolicy__p22561958112410">year_backups</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p id="CreatePolicy__p9256758112420">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p id="CreatePolicy__p6256175892417">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p id="CreatePolicy__p4256358122412">Maximum number of yearly backups that can be retained. The latest backup of each year is saved in the long term. This parameter and <strong id="CreatePolicy__b1625614586245">max_backups</strong> will both be applied. The value ranges from <strong id="CreatePolicy__b102560587241">0</strong> to <strong id="CreatePolicy__b5256105812419">100</strong>. If this parameter is configured, <strong id="CreatePolicy__b132561858142413">timezone</strong> is mandatory. This parameter and <strong id="CreatePolicy__b1625612587246">retention_duration_days</strong> cannot be both applied.</p>
<p id="CreatePolicy__p5256185812247">Minimum: <strong id="CreatePolicy__b6256358112411">0</strong></p>
<p id="CreatePolicy__p1425695815249">Maximum: <strong id="CreatePolicy__b13257145882415">100</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="CreatePolicy__request_PolicyTriggerReq"></a><a name="request_PolicyTriggerReq"></a><table cellpadding="4" cellspacing="0" summary="" id="CreatePolicy__request_PolicyTriggerReq" frame="border" border="1" rules="all"><caption><b>Table 6 </b>PolicyTriggerReq</caption><thead align="left"><tr id="CreatePolicy__row72571158132416"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.6.2.5.1.1"><p id="CreatePolicy__p52574586242">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.6.2.5.1.2"><p id="CreatePolicy__p225719582243">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.6.2.5.1.3"><p id="CreatePolicy__p7257158122411">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.6.2.5.1.4"><p id="CreatePolicy__p72571758102418">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreatePolicy__row1125710585246"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.6.2.5.1.1 "><p id="CreatePolicy__p925885882410">properties</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.6.2.5.1.2 "><p id="CreatePolicy__p1525817584242">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.6.2.5.1.3 "><p id="CreatePolicy__p17258958152410"><a href="#CreatePolicy__request_PolicyTriggerPropertiesReq">PolicyTriggerPropertiesReq</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.6.2.5.1.4 "><p id="CreatePolicy__p1025835817244">Scheduler attributes</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="CreatePolicy__request_PolicyTriggerPropertiesReq"></a><a name="request_PolicyTriggerPropertiesReq"></a><table cellpadding="4" cellspacing="0" summary="" id="CreatePolicy__request_PolicyTriggerPropertiesReq" frame="border" border="1" rules="all"><caption><b>Table 7 </b>PolicyTriggerPropertiesReq</caption><thead align="left"><tr id="CreatePolicy__row1125885810246"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.7.2.5.1.1"><p id="CreatePolicy__p1325925832414">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.7.2.5.1.2"><p id="CreatePolicy__p102593589246">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.7.2.5.1.3"><p id="CreatePolicy__p182596588248">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.7.2.5.1.4"><p id="CreatePolicy__p525975810249">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreatePolicy__row9258175811246"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.7.2.5.1.1 "><p id="CreatePolicy__p6259135832415">pattern</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.7.2.5.1.2 "><p id="CreatePolicy__p1625905810241">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.7.2.5.1.3 "><p id="CreatePolicy__p925915813242">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.7.2.5.1.4 "><p id="CreatePolicy__p192591758102411">Scheduling rule of the scheduler. A maximum of 24 rules can be configured. The scheduling rule complies with iCalendar RFC 2445, but it supports only the <strong id="CreatePolicy__b325905818248">FREQ</strong>, <strong id="CreatePolicy__b102591558162413">BYDAY</strong>, <strong id="CreatePolicy__b9259155832411">BYHOUR</strong>, <strong id="CreatePolicy__b18259185820245">BYMINUTE</strong>, and <strong id="CreatePolicy__b20259258162417">INTERVAL</strong> parameters. <strong id="CreatePolicy__b725911581248">FREQ</strong> can be set only to <strong id="CreatePolicy__b32591588242">WEEKLY</strong> or <strong id="CreatePolicy__b10259558172417">DAILY</strong>. <strong id="CreatePolicy__b2259195812248">BYDAY</strong> can be set to <strong id="CreatePolicy__b325995818243">MO</strong>, <strong id="CreatePolicy__b112598588245">TU</strong>, <strong id="CreatePolicy__b125985862418">WE</strong>, <strong id="CreatePolicy__b102591587248">TH</strong>, <strong id="CreatePolicy__b1425975852410">FR</strong>, <strong id="CreatePolicy__b18259158102415">SA</strong>, and <strong id="CreatePolicy__b9259358102413">SU</strong> (seven days of a week). <strong id="CreatePolicy__b14259258182413">BYHOUR</strong> ranges from 0 to 23 hours. <strong id="CreatePolicy__b52591958192414">BYMINUTE</strong> ranges from 0 to 59 minutes. The scheduling interval cannot be less than 1 hour. A maximum of 24 time points are allowed in a day. For example, if the scheduling time is 14:00 (UTC) from Monday to Sunday, set the scheduling rule as follows: <strong id="CreatePolicy__b8259858172411">FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR,SA,SU;BYHOUR=14;BYMINUTE=00</strong>. If the scheduling time is 14:00 (UTC+8) every day, set the scheduling rule as follows: <strong id="CreatePolicy__b0259958152411">FREQ=DAILY;INTERVAL=1;BYHOUR=6;BYMINUTE=00</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreatePolicy__section1525945852416"><h4 class="sectiontitle">Response Parameters</h4><p id="CreatePolicy__p8260135802416"><strong id="CreatePolicy__b42607585246">Status code: 200</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreatePolicy__response_PolicyCreateResp" frame="border" border="1" rules="all"><caption><b>Table 8 </b>Response body parameters</caption><thead align="left"><tr id="CreatePolicy__row52601858192412"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.1"><p id="CreatePolicy__p5260125814244">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.2"><p id="CreatePolicy__p6260358122412">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.3.2.4.1.3"><p id="CreatePolicy__p926065810241">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreatePolicy__row3260185822412"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="CreatePolicy__p16260125862419">policy</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="CreatePolicy__p22611858182420"><a href="#CreatePolicy__response_Policy">Policy</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="CreatePolicy__p112616583243">Response to the request for creating a policy</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="CreatePolicy__response_Policy"></a><a name="response_Policy"></a><table cellpadding="4" cellspacing="0" summary="" id="CreatePolicy__response_Policy" frame="border" border="1" rules="all"><caption><b>Table 9 </b>Policy</caption><thead align="left"><tr id="CreatePolicy__row17261758162410"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.4.2.4.1.1"><p id="CreatePolicy__p132621158142413">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.4.2.4.1.2"><p id="CreatePolicy__p142621358172415">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.4.2.4.1.3"><p id="CreatePolicy__p1326212587246">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreatePolicy__row15261105812249"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="CreatePolicy__p10262358162420">enabled</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="CreatePolicy__p0262105817242">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="CreatePolicy__p10262165820247">Whether the policy is enabled</p>
</td>
</tr>
<tr id="CreatePolicy__row10261145812416"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="CreatePolicy__p1826210589245">id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="CreatePolicy__p826217581245">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="CreatePolicy__p726320581244">Policy ID</p>
</td>
</tr>
<tr id="CreatePolicy__row1826115581244"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="CreatePolicy__p126312581249">name</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="CreatePolicy__p8263105802412">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="CreatePolicy__p726335832419">Policy Name</p>
</td>
</tr>
<tr id="CreatePolicy__row13261195872414"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="CreatePolicy__p1226311587242">operation_definition</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="CreatePolicy__p72631058122418"><a href="#CreatePolicy__response_PolicyoODCreate">PolicyoODCreate</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="CreatePolicy__p22631258132417">Policy attributes</p>
</td>
</tr>
<tr id="CreatePolicy__row1826125852410"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="CreatePolicy__p4263185822419">operation_type</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="CreatePolicy__p1326385862411">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="CreatePolicy__p142638586249">Protection type, which can be <strong id="CreatePolicy__b8263205892411">backup</strong> or <strong id="CreatePolicy__b1326335812410">replication</strong></p>
<p id="CreatePolicy__p14263165812414">Enumeration values:</p>
<ul id="CreatePolicy__ul1226313581243"><li id="CreatePolicy__li7263658192420"><p id="CreatePolicy__p72631358152410"><a name="CreatePolicy__li7263658192420"></a><a name="li7263658192420"></a><strong id="CreatePolicy__b132641858102410">backup</strong></p>
</li><li id="CreatePolicy__li192648588245"><p id="CreatePolicy__p10264145813243"><a name="CreatePolicy__li192648588245"></a><a name="li192648588245"></a><strong id="CreatePolicy__b9264175813248">replication</strong></p>
</li></ul>
</td>
</tr>
<tr id="CreatePolicy__row12611858112416"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="CreatePolicy__p1426405817245">trigger</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="CreatePolicy__p152641258192414"><a href="#CreatePolicy__response_PolicyTriggerResp">PolicyTriggerResp</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="CreatePolicy__p2026495882418">Time scheduling rule for the policy</p>
</td>
</tr>
<tr id="CreatePolicy__row22611858142416"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.1 "><p id="CreatePolicy__p12264165814245">associated_vaults</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.4.2.4.1.2 "><p id="CreatePolicy__p7264155812248">Array of <a href="#CreatePolicy__response_PolicyAssociateVault">PolicyAssociateVault</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.4.2.4.1.3 "><p id="CreatePolicy__p226475812242">Associated vault</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="CreatePolicy__response_PolicyoODCreate"></a><a name="response_PolicyoODCreate"></a><table cellpadding="4" cellspacing="0" summary="" id="CreatePolicy__response_PolicyoODCreate" frame="border" border="1" rules="all"><caption><b>Table 10 </b>PolicyoODCreate</caption><thead align="left"><tr id="CreatePolicy__row626525892417"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.5.2.4.1.1"><p id="CreatePolicy__p1267175812415">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.5.2.4.1.2"><p id="CreatePolicy__p026715816249">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.5.2.4.1.3"><p id="CreatePolicy__p126719586247">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreatePolicy__row526575842415"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreatePolicy__p10267205822413">day_backups</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreatePolicy__p112671588249">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreatePolicy__p826735852412">Maximum number of daily backups that can be retained. The latest backup of each day is saved in the long term. This parameter and <strong id="CreatePolicy__b1267858152416">max_backups</strong> will both be applied. The value ranges from <strong id="CreatePolicy__b6267145802419">0</strong> to <strong id="CreatePolicy__b1926775862416">100</strong>. If this parameter is configured, <strong id="CreatePolicy__b202670581244">timezone</strong> is mandatory. This parameter and <strong id="CreatePolicy__b126785882418">retention_duration_days</strong> cannot be both applied.</p>
<p id="CreatePolicy__p9267658132419">Minimum: <strong id="CreatePolicy__b142671058122415">0</strong></p>
<p id="CreatePolicy__p5268458172413">Maximum: <strong id="CreatePolicy__b112681258172414">100</strong></p>
</td>
</tr>
<tr id="CreatePolicy__row826585862410"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreatePolicy__p126865832418">destination_project_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreatePolicy__p1326865852410">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreatePolicy__p1326845814243">ID of the replication destination project, which is mandatory for cross-region replication</p>
</td>
</tr>
<tr id="CreatePolicy__row12265155815249"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreatePolicy__p62681858202416">destination_region</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreatePolicy__p326865832414">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreatePolicy__p52681858182412">Replication destination region, which is mandatory for cross-region replication. The destination region cannot be the same as the current region. The value contains 0 to 255 characters, including only letters, digits, underscores (_), and hyphens (-).</p>
</td>
</tr>
<tr id="CreatePolicy__row17265185819248"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreatePolicy__p205491858162417">max_backups</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreatePolicy__p125499584249">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreatePolicy__p25491858192415">Maximum number of backups that can be automatically created for an object. The value can be -1 or 1-99999. If the value is set to -1, backups will not be cleared by the quantity of backups. If this parameter and retention_duration_days are both left blank, backups will be retained permanently. This field and retention_duration_days cannot be both set.</p>
<p id="CreatePolicy__p10549125812411">Minimum: <strong id="CreatePolicy__b654935815242">1</strong></p>
<p id="CreatePolicy__p254945815246">Maximum: <strong id="CreatePolicy__b8549135812246">99999</strong></p>
<p id="CreatePolicy__p18549458202419">Default: <strong id="CreatePolicy__b6549058132412">-1</strong></p>
</td>
</tr>
<tr id="CreatePolicy__row11265175819243"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreatePolicy__p85491058122412">month_backups</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreatePolicy__p354913589242">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreatePolicy__p14549758162416">Maximum number of monthly backups that can be retained. The latest backup of each month is saved in the long term. This parameter and <strong id="CreatePolicy__b6549158152417">max_backups</strong> will both be applied. The value ranges from <strong id="CreatePolicy__b7549145818246">0</strong> to <strong id="CreatePolicy__b7549558172418">100</strong>. If this parameter is configured, <strong id="CreatePolicy__b17549858192416">timezone</strong> is mandatory. This parameter and <strong id="CreatePolicy__b15491358182412">retention_duration_days</strong> cannot be both applied.</p>
<p id="CreatePolicy__p5549135892420">Minimum: <strong id="CreatePolicy__b8549115812419">0</strong></p>
<p id="CreatePolicy__p105491458112414">Maximum: <strong id="CreatePolicy__b2549165819246">100</strong></p>
</td>
</tr>
<tr id="CreatePolicy__row14265158102415"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreatePolicy__p8550125872410">retention_duration_days</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreatePolicy__p15501958142420">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreatePolicy__p8550125892414">Duration of retaining a backup, in days. The maximum value is <strong id="CreatePolicy__b1255055862411">99999</strong>. If the value is set to <strong id="CreatePolicy__b185501158192412">-1</strong>, backups will not be cleared by retention duration. If this parameter and <strong id="CreatePolicy__b255011588248">max_backups</strong> are left blank at the same time, the backups will be retained permanently. This parameter cannot be applied together with <strong id="CreatePolicy__b155011581240">max_backups</strong>, <strong id="CreatePolicy__b1655015822416">day_backups</strong>, <strong id="CreatePolicy__b2055035872413">week_backups</strong>, <strong id="CreatePolicy__b35502588242">month_backups</strong>, and <strong id="CreatePolicy__b115501758102416">year_backups</strong>.</p>
<p id="CreatePolicy__p17550185820242">Minimum: <strong id="CreatePolicy__b1455045817244">1</strong></p>
<p id="CreatePolicy__p2550145812415">Maximum: <strong id="CreatePolicy__b255035811249">99999</strong></p>
<p id="CreatePolicy__p0550105820248">Default: <strong id="CreatePolicy__b555011589247">-1</strong></p>
</td>
</tr>
<tr id="CreatePolicy__row1026515892416"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreatePolicy__p7550358102412">timezone</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreatePolicy__p1255014587243">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreatePolicy__p9550258202415">Time zone where the user is located. The format is UTC+01:00. If any of the parameters of yearly, monthly, weekly, or daily backup is selected, this parameter cannot be left empty.</p>
</td>
</tr>
<tr id="CreatePolicy__row152651858172416"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreatePolicy__p10550165811241">week_backups</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreatePolicy__p8550175810244">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreatePolicy__p1550458182416">Maximum number of weekly backups that can be retained. The latest backup of each week is saved in the long term. This parameter and <strong id="CreatePolicy__b85509585246">max_backups</strong> will both be applied. The value ranges from <strong id="CreatePolicy__b11550155872417">0</strong> to <strong id="CreatePolicy__b12550195811248">100</strong>. If this parameter is configured, <strong id="CreatePolicy__b1955013581249">timezone</strong> is mandatory. This parameter and <strong id="CreatePolicy__b955019589242">retention_duration_days</strong> cannot be both applied.</p>
</td>
</tr>
<tr id="CreatePolicy__row326585842417"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.1 "><p id="CreatePolicy__p18550155810248">year_backups</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.5.2.4.1.2 "><p id="CreatePolicy__p155512586246">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.5.2.4.1.3 "><p id="CreatePolicy__p1551205815245">Maximum number of yearly backups that can be retained. The latest backup of each year is saved in the long term. This parameter and <strong id="CreatePolicy__b1355185842411">max_backups</strong> will both be applied. The value ranges from <strong id="CreatePolicy__b1955125811248">0</strong> to <strong id="CreatePolicy__b1551115852416">100</strong>. If this parameter is configured, <strong id="CreatePolicy__b185511858112420">timezone</strong> is mandatory. This parameter and <strong id="CreatePolicy__b10551158162413">retention_duration_days</strong> cannot be both applied.</p>
<p id="CreatePolicy__p145511258202416">Minimum: <strong id="CreatePolicy__b105511958122411">0</strong></p>
<p id="CreatePolicy__p14551135862411">Maximum: <strong id="CreatePolicy__b95511358122412">100</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="CreatePolicy__response_PolicyTriggerResp"></a><a name="response_PolicyTriggerResp"></a><table cellpadding="4" cellspacing="0" summary="" id="CreatePolicy__response_PolicyTriggerResp" frame="border" border="1" rules="all"><caption><b>Table 11 </b>PolicyTriggerResp</caption><thead align="left"><tr id="CreatePolicy__row20272105832416"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.6.2.4.1.1"><p id="CreatePolicy__p15519581244">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.6.2.4.1.2"><p id="CreatePolicy__p1055125813247">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.6.2.4.1.3"><p id="CreatePolicy__p175515581241">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreatePolicy__row52723584245"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.6.2.4.1.1 "><p id="CreatePolicy__p115512582249">id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.6.2.4.1.2 "><p id="CreatePolicy__p7551105811245">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.6.2.4.1.3 "><p id="CreatePolicy__p15518587249">Scheduler ID</p>
</td>
</tr>
<tr id="CreatePolicy__row1027215822416"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.6.2.4.1.1 "><p id="CreatePolicy__p1555115580244">name</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.6.2.4.1.2 "><p id="CreatePolicy__p1755145862417">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.6.2.4.1.3 "><p id="CreatePolicy__p16551185802413">Scheduler name</p>
</td>
</tr>
<tr id="CreatePolicy__row2272125822416"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.6.2.4.1.1 "><p id="CreatePolicy__p2055165811247">properties</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.6.2.4.1.2 "><p id="CreatePolicy__p1555215584249"><a href="#CreatePolicy__response_PolicyTriggerPropertiesResp">PolicyTriggerPropertiesResp</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.6.2.4.1.3 "><p id="CreatePolicy__p165521258102415">Scheduler attributes</p>
</td>
</tr>
<tr id="CreatePolicy__row20272165892414"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.6.2.4.1.1 "><p id="CreatePolicy__p1552125816241">type</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.6.2.4.1.2 "><p id="CreatePolicy__p195521058192416">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.6.2.4.1.3 "><p id="CreatePolicy__p1455295814248">Scheduler type. Currently, only <strong id="CreatePolicy__b555265842418">time</strong> (periodic scheduling) is supported.</p>
<p id="CreatePolicy__p185520588249">Enumeration values:</p>
<ul id="CreatePolicy__ul1855214587247"><li id="CreatePolicy__li15521958202411"><p id="CreatePolicy__p1455225811245"><a name="CreatePolicy__li15521958202411"></a><a name="li15521958202411"></a><strong id="CreatePolicy__b555214582245">time</strong></p>
</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="CreatePolicy__response_PolicyTriggerPropertiesResp"></a><a name="response_PolicyTriggerPropertiesResp"></a><table cellpadding="4" cellspacing="0" summary="" id="CreatePolicy__response_PolicyTriggerPropertiesResp" frame="border" border="1" rules="all"><caption><b>Table 12 </b>PolicyTriggerPropertiesResp</caption><thead align="left"><tr id="CreatePolicy__row12273165892415"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.7.2.4.1.1"><p id="CreatePolicy__p165521358102416">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.7.2.4.1.2"><p id="CreatePolicy__p135521581243">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.7.2.4.1.3"><p id="CreatePolicy__p17552115811242">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreatePolicy__row18273658102414"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.1 "><p id="CreatePolicy__p75526588241">pattern</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.2 "><p id="CreatePolicy__p135521588248">Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.7.2.4.1.3 "><p id="CreatePolicy__p1755211580245">Scheduling rule of the scheduler. A maximum of 24 rules can be configured. The scheduling rule complies with iCalendar RFC 2445, but it supports only the <strong id="CreatePolicy__b255265822418">FREQ</strong>, <strong id="CreatePolicy__b1055212581240">BYDAY</strong>, <strong id="CreatePolicy__b165523584240">BYHOUR</strong>, <strong id="CreatePolicy__b95521258152419">BYMINUTE</strong>, and <strong id="CreatePolicy__b1255217580249">INTERVAL</strong> parameters. <strong id="CreatePolicy__b105526586248">FREQ</strong> can be set only to <strong id="CreatePolicy__b16552165812417">WEEKLY</strong> or <strong id="CreatePolicy__b455217580243">DAILY</strong>. <strong id="CreatePolicy__b1855245862414">BYDAY</strong> can be set to <strong id="CreatePolicy__b145521258102412">MO</strong>, <strong id="CreatePolicy__b19553158192414">TU</strong>, <strong id="CreatePolicy__b1055375819242">WE</strong>, <strong id="CreatePolicy__b155355892410">TH</strong>, <strong id="CreatePolicy__b1055319587244">FR</strong>, <strong id="CreatePolicy__b1955395813248">SA</strong>, and <strong id="CreatePolicy__b85531558102412">SU</strong> (seven days of a week). <strong id="CreatePolicy__b13553958152417">BYHOUR</strong> ranges from 0 to 23 hours. <strong id="CreatePolicy__b1455345810248">BYMINUTE</strong> ranges from 0 to 59 minutes. The scheduling interval cannot be less than 1 hour. A maximum of 24 time points are allowed in a day. For example, if the scheduling time is 14:00 (UTC) from Monday to Sunday, set the scheduling rule as follows: <strong id="CreatePolicy__b1553158192417">FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR,SA,SU;BYHOUR=14;BYMINUTE=00</strong>. If the scheduling time is 14:00 (UTC+8) every day, set the scheduling rule as follows: <strong id="CreatePolicy__b4553195812414">FREQ=DAILY;INTERVAL=1;BYHOUR=6;BYMINUTE=00</strong></p>
</td>
</tr>
<tr id="CreatePolicy__row1127445818248"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.1 "><p id="CreatePolicy__p1355395822415">start_time</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.7.2.4.1.2 "><p id="CreatePolicy__p1553558142417">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.7.2.4.1.3 "><p id="CreatePolicy__p5553175812420">Start time of the scheduler, for example, <strong id="CreatePolicy__b2553195882412">2020-01-08 09:59:49</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="CreatePolicy__response_PolicyAssociateVault"></a><a name="response_PolicyAssociateVault"></a><table cellpadding="4" cellspacing="0" summary="" id="CreatePolicy__response_PolicyAssociateVault" frame="border" border="1" rules="all"><caption><b>Table 13 </b>PolicyAssociateVault</caption><thead align="left"><tr id="CreatePolicy__row627495815243"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.8.2.4.1.1"><p id="CreatePolicy__p16554155842416">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.8.2.4.1.2"><p id="CreatePolicy__p1555425812411">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.8.2.4.1.3"><p id="CreatePolicy__p155418582245">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreatePolicy__row122741458172412"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.8.2.4.1.1 "><p id="CreatePolicy__p10554158132414">destination_vault_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.8.2.4.1.2 "><p id="CreatePolicy__p11554195852418">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.8.2.4.1.3 "><p id="CreatePolicy__p125541658142410">ID of the associated remote vault</p>
</td>
</tr>
<tr id="CreatePolicy__row102759581241"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.8.2.4.1.1 "><p id="CreatePolicy__p14554105832416">vault_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.8.2.4.1.2 "><p id="CreatePolicy__p16554165812416">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.8.2.4.1.3 "><p id="CreatePolicy__p6554105816242">Vault ID</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreatePolicy__section1555465842414"><h4 class="sectiontitle">Example Requests</h4><ul id="CreatePolicy__ul85542058192412"><li id="CreatePolicy__li65545586247"><p id="CreatePolicy__p55542058102416"><a name="CreatePolicy__li65545586247"></a><a name="li65545586247"></a>Creating a backup policy with backups automatically executed at 14:00 everyday and with each backup saved for one day</p>
<pre class="screen" id="CreatePolicy__screen1255410585243">POST https://{endpoint}/v3/f841e01fd2b14e7fa41b6ae7aa6b0594/policies
{
"policy" : {
"enabled" : true,
"name" : "policy001",
"operation_definition" : {
"day_backups" : 0,
"month_backups" : 0,
"retention_duration_days" : 1,
"timezone" : "UTC+01:00",
"week_backups" : 0,
"year_backups" : 0
},
"operation_type" : "backup",
"trigger" : {
"properties" : {
"pattern" : [ "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR,SA,SU;BYHOUR=14;BYMINUTE=00" ]
}
}
}
}</pre>
</li><li id="CreatePolicy__li1655414581247"><p id="CreatePolicy__p155541258192419"><a name="CreatePolicy__li1655414581247"></a><a name="li1655414581247"></a>Creating a replication policy with backups automatically replicated at 14:00 everyday and with each backup saved for one day</p>
<pre class="screen" id="CreatePolicy__screen115551558102411">POST https://{endpoint}/v3/f841e01fd2b14e7fa41b6ae7aa6b0594/policies
{
"policy" : {
"enabled" : true,
"name" : "policy002",
"operation_definition" : {
"retention_duration_days" : 1,
"day_backups" : 0,
"week_backups" : 0,
"month_backups" : 0,
"year_backups" : 0,
"timezone" : "UTC+01:00",
"destination_region" : "eu-nl",
"destination_project_id" : "fcf6cb26c3bf4402869792207ad3dce4"
},
"operation_type" : "replication",
"trigger" : {
"properties" : {
"pattern" : [ "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR,SA,SU;BYHOUR=14;BYMINUTE=00" ]
}
}
}
}</pre>
</li></ul>
</div>
<div class="section" id="CreatePolicy__section955512583249"><h4 class="sectiontitle">Example Responses</h4><p id="CreatePolicy__p055535812415"><strong id="CreatePolicy__b455518588249">Status code: 200</strong></p>
<p id="CreatePolicy__p11555058102417">OK</p>
<ul id="CreatePolicy__ul195551658152412"><li id="CreatePolicy__li8555058162410"><p id="CreatePolicy__p165551158182415"><a name="CreatePolicy__li8555058162410"></a><a name="li8555058162410"></a>The backup policy is created. The backup policy is to automatically perform backup at 14:00 everyday and save each backup for one day.</p>
<pre class="screen" id="CreatePolicy__screen165551858132418">{
"policy" : {
"name" : "policy001",
"enabled" : true,
"trigger" : {
"properties" : {
"pattern" : [ "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR,SA,SU;BYHOUR=14;BYMINUTE=00" ],
"start_time" : "2019-05-08T06:57:05.000+00:00"
},
"type" : "time",
"id" : "d67269a6-5369-42d7-8150-5254bd446328",
"name" : "default"
},
"operation_definition" : {
"retention_duration_days" : 1,
"year_backups" : 0,
"day_backups" : 0,
"month_backups" : 0,
"week_backups" : 0,
"timezone" : "UTC+01:00"
},
"operation_type" : "backup",
"id" : "cbb3ce6f-3332-4e7c-b98e-77290d8471ff"
}
}</pre>
</li><li id="CreatePolicy__li755512589242"><p id="CreatePolicy__p8555175813241"><a name="CreatePolicy__li755512589242"></a><a name="li755512589242"></a>Succeeded in creating a replication policy. The policy is to perform replication at 14:00 every day from Monday to Sunday. The retention policy is based on the backup retention period, which is one day.</p>
<pre class="screen" id="CreatePolicy__screen0555205822411">{
"policy" : {
"name" : "policy002",
"enabled" : true,
"trigger" : {
"id" : "b37cf79e-5cfa-4a84-99a3-91d60a314c46",
"name" : "default",
"type" : "time",
"properties" : {
"pattern" : [ "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR,SA,SU;BYHOUR=14;BYMINUTE=00" ],
"start_time" : "2019-05-08T06:58:05.000+00:00"
}
},
"operation_definition" : {
"retention_duration_days" : 1,
"day_backups" : 0,
"week_backups" : 0,
"month_backups" : 0,
"year_backups" : 0,
"timezone" : "UTC+01:00",
"destination_region" : "eu-nl",
"destination_project_id" : "fcf6cb26c3bf4402869792207ad3dce4"
},
"operation_type" : "replication",
"id" : "e47e4916-481a-4d10-95a2-165bcfe598c5"
}
}</pre>
</li></ul>
</div>
<div class="section" id="CreatePolicy__section1455616581245"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="CreatePolicy__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="CreatePolicy__row1128019580244"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p id="CreatePolicy__p7556758132418">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.2.1.3.1.2"><p id="CreatePolicy__p2556105862415">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="CreatePolicy__row1280858122410"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="CreatePolicy__p955695817246">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="CreatePolicy__p10556195813246">OK</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="CreatePolicy__section1555615587242"><h4 class="sectiontitle">Error Codes</h4><p id="CreatePolicy__p10556135822418">See <a href="ErrorCode.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="topic_300000003.html">Policies</a></div>
</div>
</div>