SaketaChalamchala opened a new pull request, #4157:
URL: https://github.com/apache/ozone/pull/4157

   ## What changes were proposed in this pull request?
   
   Extended the usage of `ozone sh bucket list`. Added an additional option in 
Bucket List Handler to filter out encrypted buckets similar to `hdfs crypto 
-listZones`
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-7747
   
   ## How was this patch tested?
   
   Manual test
   ```
   sh-4.2$ ozone sh bucket list --help
   Usage: ozone sh bucket list [-ehV] [-l=<limit>] [-p=<prefix>] 
[-s=<startItem>]
                               <value>
   lists the buckets in a volume.
         <value>               URI of the volume.
                               Ozone URI could either be a full URI or short 
URI.
                               Full URI should start with o3://, in case of 
non-HA
                               clusters it should be followed by the host name 
and
                               optionally the port number. In case of HA 
clusters
                               the service id should be used. Service id 
provides a
                               logical name for multiple hosts and it is defined
                               in the property ozone.om.service.ids.
                               Example of a full URI with host name and port 
number
                               for a key:
                               o3://omhostname:9862/vol1/bucket1/key1
                               With a service id for a volume:
                               o3://omserviceid/vol1/
                               Short URI should start from the volume.
                               Example of a short URI for a bucket:
                               vol1/bucket1
                               Any unspecified information will be identified 
from
                               the config files.
   
     -e, --encrypted           List all buckets with encryption enabled.
     -h, --help                Show this help message and exit.
     -l, --length=<limit>      Maximum number of items to list
                                 Default: 100
     -p, --prefix=<prefix>     Prefix to filter the items
     -s, --start=<startItem>   The item to start the listing from.
                               This will be excluded from the result.
     -V, --version             Print version information and exit.
   sh-4.2$ ozone sh bucket list /vol1 
   [ {
     "metadata" : { },
     "volumeName" : "vol1",
     "name" : "bucket1",
     "storageType" : "DISK",
     "versioning" : false,
     "usedBytes" : 30720,
     "usedNamespace" : 1,
     "creationTime" : "2023-01-07T22:30:16.295Z",
     "modificationTime" : "2023-01-07T22:30:16.295Z",
     "quotaInBytes" : -1,
     "quotaInNamespace" : -1,
     "bucketLayout" : "LEGACY",
     "owner" : "testuser",
     "link" : false
   }, {
     "metadata" : { },
     "volumeName" : "vol1",
     "name" : "encbucket1",
     "storageType" : "DISK",
     "versioning" : false,
     "usedBytes" : 0,
     "usedNamespace" : 0,
     "creationTime" : "2023-01-07T22:40:42.437Z",
     "modificationTime" : "2023-01-07T22:40:42.437Z",
     "encryptionKeyName" : "key1",
     "quotaInBytes" : -1,
     "quotaInNamespace" : -1,
     "bucketLayout" : "LEGACY",
     "owner" : "testuser",
     "link" : false
   } ]
   sh-4.2$ ozone sh bucket list /vol1 -e
   [ {
     "metadata" : { },
     "volumeName" : "vol1",
     "name" : "encbucket1",
     "storageType" : "DISK",
     "versioning" : false,
     "usedBytes" : 0,
     "usedNamespace" : 0,
     "creationTime" : "2023-01-07T22:40:42.437Z",
     "modificationTime" : "2023-01-07T22:40:42.437Z",
     "encryptionKeyName" : "key1",
     "quotaInBytes" : -1,
     "quotaInNamespace" : -1,
     "bucketLayout" : "LEGACY",
     "owner" : "testuser",
     "link" : false
   } ]
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to