mc inventory list
The mc inventory list command lists all inventory configurations for a specified bucket.
The command displays the inventory configurations in a table format showing the bucket name, configuration ID, and owner. You can optionally output the full YAML definitions for each configuration.
This command has an alias: mc inventory ls.
Syntax
Parameters
TARGET
Required
The full path to the bucket for which to list inventory configurations.
Specify both the alias and bucket name in the format ALIAS/BUCKET.
--output-dir
Alias: -o
Optional
Save the YAML definitions for each inventory configuration to individual files in the specified directory.
Each configuration is saved as a separate file named ID.yaml in the backup-configs directory, where ID is the inventory configuration ID.
You can use these files with mc inventory put to restore or recreate the configurations.
The command creates the backup-configs directory if it does not exist.
The command fails if the directory exists and has any files or data.
--print-yaml
Optional
Print the complete YAML definition for each inventory configuration to standard output instead of the default table format.
Global flags
This command supports any of the global flags.
Examples
List all inventory configurations
The following command lists all inventory configurations for bucket mybucket:
mc inventory list myaistor/mybucket
- Replace
myaistorwith the alias of your AIStor deployment. - Replace
mybucketwith the name of the bucket.
The output displays a table with columns:
- BUCKET: The bucket name
- ID: The inventory configuration ID
- OWNER: The user or service account that created the configuration
Save inventory configurations to files
The following command saves all inventory configuration YAML definitions to a directory:
mc inventory list myaistor/mybucket --output-dir=./backup-configs
S3 compatibility
The mc commandline tool is built for compatibility with the AWS S3 API and is tested with AIStor and AWS S3 for expected functionality and behavior.
MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported.
While mc commands may work as documented, any such usage is at your own risk.
Permissions
The user or service account running this command must have the s3:GetInventoryConfiguration permission for the specified bucket.
For more information on AIStor policies and permissions, see Access Management.
Behavior
Empty results
If the specified bucket has no inventory configurations, the command returns a string similar to "No inventory configuration found".