It's all about the answers!

Ask a question

Are the JSON models available anywhere for the scm --json output?


Eric Benzacar (41512) | asked Dec 15 '15, 11:00 a.m.
edited Dec 16 '15, 11:24 a.m.
 I'm looking to update some tools that use the scm CLI and currently parse the output text (ex: scm status --wide).  I would like to switch to reading the JSON output.  (ex: scm status --json)

Is there any documentation anywhere that explains/details the scm status --json output?  I can't seem to find the data structure for the JSON output.  Additionally, is the JSON output the same in all RTC versions (ie: v4, v5, v6) or have the data structures changed?

I did find this link on the Jazz dev wiki site : JSON-Schema-StatusCmd, but it is dated 2011 and I don't know if it is still accurate or not.

For example ( a snippet from the output of an scm status):
                  ... 
                  ... 
                   "incoming-changes": [
                    ],
                    "name": "LAB-TestCode",
                    "outgoing-baselines": [
                        {
                            "changes": [
                            ],
                            "id": 10194,
                            "name": "baseline_10000",
                            "uuid": "_JRY-Ipo_EeWcEvakMUpezg"
                        }
                    ],
                    "outgoing-changes": [
                    ],
                    "suspended": [
                    ],
                    "type": "",
                    "uuid": "_LCAj8fcTEeOYD4O3cD_ZUQ"
 
I have no idea what to expect in any of the empty arrays.  What data should I be expecting?  What should be in "type"?  Etc.  

Having the basic JSON schema available would seem to be the most basic documentation for something like this.  Or short of that, indicate which rtc classes are responsible for generating the JSON - perhaps I can look at the actual model from within the RTC jars and extract the required information from there.

One answer



permanent link
Shashikant Padur (4.2k27) | answered Dec 15 '15, 10:28 p.m.
JAZZ DEVELOPER
Eric,
Each command's json output has a different structure based on the command output. Unfortunately there is no documentation related to each command's json structure. If you understand the text output then it shouldn't be difficult to figure out the json output.
The json output is the same across versions although new key-value pairs may be added which shouldn't break existing scripts.

Regards,
Shashi

Comments
Eric Benzacar commented Dec 16 '15, 11:23 a.m.

 Thanks Shashi, but my problem is that my text output sometimes shows empty key-value pairs and I have no idea what to expect.  I have updated my question with additional information.



Shashikant Padur commented Dec 16 '15, 10:33 p.m.
JAZZ DEVELOPER

Found this workitem requesting the same: https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.workitem.viewWorkItem&id=192823

Please add your comments to this workitem.

Your answer


Register or to post your answer.