Updated on 2022-02-22 GMT+08:00

Getting Started

This section describes how to create a VBS backup by calling VBS APIs.

  • 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 frequent calling.

Involved APIs

To use token authentication, you need to obtain a token and add X-Auth-Token to the request header of API calls.

  • API for obtaining tokens from IAM
  • VBS API for creating backups

Procedure

  1. Obtain the token by following instructions in Calling APIs.
  2. Send POST https://VBS endpoint/v2/project ID/cloudbackups.
  3. Add the X-Auth-Token request header.
  4. Specify the following parameters in the request body:
    {
        "backup": {
            "volume_id": "c68ae7fb-0aa5-4a97-ab01-ed02c5b7e768",
            "name": "backup1",
            "description": "Backup_Demo",
            "tags":[{
                "key":"key",
                "value":"value"
             }]
        }
    }

    If the request is responded, a job ID is returned.

    If the request fails, an error code and error information are returned. For details, see Error Codes.

  1. Query job details using the job ID by referring to Querying the Job Status.

    If the returned job status is SUCCESS, the VBS backup is successfully created.

    For details about error codes, see Error Codes.

  2. Obtain the backup ID (backup_id) from the request body for querying job details and then use the ID to query or delete the backup, as well as use the backup to restore data.