Bug 1268954

Summary: oc describe output to allow different formats
Product: OpenShift Container Platform Reporter: Peter Ruan <pruan>
Component: ocAssignee: Fabiano Franz <ffranz>
Status: CLOSED WONTFIX QA Contact: Wei Sun <wsun>
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: abhgupta, akostadi, aos-bugs, jokerman, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-04 20:15:57 UTC 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 Peter Ruan 2015-10-05 17:47:33 UTC
Description of problem:
It would be useful to allow 'oc describe' to have output in different formats (JSON/YAML) to allow for better parsing using libraries.  This is not a bug, but rather a request for feature.

Version-Release number of selected component (if applicable):

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Fabiano Franz 2016-07-04 20:15:57 UTC
`oc describe` is meant to be screen-reading-friendly for end users, not supposed to be used for scripting or anything similar mostly because every describer likely is composed by several API calls to display its data, and displaying it in any format other than tabular data would introduce a new data model that doesn't map to actual API resources, and we don't want to do that.

`oc get` on the other hand provides options to output json|yaml because it maps directly to the format of resource the way they are stored behind the Rest API. You should be able to fetch every information displayed in describe by doing similar API calls describe does. --loglevel=10 in a describe call can help in discovering what API calls composes a given describer.