Updated on 2026-09-20 GMT+08:00

Obtaining the Tags of a Bucket

Function

You can use this command to obtain the tags of a bucket.

Constraints

Command Line Structure

  • Windows
    obsutil bucket-tagging obs://bucket -method=get [-config=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]
  • macOS or Linux
    ./obsutil bucket-tagging obs://bucket -method=get [-config=xxx] [-e=xxx] [-i=xxx] [-k=xxx] [-t=xxx]

Examples

  • In Windows, run obsutil bucket-tagging obs://test-bucket -method=get to obtain the tag configuration of bucket test-bucket.
    obsutil bucket-tagging obs://test-bucket -method=get
    
    Start at 2024-09-30 07:59:28.8675681 +0000 UTC
    
    Index                    Tag Key             Tag Value
    0                        key1                value1
    
    1                        key2                value2
    
    Get tagging succeed for bucket [test-bucket], requestId is [0000019AB614A37A40193E25E4C543CA], count is [2]

Parameter Description

Parameter

Optional or Mandatory

Description

bucket

Mandatory

The bucket name

method

Mandatory

The method. Set it to get when you obtain the bucket tag configuration.

config

Optional (additional parameter)

The user-defined configuration file for executing the current command. For details about parameters that can be configured, see Configuration Parameters.

e

Optional (additional parameter)

The endpoint

i

Optional (additional parameter)

The user's AK

k

Optional (additional parameter)

The user's SK

t

Optional (additional parameter)

The user's security token

Helpful Links

  • For details about the API for obtaining tags of a bucket, see Obtaining Tags of a Bucket.
  • For details about the meanings, causes, and handling methods of error codes that may be returned during the operation, see OBS Error Codes.