Ozone shell supports the following key commands.
The key get command downloads a key from Ozone cluster to local file system.
Params:
| Arguments | Comment |
|---|---|
| Uri | The name of the key in /volume/bucket/key format. |
| FileName | Local file to download the key to. |
ozone sh key get /hive/jan/sales.orc sales.orcUploads a file from the local file system to the specified bucket.
Params:
| Arguments | Comment |
|---|---|
| Uri | The name of the key in /volume/bucket/key format. |
| FileName | Local file to upload. |
| -r, –replication | Optional, Number of copies, ONE or THREE are the options. Picks up the default from cluster configuration. |
ozone sh key put /hive/jan/corrected-sales.orc sales.orcThe delete key command removes the key from the bucket.
Params:
| Arguments | Comment |
|---|---|
| Uri | The name of the key. |
ozone sh key delete /hive/jan/corrected-sales.orcThe above command deletes the key /hive/jan/corrected-sales.orc.
The key info commands returns the information about the key. Params:
| Arguments | Comment |
|---|---|
| Uri | The name of the key. |
ozone sh key info /hive/jan/sales.orcThe above command will print out the information about /hive/jan/sales.orc key.
The key list commands allows user to list all keys in a bucket.
Params:
| Arguments | Comment |
|---|---|
| -l, –length | Maximum number of results to return. Default: 1000 |
| -p, –prefix | Optional, Only buckets that match this prefix will be returned. |
| -s, –start | The listing will start from key after the start key. |
| Uri | The name of the volume. |
ozone sh key list /hive/janThis command will list all key in the bucket /hive/jan.
You can try out these commands from the docker instance of the Alpha Cluster.