doc-exports/docs/csbs/api-ref/en-us_topic_0098635088.html
Wei, Hongmin 8ce662c4dc CSBS API initial version
Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: Wei, Hongmin <weihongmin1@huawei.com>
Co-committed-by: Wei, Hongmin <weihongmin1@huawei.com>
2022-10-24 21:06:50 +00:00

15 KiB

Adding a Tag to a Backup Resource

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

  • Parameter description
    Table 2 Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID

    resource_id

    Yes

    String

    Resource ID

Request

  • Parameter description
    Table 3 Parameter description

    Parameter

    Mandatory

    Type

    Description

    tag

    Yes

    tag

    List of tags

  • Parameter description of field tag
    Table 4 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 https://{endpoint}/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.