bucket list
Usage
$ ozone sh bucket list [-hV] [--has-snapshot]
[-p=<prefix>]
[-s=<startItem>]
[[-l=<limit>] | [-a]]
<value>
NOTE
In this command, list can be shortened to just ls .
|
Parameter | Description |
---|---|
value |
A volume URI. 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 |
--has-snapshot |
If specified, the command will display only those buckets that have at least one active snapshot |
-h, --help |
Prints out a help manual for this command |
-V, --version |
Prints out version information and exits |
Examples
Consider a volume vol1
with two buckets (bucket1
and bucket2
) created within. To list information about all the buckets, call the following command
$ ozone sh bucket list vol1
The output depends on bucket configuration, but overall should be similar to the following:
[ {
"metadata" : { },
"volumeName" : "vol1",
"name" : "bucket1",
"storageType" : "DISK",
"versioning" : false,
"usedBytes" : 0,
"usedNamespace" : 0,
"creationTime" : "2025-01-22T22:06:04.800Z",
"modificationTime" : "2025-01-22T22:06:55.834Z",
"sourcePathExist" : true,
"quotaInBytes" : -1,
"quotaInNamespace" : -1,
"bucketLayout" : "FILE_SYSTEM_OPTIMIZED",
"owner" : "s_tikhomirov_krb1",
"replicationConfig" : {
"replicationFactor" : "ONE",
"requiredNodes" : 1,
"replicationType" : "RATIS"
},
"link" : false
}, {
"metadata" : { },
"volumeName" : "vol1",
"name" : "bucket2",
"storageType" : "DISK",
"versioning" : false,
"usedBytes" : 0,
"usedNamespace" : 0,
"creationTime" : "2025-01-22T22:07:32.541Z",
"modificationTime" : "2025-01-22T22:07:32.541Z",
"sourcePathExist" : true,
"quotaInBytes" : -1,
"quotaInNamespace" : -1,
"bucketLayout" : "FILE_SYSTEM_OPTIMIZED",
"owner" : "s_tikhomirov_krb1",
"link" : false
} ]
Now, consider that a new bucket newbucket
was added to vol1
. To find it among the numerous other buckets using the list
command, you can utilize the prefix search:
$ ozone sh bucket list vol1 -p="new"
The output would be:
[ {
"metadata" : { },
"volumeName" : "vol1",
"name" : "newbucket",
"storageType" : "DISK",
"versioning" : false,
"usedBytes" : 0,
"usedNamespace" : 0,
"creationTime" : "2025-02-12T22:51:39.876Z",
"modificationTime" : "2025-02-12T22:51:39.876Z",
"sourcePathExist" : true,
"quotaInBytes" : -1,
"quotaInNamespace" : -1,
"bucketLayout" : "FILE_SYSTEM_OPTIMIZED",
"owner" : "s_tikhomirov_krb1",
"link" : false
} ]