mc policy

Manages anonymous access to buckets and objects.

Syntax

CLI
USAGE:
  mc policy [FLAGS] set PERMISSION TARGET
  mc policy [FLAGS] set-json FILE TARGET
  mc policy [FLAGS] get TARGET
  mc policy [FLAGS] get-json TARGET
  mc policy [FLAGS] list TARGET

FLAGS:
  --recursive, -r  list recursively
  --json           enable JSON lines formatted output
  --debug          enable debug output
  --insecure       disable SSL certificate verification
  --help, -h       show help

PERMISSION:
  Allowed policies are: [none, download, upload, public].

FILE:
  A valid HPE Object Store policy JSON filepath.

Parameters

Parameter Description
PERMISSION The canned policy to set. One of:
  • none
  • download
  • upload
  • public
FILE The path to a file containing a valid JSON Object Store policy.
NOTE
You can either set the canned policy directly using the PERMISSION parameter or use a custom policy file with the FILE parameter.
TARGET The alias of a configured HPE Ezmeral Object Store deployment from or on which the command retrieves or sets policies. This parameter is mandatory.
recursive List all folders recursively instead of just the top-level folder.
json Enable JSON formatted output.
debug Enable output for debugging.
insecure Disable SSL verification.
help Show this help.

Examples

  1. Set the download policy for a bucket named northamerica in the Object Store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc policy set download salesobject/northamerica/
  2. Set a custom policy contained in the file /sales/policies/confidential.json for a bucket named northamerica in the Object Store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc policy set-json /sales/policies/confidential.json salesobject/northamerica/
  3. Get the policy for a bucket named northamerica in the Object Store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc policy get salesobject/northamerica/
  4. Get the policy in JSON format for a bucket named northamerica in the Object Store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc policy get-json salesobject/northamerica/
  5. List policies for a bucket named northamerica in the Object Store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc policy list salesobject/northamerica/
  6. List public object URLs recursively for a bucket named northamerica in the Object Store deployment with alias salesobject:
    CLI
    /opt/mapr/bin/mc policy list --recursive links salesobject/northamerica/