tencent cloud

Cloud Object Storage

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Features
Use Cases
Strengths
Concepts
Regions and Access Endpoints
Specifications and Limits
Service Regions and Service Providers
Billing
Billing Overview
Billing Method
Billable Items
Free Tier
Billing Examples
Viewing and Downloading Bill
Payment Overdue
FAQs
Getting Started
Console
Getting Started with COSBrowser
User Guide
Creating Request
Bucket
Object
Data Management
Batch Operation
Global Acceleration
Monitoring and Alarms
Operations Center
Data Processing
Content Moderation
Smart Toolbox
Data Processing Workflow
Application Integration
User Tools
Tool Overview
Installation and Configuration of Environment
COSBrowser
COSCLI (Beta)
COSCMD
COS Migration
FTP Server
Hadoop
COSDistCp
HDFS TO COS
GooseFS-Lite
Online Tools
Diagnostic Tool
Use Cases
Overview
Access Control and Permission Management
Performance Optimization
Accessing COS with AWS S3 SDK
Data Disaster Recovery and Backup
Domain Name Management Practice
Image Processing
Audio/Video Practices
Workflow
Direct Data Upload
Content Moderation
Data Security
Data Verification
Big Data Practice
COS Cost Optimization Solutions
Using COS in the Third-party Applications
Migration Guide
Migrating Local Data to COS
Migrating Data from Third-Party Cloud Storage Service to COS
Migrating Data from URL to COS
Migrating Data Within COS
Migrating Data Between HDFS and COS
Data Lake Storage
Cloud Native Datalake Storage
Metadata Accelerator
GooseFS
Data Processing
Data Processing Overview
Image Processing
Media Processing
Content Moderation
File Processing Service
File Preview
Troubleshooting
Obtaining RequestId
Slow Upload over Public Network
403 Error for COS Access
Resource Access Error
POST Object Common Exceptions
API Documentation
Introduction
Common Request Headers
Common Response Headers
Error Codes
Request Signature
Action List
Service APIs
Bucket APIs
Object APIs
Batch Operation APIs
Data Processing APIs
Job and Workflow
Content Moderation APIs
Cloud Antivirus API
SDK Documentation
SDK Overview
Preparations
Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Flutter SDK
Go SDK
iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
React Native SDK
Mini Program SDK
Error Codes
Harmony SDK
Endpoint SDK Quality Optimization
Security and Compliance
Data Disaster Recovery
Data Security
Cloud Access Management
FAQs
Popular Questions
General
Billing
Domain Name Compliance Issues
Bucket Configuration
Domain Names and CDN
Object Operations
Logging and Monitoring
Permission Management
Data Processing
Data Security
Pre-signed URL Issues
SDKs
Tools
APIs
Agreements
Service Level Agreement
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary

Inventory - inventory

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2025-10-28 16:07:10
The inventory command is used to set, query, delete, list, and trigger a one-time list.
Note:
To query the inventory, when performing authorization policy, set action to cos:GetBucketInventory.
To set the inventory, when performing authorization policy, set action to cos:PutBucketInventory.
To delete the inventory, when performing authorization policy, set action to cos:DeleteBucketInventory.
To list the inventory, when performing authorization policy, set action to cos:GetBucketInventory.
To trigger a one-time list, when performing authorization policy, set action to cos:PostBucketInventory.
For more authorization, please refer to Business APIs Supporting CAM.

Command Syntax

./coscli inventory --method [method] cos://<bucket-name>
The inventory command includes the following parameters:
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
The inventory command includes the following optional flags:
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)
Note:
For more general options for this command (such as switching buckets or user accounts), see Common Options.

Setting Bucket Inventory

Operation Example

Set the inventory for the bucket named example-alias. The command is as follows (specific format see Setting Bucket Inventory):
./coscli inventory --method put cos://example-alias --task-id list4 --configuration "<InventoryConfiguration>...</InventoryConfiguration>"

Querying Bucket Inventory

Operation Example

Query the manifest tasks of the bucket named example-alias list4.
./coscli inventory --method get cos://example-alias --task-id list4
Output the following result.
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

Deleting a Bucket Inventory

Operation Example

Delete the manifest task list4 of the bucket named example-alias. The command is as follows:
./coscli inventory --method delete cos://example-alias --task-id list4

Listing All Bucket Inventories

Operation Example

List all manifest tasks of the bucket named example-alias.
./coscli inventory --method list cos://example-alias
Output the following result.
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 Configurations

Total inventory configurations: 3


Initiating a One-Time List

Operation Example

Initiate a one-time inventory task for the bucket named example-alias. The command is as follows (specific format see Initiating a One-Time Inventory Task):
./coscli inventory --method post cos://example-alias --task-id list4 --configuration "<InventoryConfiguration>...</InventoryConfiguration>"



Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan