Getting Started
This section describes how to use CSBS APIs to back up a cloud server.
- The token obtained from IAM is valid for only 24 hours. If you want to use one token for authentication, you can cache it to avoid frequently calling.
Involved APIs
To use token authentication, you need to obtain a token and add X-Auth-Token to the request headers.
- API for obtaining tokens from IAM
- CSBS API for creating backups
Procedure
- Obtain the token by following instructions in Making an API Request.
- Obtain the token by following instructions in Obtaining a Project ID.
- Make a POST request using the address https://CSBS endpoint//v1/{project_id}/providers/fc4d5750-22e7-4798-8a46-f48f62c4c1da/resources/{resource_id}/action, where {project_id} is the ID you obtained in step 2 and {resource_id} is the server ID.
- In the request headers, add X-Auth-Token and set its value to be the token obtained in the previous step.
- Pass the following parameters to the response body:
{ "protect" : { "backup_name" : "database_backup", //Backup name (optional parameter) "description" : "backup for database version 2.2.1 before upgrade." //Backup description (optional parameter) } }
If the request is successful, the response contains the backup record ID (checkpoint_id).
If the request fails, an error code and error information are returned. For details, see Error Codes.
- Use checkpoint_id to filter backups. For detailed operations, see Querying All Backups. When the backup status changes to Available, the backup is successful.
For details about error codes, see Status Codes.
- Obtain the backup ID from the response body. After the backup, you can use the backup record ID and backup ID to specifically restore a server or delete a backup.
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