• Scalable File Service

sfs
  1. Help Center
  2. Scalable File Service
  3. API Reference
  4. SFS APIs
  5. Share Tag
  6. Batch Adding Share Tags

Batch Adding Share Tags

Function

This interface is used to batch add tags to a specified share.

A share can have a maximum of 10 tags.

The keys of multiple tags added to a share must be unique.

This interface is idempotent. If the key to be added is already added to the share, the tag is updated.

URI

  • POST /v2/{project_id}/sfs/{share_id}/tags/action
  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    string

    Specifies the project ID of the operator.

    share_id

    Yes

    string

    Specifies the share ID.

Request

  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    action

    Yes

    string

    Specifies the operation identifier. Possible values are create and delete. Use create to batch add tags to a specified share.

    tags

    No

    list<resource_tag>

    Specifies the tag list.

    This parameter is mandatory when the tenant permission is used. For the op_service permission, choose either this field or sys_tags.

    sys_tags

    No

    List<resource_tag>

    Specifies the system tag list.

    This field is available only to the op_service permission. Choose either this field or tags.

    Currently, TMS invokes only one resource_tag structure. The key is fixed as _sys_enterprise_project_id.

    The value is UUID or 0. 0 indicates the enterprise project by default.

  • Description of field resource_tag

    Parameter

    Mandatory

    Type

    Description

    key

    Yes

    string

    Specifies the key of the tag. The value can contain a maximum of 36 characters. The key cannot be empty and can only contain letters, digits, hyphens (-), and underscores (_).

    value

    Yes

    string

    Specifies the value of the tag. The value contains a maximum of 43 characters and can be an empty string. It can only contain letters, digits, hyphens (-), and underscores (_).

  • Example request
    {
        "action": "create",
        "tags": [
            {
                "key": "key1",
                "value": "value1"
            },
            {
                "key": "key2",
                "value": "value2"
            }
        ]
    }

Response

  • Parameter description

    None

  • Example response

    None

Status Codes

  • Normal

    204

  • Abnormal

    Status Code

    Description

    400 Bad Request

    Invalid value.

    401 Unauthorized

    Authentication failed.

    403 Forbidden

    You are forbidden to access the requested page.

    404 Not Found

    The requested resource was not found.

    500 Internal Server Error

    The request is not completed because of a service error.