mc inventory put

mc inventory put reads a YAML configuration file and creates or replaces the inventory configuration in a bucket. The command uses the id field to determine whether to create a new configuration with that value or update an existing one with matching value.

See the configuration reference for details on all available configuration options.

Syntax

Parameters

TARGET/BUCKET

Required

The full path to the bucket for which to create or update an inventory configuration. Specify both the alias and bucket name in the format ALIAS/BUCKET.

YAML_FILE

Required

The path to a YAML file containing the inventory configuration. The file must include an id field that uniquely identifies the configuration within the bucket.

The YAML file must conform to the inventory configuration schema with apiVersion: v1. Generate a template using mc inventory generate as a starting point.

Global flags

This command supports any of the global flags.

Examples

Create a new inventory configuration

The following commands generate a template, customize it, and create the inventory configuration:

mc inventory generate myminio/mybucket weekly-report > weekly.yml

Edit weekly.yml to configure the job, then create the configuration:

mc inventory put myminio/mybucket weekly.yml
  • Replace myminio with the alias of your AIStor deployment.
  • Replace mybucket with the name of the bucket to inventory.

Replace an existing inventory configuration

The following command updates an existing inventory configuration by replacing it with a new one:

mc inventory put myminio/mybucket updated-config.yml

The inventory job ID in updated-config.yml must match the ID of an existing configuration. The new configuration replaces the old one.

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:PutInventoryConfiguration permission for the specified bucket.

For more information on AIStor policies and permissions, see Access Management.

Behavior

Running jobs

If you update the configuration of a running job:

  • The running job continues using the old configuration
  • The new configuration applies to the next scheduled execution

To stop a running job, use mc inventory cancel.