Commands for managing keys
The Ozone shell commands enable you to upload, download, view, delete, and list keys.
Downloading a key from a bucket
Command Syntax |
ozone sh key get /<volumename>/<bucketname>/<keyname> <local_filename> |
Purpose | Downloads the specified key from a bucket in the Ozone cluster to the local file system. |
Arguments |
|
Example | ozone sh key get /hive/jun/sales.orc sales_jun.orcThis command downloads the sales.orc file from /hive/junbucket and writes to the sales_jun.orc file present in the local file system. |
Uploading a key to a bucket
Command Syntax |
ozone sh key put /<volumename>/<bucketname>/<keyname> <filename> |
Purpose | Uploads a file from the local file system to the specified bucket in the Ozone cluster. |
Arguments |
|
Example | ozone sh key put /hive/year/sales.orc sales_corrected.orcThis command adds the sales_corrected.orc file from the local file system as key to /hive/year/sales.orc on the Ozone cluster. |
Deleting a key
Command Syntax |
ozone sh key delete /<volumename>/<bucketname>/<keyname> |
Purpose | Deletes the specified key from the Ozone cluster. |
Arguments | The name of the key in /<volumename>/<bucketname>/<keyname> format. |
Example | ozone sh key delete /hive/jun/sales_duplicate.orcThis command deletes the sales_duplicate.orc key. |
Viewing key information
Command Syntax |
ozone sh bucket info /<volumename>/<bucketname>/<keyname> |
Purpose | Provides information about the specified key. |
Arguments | The name of the key whose details you want to view. |
Example | ozone sh bucket info /hive/jun/sales_jun.orcThis command provides information about the sales_jun.orc key. |
Listing keys
Command Syntax |
ozone sh key list /<bucketname> --length=<number_of_keys> --prefix=<key_prefix> --start=<starting_key> |
Purpose | Lists the keys in a specified bucket. |
Arguments |
|
Example | ozone sh key list /hive/jun/This command lists all the keys in the volume /hive/jun. |