jyotirmoy-gh opened a new pull request, #4508:
URL: https://github.com/apache/ozone/pull/4508
## What changes were proposed in this pull request?
Json formatting option added for `ozone admin datanode list` command
```
bash-4.2$ ozone admin datanode list --help
Usage: ozone admin datanode list [-hV] [--json] [-id=<scmServiceId>]
[--id=<uuid>] [--ip=<ipaddress>]
[--node-state=<nodeState>]
[--operational-state=<nodeOperationalState>]
[--scm=<scm>]
List info of datanodes
-h, --help Show this help message and exit.
-id, --service-id=<scmServiceId>
ServiceId of SCM HA Cluster
--id=<uuid> Show info by datanode UUID.
--ip=<ipaddress> Show info by ip address.
--json Show info in json format
--node-state=<nodeState>
Show info by datanode NodeState( HEALTHY, STALE,
DEAD)
--operational-state=<nodeOperationalState>
Show info by datanode
NodeOperationalState(IN_SERVICE,
DECOMMISSIONING, DECOMMISSIONED,
ENTERING_MAINTENANCE, IN_MAINTENANCE).
--scm=<scm> The destination scm (host:port)
-V, --version Print version information and exit.
```
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-8185
## How was this patch tested?
Tested using apache docker build -
```
bash-4.2$ ozone admin datanode list --json | more
[ {
"datanodeDetails" : {
"level" : 0,
"cost" : 0,
"uuid" : "a288046d-c3fb-41b7-b25d-00e3da71fcc6",
"uuidString" : "a288046d-c3fb-41b7-b25d-00e3da71fcc6",
"ipAddress" : "172.18.0.4",
"hostName" : "ozone_datanode_1.ozone_default",
"ports" : [ {
"name" : "REPLICATION",
"value" : 9886
}, {
"name" : "RATIS",
"value" : 9858
}, {
"name" : "RATIS_ADMIN",
"value" : 9857
}, {
"name" : "RATIS_SERVER",
"value" : 9856
}, {
"name" : "RATIS_DATASTREAM",
"value" : 9855
}, {
"name" : "STANDALONE",
"value" : 9859
} ],
"setupTime" : 0,
"persistedOpState" : "IN_SERVICE",
"persistedOpStateExpiryEpochSec" : 0,
"initialVersion" : 0,
"currentVersion" : 1,
"signature" : -413780670,
"decomissioned" : false,
"networkLocation" : "/default-rack",
"networkName" : "a288046d-c3fb-41b7-b25d-00e3da71fcc6",
"networkFullPath" : "/default-rack/a288046d-c3fb-41b7-b25d-00e3da71fcc6",
"numOfLeaves" : 1
},
"healthState" : "HEALTHY",
"opState" : "IN_SERVICE"
}, {
"datanodeDetails" : {
"level" : 0,
"cost" : 0,
"uuid" : "ea12974c-febe-4bc1-a091-ffa6a2290adc",
"uuidString" : "ea12974c-febe-4bc1-a091-ffa6a2290adc",
"ipAddress" : "172.18.0.7",
"hostName" : "ozone_datanode_4.ozone_default",
"ports" : [ {
"name" : "REPLICATION",
"value" : 9886
}, {
--More--
```
--
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]