• Cloud Server Backup Service

csbs
  1. Help Center
  2. Cloud Server Backup Service
  3. API Reference
  4. API Description
  5. Resource Management
  6. Creating a Resource Backup

Creating a Resource Backup

Function

This API is used to select and directly back up resources.

URI

  • URI format

    POST /v1/{project_id}/providers/{provider_id}/resources/{resource_id}/action

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID

    provider_id

    Yes

    String

    Backup provider ID, currently fixed at fc4d5750-22e7-4798-8a46-f48f62c4c1da

    resource_id

    Yes

    String

    Backup object ID

    Backup provider IDs mentioned in this document are all fc4d5750-22e7-4798-8a46-f48f62c4c1da.

Request

  • Element description

    Parameter

    Mandatory

    Type

    Description

    protect

    Yes

    protect_param

    Backup parameters

  • Parameter description of field protect_param

    Parameter

    Mandatory

    Type

    Description

    backup_name

    No

    String

    Backup name. The value consists of 1 to 255 characters and can contain only letters, digits, underscores (_), and hyphens (-).

    description

    No

    String

    Backup description. The value consists of 0 to 255 characters and must not contain a greater-than sign (>) or less-than sign (<).

    incremental

    No

    Boolean

    Backup type. Value True indicates incremental backup and value False indicates full backup. For the initial backup, full backup is always adopted, in spite of which value is set.

    resource_type

    No

    String

    Entity object type of the backup object

    The current value is OS::Nova::Server indicating that the backup object is an ECS. If this parameter is not passed, the backup object type defaults to OS::Nova::Server.

    tags

    No

    List<resource_tag>

    Tag list

    This list cannot be an empty list.

    The list can contain up to 10 keys.

    Keys in this list must be unique.

    extra_info

    No

    Dict

    Additional information about the backup object

  • Parameter description of field resource_tag

    Parameter

    Mandatory

    Type

    Description

    key

    Yes

    String

    Tag key

    It consists of up to 36 characters.

    It cannot be an empty string.

    Spaces before and after a key will be deprecated.

    It can contain only letters, digits, hyphens (-), and underscores (_).

    value

    Yes

    String

    Tag value

    It consists of up to 43 characters.

    It can be an empty string.

    Spaces before and after a tag value will be deprecated.

    It can contain only letters, digits, hyphens (-), and underscores (_).

  • Example request
    POST /v1/{project_id}/providers/{provider_id}/resources/{resource_id}/action
    {
        "protect" : {
        "backup_name" : "backup",
        "description" : "backup des",
        "extra_info" : {
        }
        
      }
    }

Response

  • Element description

    Parameter

    Type

    Description

    checkpoint

    protect_resp

    Backup response

  • Parameter description of field protect_resp

    Parameter

    Type

    Description

    status

    String

    Backup status

    created_at

    String

    Creation time

    id

    String

    Backup record ID

    resource_graph

    String

    Resource graph

    project_id

    String

    Project ID

    protection_plan

    plan_resp

    Backup plan information

    extra_info

    String

    Additional information

  • Parameter description of field plan_resp

    Parameter

    Type

    Description

    id

    String

    Backup plan ID

    name

    String

    Backup plan name

    resources

    List<resource>

    Backup object list

  • Parameter description of field resource

    Parameter

    Type

    Description

    id

    String

    ID of the object to be backed up

    type

    String

    Backup object type

    If the type is VMs, the value is OS::Nova::Server.

    name

    String

    Backup object name

    extra_info

    Dict

    Additional information about the backup object

  • Example response
    {
      "checkpoint" : {
        "status" : "protecting",
        "created_at" : "2017-04-18T01:21:52.701973",
        "id" : "4468f4b8-7c78-4222-a2ca-346b5d557dd2",
        "resource_graph" : null,
        "project_id" : "b942cc8342734d15bcb246babb1953cf",
        "extra_info" : null,
        "protection_plan" : {
          "id" : "fake_04f8ea0f-2000-4389-a5ce-93a3e20d0faf",
          "resources" : [ {
            "type" : "OS::Nova::Server",
            "id" : "9506416d-db6c-406e-8bca-c0f43793d914",
            "name" : "resource_9506416d-db6c-406e-8bca-c0f43793d914",
            "extra_info" : {
        }
          } ],
          "name" : "server protect plan for 9506416d-db6c-406e-8bca-c0f43793d914"
        }
      }
    }

Status Codes

  • Normal

    Status Code

    Description

    200

    OK

  • Abnormal

    Status Code

    Description

    400

    Invalid request parameters.

    401

    Authentication failed.

    403

    No operation permission.

    404

    Requested object not found.

    500

    Service internal error.

    503

    Service unavailable.

Error Codes

For details, see Error Codes.