Bug 1976175

Summary: [RFE] [dashborad] : CLI : Commands to return in requested format not just in json or plain
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Vasishta <vashastr>
Component: Ceph-DashboardAssignee: Pere Diaz Bou <pdiazbou>
Status: ASSIGNED --- QA Contact: Preethi <pnataraj>
Severity: medium Docs Contact:
Priority: low    
Version: 5.0CC: ceph-eng-bugs, nia, pegonzal, sangadi, saraut
Target Milestone: ---Keywords: FutureFeature
Target Release: 7.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vasishta 2021-06-25 12:12:49 UTC
Description of problem:
Ceph dashboard cli commands returns in same format even though requested for different format using '-f' argument.
It would be nice if we can provide an option to check information in user required format 
Example json-pretty

Version-Release number of selected component (if applicable):
16.2.0-81.el8cp

How reproducible:
Always

Steps to Reproduce:
1. Configure a RHCS cluster
2.
3.

Actual results:
[root@e16-h18-b01-fc640 /]# ceph dashboard ac-user-show admin123 -f json-pretty

{"username": "admin123", "password": "$2b$12$L7NX2D9sBxhY.tgZk0Y0a.7py3jIhVPf6TY/6Fq8JkHMxH.beEjQ.", "roles": ["administrator"], "name": null, "email": null, "lastUpdate": 1624621239, "enabled": true, "pwdExpirationDate": null, "pwdUpdateRequired": false}
[root@e16-h18-b01-fc640 /]# ceph dashboard ac-user-show admin123 -f xml        
{"username": "admin123", "password": "$2b$12$L7NX2D9sBxhY.tgZk0Y0a.7py3jIhVPf6TY/6Fq8JkHMxH.beEjQ.", "roles": ["administrator"], "name": null, "email": null, "lastUpdate": 1624621239, "enabled": true, "pwdExpirationDate": null, "pwdUpdateRequired": false}

Expected results:
Try to retrieve information in json-pretty format from ceph dashboard commands

Additional info: