Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

 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.

0 votes



One answer

Permanent link
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

0 votes

Comments

 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.


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 log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927
× 1,201
× 87
× 11

Question asked: Dec 15 '15, 11:00 a.m.

Question was seen: 3,738 times

Last updated: Dec 16 '15, 10:33 p.m.

Confirmation Cancel Confirm