Querying the Backup Capability of a Resource

Function

This API is used to query whether a resource can be backed up.

URI

  • URI format

    POST https://{endpoint}/v1/{project_id}/providers/{provider_id}/resources/action

  • Parameter description

    Table 1 Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID

    provider_id

    Yes

    String

    Backup provider ID, which specifies whether the backup object is a server or disk. This parameter has a fixed value. For CSBS, the value is fc4d5750-22e7-4798-8a46-f48f62c4c1da.

Request

  • Parameter description

    Table 2 Parameter description

    Parameter

    Mandatory

    Type

    Description

    check_protectable

    Yes

    List<protectable_param>

    Query parameter list

    For details, see Table 3.

  • Parameter description of field protectable_param

    Table 3 Parameter description of field protectable_param

    Parameter

    Mandatory

    Type

    Description

    resource_id

    Yes

    String

    ID of the resource (server or disk) to be checked

    For details about how to obtain the server ID, see the Elastic Cloud Server API Reference. For details about how to obtain the disk ID, see the Elastic Volume Service API Reference.

    resource_type

    Yes

    String

    Type of the resource to be checked, for example, OS::Nova::Server for an ECS

  • Example request

    POST https://{endpoint}/v1/{project_id}/providers/{provider_id}/resources/action
    {
      "check_protectable" : [ {
        "resource_id" : "6507cb66-90dc-4a12-a573-c9f3398f899d",
        "resource_type" : "OS::Nova::Server"
      } ]
    }
    

Response

  • Parameter description

    Table 4 Parameter description

    Parameter

    Type

    Description

    protectable

    List<check_resp>

    Check result list

    For details, see Table 5.

  • Parameter description of field check_resp

    Table 5 Parameter description of field check_resp

    Parameter

    Type

    Description

    result

    Boolean

    Whether the resource can be backed up

    true: yes

    false: no

    resource_type

    String

    Resource type

    Possible values are OS::Nova::Server (ECS) and OS::Ironic::BareMetalServer (BMS).

    error_code

    String

    Error code. If an error occurs, a value is returned.

    error_msg

    String

    Error message, which will be returned if the VM is associated with a backup policy. If an error occurs, a value is returned.

    resource_id

    String

    Resource ID

  • Example response

    {
      "protectable" : [ {
        "resource_id" : "6507cb66-90dc-4a12-a573-c9f3398f899d",
        "resource_type" : "OS::Nova::Server",
        "result" : true
      } ]
    }
    

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.