Inconsistent naming of status output between different APIs

Bug #1930184 reported by Jose Guedez
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
High
Unassigned

Bug Description

I filed a bug for libjuju [0] about differences in the output structure of Model.get_status compared with `juju status --format=yaml`

I was advised to open a bug here as well, since the issue apparently is related to inconsistencies between different APIs [1]

This is the summary of the differences as I posted in the related libjuju bug:

+---------------------+--------------------------+----------------------+
| instance | jsfy | libjuju |
+---------------------+--------------------------+----------------------+
| machine/container | machine-status | instance-status |
| unit/subordinate | workload-status | workload-status |
| application | application-status | status |
| juju status msg | workload-status.message | workload-status.info |
| juju agent details | (unit).juju-status | (unit).agent-status |
+---------------------+--------------------------+----------------------+

example outputs

jsfy - https://pastebin.ubuntu.com/p/VZp6zjh7sw/
libjuju - https://pastebin.ubuntu.com/p/b7SjYK9WKX/

[0] https://github.com/juju/python-libjuju/issues/500
[1] https://github.com/juju/python-libjuju/issues/500#issuecomment-850222588

Jose Guedez (jfguedez)
description: updated
Revision history for this message
Ian Booth (wallyworld) wrote :

We'll need to figure out the best approach here since there's a compatibility issue changing field names. At first glance, Juju seems at "fault" here as it takes the raw feed from the API and renames the fields. At least that's the case for the one I looked at "instance-status" becomes "machine-status". Juju would have renamed the output to conform with modelling decisions and it did so on the client side to preserve api compatibility. I think my preference would be to change libjuju to match juju. libjuju could get the renamed fields added as new fields and then remove the old ones in juju 3.0. On that basis this but would be a "Won't Fix" for juju but will leave open till we agree on the approach.

Revision history for this message
Ian Booth (wallyworld) wrote :

If we agree that juju's output is what we want, we could introduce a StatusV2 api which returns what's needed without the juju cli needing to transform the field names. Then libjuju would need to be updated to use the new api and we'd get consistency.

Changed in juju:
milestone: none → 2.9.7
importance: Undecided → High
status: New → Triaged
Revision history for this message
Pen Gale (pengale) wrote :

Moved to 3.0.0. This involves major breaking changes, and should wait for a major release.

Changed in juju:
milestone: 2.9.7 → 2.9-next
milestone: 2.9-next → 3.0.0
Changed in juju:
milestone: 3.0.0 → 3.0.1
Changed in juju:
milestone: 3.0.1 → 3.0.2
Changed in juju:
milestone: 3.0.2 → 3.0.3
Changed in juju:
milestone: 3.0.3 → 3.0.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.