cos:GetBucketInventory.cos:PutBucketInventory.cos:DeleteBucketInventory.cos:GetBucketInventory.cos:PostBucketInventory../coscli inventory --method [method] cos://<bucket-name>
Parameter Format | Description | Example |
cos://<bucket-name> | Specify the target bucket. Supports using the bucket alias in configuration parameters or the bucket name for access. If using the bucket name for access, you must also include the endpoint flag. | Access with the bucket alias: cos://example-alias Access with the bucket name: cos://examplebucket-1250000000 |
Flag Abbreviation | Flag Name | Description |
-h | --help | Views the usage of this command. |
None | --method | Specify the required operation, including put (set bucket inventory), get (query bucket inventory), delete (delete bucket inventory), list (list bucket inventory), post (initiate one-time list). |
None | --task-id | Inventory Task ID |
None | --configuration | Inventory configuration (supports JSON format, XML format, or directly specifying a file path, such as /data/configuration.txt, which needs to be specified as file:///data/configuration.txt) |
./coscli inventory --method put cos://example-alias --task-id list4 --configuration "<InventoryConfiguration>...</InventoryConfiguration>"
./coscli inventory --method get cos://example-alias --task-id list4
SECTION | KEY | VALUE------------------+-------------------+------------------------------------------------Basic | ID | list4+ +-------------------+-----------------------------------------------+| Enabled | false+ +-------------------+-----------------------------------------------+| Included Versions | All+-----------------+-------------------+-----------------------------------------------+| |+-----------------+-------------------+-----------------------------------------------+Schedule | Frequency | Weekly+-----------------+-------------------+-----------------------------------------------+| |+-----------------+-------------------+-----------------------------------------------+Destination | Bucket | qcs::cos:ap-nanjing::test-125000000+ +-------------------+-----------------------------------------------+| Format | CSV+ +-------------------+-----------------------------------------------+| Account ID | 100000000+ +-------------------+-----------------------------------------------+| Prefix | list4+-----------------+-------------------+-----------------------------------------------+| |+-----------------+-------------------+-----------------------------------------------+Filter | Prefix | myPrefix+ +-------------------+-----------------------------------------------+| Tag | age=18+ +-------------------+-----------------------------------------------+| Period | 2026-01-18 to 2019-09-17+-----------------+-------------------+-----------------------------------------------+| |+-----------------+-------------------+-----------------------------------------------+Optional Fields | Field | Size+ + +-----------------------------------------------+| | ETag+ + +-----------------------------------------------+| | StorageClass+ + +-----------------------------------------------+| | IsMultipartUploaded+ + +-----------------------------------------------+| | Tag+ + +-----------------------------------------------+| | LastModifiedDate------------------+-------------------+------------------------------------------------Inventory Configuration Details
./coscli inventory --method delete cos://example-alias --task-id list4
./coscli inventory --method list cos://example-alias
ID | STATUS | SCHEDULE | INCLUDEDOBJECTVERSIONS | DESTINATION | FILTER | FIELDS--------+----------+-------------------+------------------------+-------------------------------------------------------+----------------------------------+----------------------list1 | Enabled | Frequency: Daily | All | Bucket: qcs::cos:ap-nanjing::test-125000000 | Period: 2019-09-17 to 2019-09-17 | Size| | | | Format: CSV | | ETag| | | | Account: 1000000000 | | StorageClass| | | | Prefix: list1 | | IsMultipartUploaded| | | | | | ReplicationStatus| | | | | | LastModifiedDate--------+----------+-------------------+------------------------+-------------------------------------------------------+----------------------------------+----------------------list3 | Disabled | Frequency: Weekly | All | Bucket: qcs::cos:ap-nanjing::test-125000000 | Period: 2026-01-18 to 2019-09-17 | Size| | | | Format: CSV | | ETag| | | | Account: 1000000000 | | StorageClass| | | | Prefix: list3 | | IsMultipartUploaded| | | | | | ReplicationStatus| | | | | | LastModifiedDate--------+----------+-------------------+------------------------+-------------------------------------------------------+----------------------------------+----------------------list4 | Disabled | Frequency: Weekly | All | Bucket: qcs::cos:ap-nanjing::test-125000000 | Prefix: myPrefix | Size| | | | Format: CSV | Tags: age=18 | ETag| | | | Account: 1000000000 | Period: 2026-01-18 to 2019-09-17 | StorageClass| | | | Prefix: list4 | | IsMultipartUploaded| | | | | | Tag| | | | | | LastModifiedDate--------+----------+-------------------+------------------------+-------------------------------------------------------+----------------------------------+----------------------Detailed COS Bucket Inventory ConfigurationsTotal inventory configurations: 3
./coscli inventory --method post cos://example-alias --task-id list4 --configuration "<InventoryConfiguration>...</InventoryConfiguration>"
Feedback