• Cloud Server Backup Service

csbs
  1. Help Center
  2. Cloud Server Backup Service
  3. API Reference
  4. API Description
  5. Tag Management
  6. Adding Backup Resource Tags

Adding Backup Resource Tags

Function

A resource can have up to 10 tags.

The API is idempotent.

If a to-be-created tag has the same key as an existing tag, the tag will be created and overwrite the existing one.

URI

  • URI format

    POST /v1/{project_id}/csbs_backup/{resource_id}/tags

  • Request header

    Parameter

    Mandatory

    Type

    Description

    Content-type

    MIME type of the body in the request

    Yes

    application/json

    X-Auth-Token

    User token

    Yes

    -

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID

    resource_id

    Yes

    String

    Resource ID

Request

  • Element description

    Parameter

    Mandatory

    Type

    Description

    tag

    Yes

    tag

    List of included tags. Backups with these tags will be filtered.

  • Parameter description of field 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}/csbs_backup/{resource_id}/tags
  • Example request
    {
        "tag":
        {
            "key":"DEV",
            "value":"DEV1"
        }
    }

Status Codes

  • Normal

    Status Code

    Description

    204

    No Content

  • Abnormal

    Status Code

    Description

    400

    Invalid action.

    401

    Authentication failed.

    403

    You do not have permission to perform this operation.

    404

    The requested resource was not found.

    500

    A system exception occurs.

Error Codes

For details, see Error Codes.