key list
Usage
$ ozone sh key list [-hV] [-p=<prefix>]
[-s=<startItem>]
[[-l=<limit>] | [-a]]
<value>
NOTE
In this command, list can be shortened to just ls .
|
Parameter | Description |
---|---|
value |
URI of a volume or bucket. It can be a full URI (starts with |
prefix |
A name prefix to filter the items |
startItem |
The item to start listing from. The chosen item will not appear in the results |
limit |
Maximum number of the results to list. The default value is |
-a, --all |
If specified, the command will display all the results. By default, it is specified. To counter it, use the |
-h, --help |
Prints out a help manual for this command |
-V, --version |
Prints out version information and exits |
Examples
Consider a volume vol1
with a bucket bucket1
created within. That bucket has two keys: key1
and key2
. To list information about all the keys, call the following command
$ ozone sh key list vol1/bucket1
The output depends on key configuration, but overall should be similar to the following:
[ {
"volumeName" : "vol1",
"bucketName" : "bucket1",
"name" : "key1",
"dataSize" : 14,
"creationTime" : "2025-02-23T21:14:28.098Z",
"modificationTime" : "2025-02-23T21:17:20.170Z",
"replicationConfig" : {
"replicationFactor" : "ONE",
"requiredNodes" : 1,
"replicationType" : "RATIS"
},
"metadata" : { },
"file" : true
}, {
"volumeName" : "vol1",
"bucketName" : "bucket1",
"name" : "key2",
"dataSize" : 14,
"creationTime" : "2025-02-23T22:16:35.235Z",
"modificationTime" : "2025-02-23T22:16:36.399Z",
"replicationConfig" : {
"replicationFactor" : "ONE",
"requiredNodes" : 1,
"replicationType" : "RATIS"
},
"metadata" : { },
"file" : true
} ]
Now, consider that a new key newkey
was added to the bucket. To find it among the numerous keys using the list
command, you can utilize the prefix search:
$ ozone sh key list vol1/bucket1 -p="new"
The output would be:
[ {
"volumeName" : "vol1",
"bucketName" : "bucket1",
"name" : "newkey",
"dataSize" : 14,
"creationTime" : "2025-02-23T22:38:35.625Z",
"modificationTime" : "2025-02-23T22:38:36.695Z",
"replicationConfig" : {
"replicationFactor" : "ONE",
"requiredNodes" : 1,
"replicationType" : "RATIS"
},
"metadata" : { },
"file" : true
} ]