Files
doc-exports/docs/css/api-ref/StartAutoCreateSnapshots.html
zhengxiu 8f6b8d3664 css api 25.6.0 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: zhengxiu <zhengxiu@huawei.com>
Co-committed-by: zhengxiu <zhengxiu@huawei.com>
2025-11-25 11:21:12 +00:00

210 lines
12 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<a name="StartAutoCreateSnapshots"></a><a name="StartAutoCreateSnapshots"></a>
<h1 class="topictitle1">Enabling Automatic Snapshot Creation</h1>
<div id="body1708331107508"><div class="section"><h4 class="sectiontitle">Function</h4><p>CSS allows you to use snapshots to back up and restore the data of an OpenSearch cluster. By storing a snapshot in an OBS bucket, you save a point-in-time copy of the cluster's data. By restoring this snapshot, you can restore the cluster to a previous state. There are two ways to create snapshots to back up a CSS cluster: automatic and manual.</p>
<ul><li><p>Automatic snapshot creation: Snapshots are created periodically based on a preset time policy, for example, daily or weekly, to ensure continuous data protection. This reduces manual effort and improves backup reliability and efficiency.</p>
</li><li><p>Manual snapshot creation: You create snapshots manually for special occasions, for example, prior to a high-risk operation (such as a cluster upgrade). This ensures you can restore data using snapshots in case anything should go wrong. Manual snapshots provide additional flexibility.</p>
</li></ul>
<p>This API is used to enable automatic snapshot creation.</p>
</div>
<div class="section" id="StartAutoCreateSnapshots__atuogenerate_1"><h4 class="sectiontitle">Calling Method</h4><p>For details, see <a href="css_03_0077.html">Calling APIs</a>.</p>
</div>
<div class="section" id="StartAutoCreateSnapshots__atuogenerate_2"><h4 class="sectiontitle">URI</h4><p>POST /v2.0/{project_id}/clusters/{cluster_id}/snapshots/policy/open</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p><strong>Definition</strong>:</p>
<p>Project ID. For details about how to obtain the project ID and name, see <a href="css_03_0071.html">Obtaining the Project ID and Name</a>.</p>
<p><strong>Constraints</strong>:</p>
<p>N/A</p>
<p><strong>Value range</strong>:</p>
<p>Project ID of the account.</p>
<p><strong>Default value</strong>:</p>
<p>N/A</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>cluster_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p><strong>Definition</strong>:</p>
<p>ID of the cluster that the snapshot belongs to. For details about how to obtain the cluster ID, see <a href="css_03_0101.html">Obtaining the Cluster ID</a>.</p>
<p><strong>Constraints</strong>:</p>
<p>N/A</p>
<p><strong>Value range</strong>:</p>
<p>Cluster ID.</p>
<p><strong>Default value</strong>:</p>
<p>N/A</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="StartAutoCreateSnapshots__request_StartAutoCreateSnapshotsReq" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request body parameters</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.4.2.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p>indices</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p><strong>Definition</strong>:</p>
<p>Name of an index to be backed up. Multiple indexes are separated by commas (,). By default, all indexes are backed up. You can use the combination of a backslash and an asterisk (*) to back up data of certain indexes. For example, if you specify 2018-06*, then the data of the indexes with the prefix <strong>2018-06</strong> will be backed up.</p>
<p><strong>Constraints</strong>:</p>
<p>N/A</p>
<p><strong>Value range</strong>:</p>
<p>The value can contain 0 to 1,024 characters. Uppercase letters, spaces, and the following special characters are not allowed: "\&lt;|&gt;/?</p>
<p><strong>Default value</strong>:</p>
<p>N/A</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p>keepday</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p>Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p><strong>Definition</strong>:</p>
<p>Set the number of snapshots to be retained. Expired snapshots will be automatically deleted on the half hour. The deletion policy applies only to auto snapshots that are executed at the same frequency as the current automatic snapshot creation policy.</p>
<p><strong>Constraints</strong>:</p>
<p>N/A</p>
<p><strong>Value range</strong>:</p>
<p>190</p>
<p><strong>Default value</strong>:</p>
<p>N/A</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p>frequency</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p><strong>Definition</strong>:</p>
<p>Frequency of automatically creating snapshots.</p>
<p><strong>Constraints</strong>:</p>
<p>N/A</p>
<p><strong>Value range</strong>:</p>
<p>N/A</p>
<p><strong>Default value</strong>:</p>
<p>DAY</p>
<p>When the value is HOUR, the task is executed every hour. When the value is DAY, the scheduled task is executed every day. When the parameter is set to SUN, MON, TUE, WED, THU, FRI or SAT, the scheduled task is executed at the specified day of every week. The number of retained snapshots depends on the execution frequency and indexes set in the automatic snapshot creation policy. If the execution interval is short or the index data volume is large, the number of retained automatic snapshots may not reach the preset value. Set this value based on actual conditions.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p>period</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p><strong>Definition</strong>:</p>
<p>Time when a snapshot is created every day.</p>
<p><strong>Constraints</strong>:</p>
<p>N/A</p>
<p><strong>Value range</strong>:</p>
<p>Snapshots can only be created on the hour. The time format is the time followed by the time zone, specifically, <strong>HH:mm z</strong>. In the format, <strong>HH:mm</strong> refers to the hour time and <strong>z</strong> refers to the time zone. For example, 00:00 GMT+08:00 and 01:00 GMT+08:00.</p>
<p><strong>Default value</strong>:</p>
<p>00:00 GMT+08:00</p>
<div class="note"><span class="notetitle"> NOTE: </span><div class="notebody">When frequency is set to HOUR, you do not need to specify period. By default, snapshot creation starts from the next hour after the settings are successful.</div></div>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p>prefix</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p><strong>Definition</strong>:</p>
<p>Prefix of a snapshot that is automatically created, which is manually entered.</p>
<p><strong>Constraints</strong>:</p>
<p>N/A</p>
<p><strong>Value range</strong>:</p>
<p>Enter up to 32 characters and start with a lowercase letter. Lowercase letters, digits, hyphens (-), and underscores (_) are allowed.</p>
<p><strong>Default value</strong>:</p>
<p>N/A</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Response Parameters</h4><p><strong>Status code: 200</strong></p>
<p>Request succeeded.</p>
<p>None</p>
</div>
<div class="section"><h4 class="sectiontitle">Example Requests</h4><p>Enable the automatic backup function.</p>
<pre class="screen">POST https://{Endpoint}/v2.0/{project_id}/clusters/ea244205-d641-45d9-9dcb-ab2236bcd07e/snapshots/policy/open
{
"indices" : "*",
"keepday" : 7,
"frequency" : "DAY",
"period" : "16:00 GMT+08:00",
"prefix" : "snapshot"
}</pre>
</div>
<div class="section"><h4 class="sectiontitle">Example Responses</h4><p>None</p>
</div>
<div class="section"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="StartAutoCreateSnapshots__status_code" frame="border" border="1" rules="all"><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.8.2.1.3.1.1"><p>Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.8.2.1.3.1.2"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p>200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p>Request succeeded.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p>400</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p>Invalid request.</p>
<p>Modify the request before retry.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p>403</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p>Request rejected.The server has received the request and understood it, but refused to respond to it. The client should not repeat the request without modifications.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Error Codes</h4><p>See <a href="css_03_0076.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="snapshot_management_0.html">Snapshot Management</a></div>
</div>
</div>