Configuring the Automatic Snapshot Creation Policy
Function
This API is used to configure automatic snapshot creation. By default, a snapshot is created every day.
Calling Method
For details, see Calling APIs.
URI
POST /v1.0/{project_id}/clusters/{cluster_id}/index_snapshot/policy
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition: Project ID. For details about how to obtain the project ID and name, see Obtaining the Project ID and Name. Constraints: N/A Value range: Project ID of the account. Default value: N/A |
|
cluster_id |
Yes |
String |
Definition: ID of the cluster for which you want to create snapshots automatically. For details about how to obtain the cluster ID, see Obtaining the Cluster ID. Constraints: N/A Value range: Cluster ID. Default value: N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
indices |
No |
String |
Definition: Specify the name of the index you want to restore. Constraints: You can use "*" to match multiple indexes. For example, index* indicates that all indexes with the prefix index will be restored.
Value range: The value is a string of 0 to 1024 characters that cannot contain uppercase letters, spaces, or the following special characters: "\<|>/? Default value: By default, this parameter is left blank. If you do not specify any index name, all indexes in snapshots will be restored by default. |
|
prefix |
No |
String |
Definition: Prefix of a snapshot that is automatically created, which is manually entered. Constraints: This parameter is mandatory when enable is set to true. Value range: Enter up to 32 characters and start with a lowercase letter. Lowercase letters, digits, hyphens (-), and underscores (_) are allowed. Default value: N/A |
|
period |
No |
String |
Definition: Time when a snapshot is generated every day. Snapshots can only be generated on the hour. The format is HH:mm z: HH:mm refers to the hour time and z refers to the time zone. For example, 00:00 GMT+08:00 and 01:00 GMT+08:00. Constraints: N/A Value range: N/A Default value: 00:00 GMT+08:00
NOTE:
The default value is 00:00 GMT+08:00. 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. This parameter is mandatory when enable is set to true.
|
|
keepday |
No |
Integer |
Definition: Customize the number of snapshots to be retained. Expired snapshots will be automatically deleted on the half hour. The deletion policy applies only to automated snapshots that are executed at the same frequency as the current automatic snapshot creation policy. Constraints: N/A Value range: 1–90 Default value: N/A
NOTE:
This parameter is mandatory when enable is set to true.
|
|
enable |
Yes |
String |
Definition: Whether to enable the automatic snapshot creation policy. Constraints: N/A Value range:
Default value: N/A |
|
delete_auto |
No |
String |
Definition: Whether to clear all the automatically created snapshots when the automatic snapshot creation policy is disabled. Constraints: N/A Value range:
Default value: false |
|
frequency |
No |
String |
Definition: Frequency of automatically creating snapshots. Constraints: N/A Value range:
Default value: DAY |
Response Parameters
Status code: 200
Request succeeded.
None
Example Requests
Configure the automatic snapshot creation policy.
POST https://{Endpoint}/v1.0/{project_id}/clusters/4f3deec3-efa8-4598-bf91-560aad1377a3/index_snapshot/policy
{
"prefix" : "snapshot",
"period" : "16:00 GMT+08:00",
"keepday" : 7,
"frequency" : "DAY",
"enable" : "true",
"delete_auto" : "false"
}
Example Responses
None
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Request succeeded. |
|
406 |
The server could not fulfill the request according to the content characteristics of the request. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot