How to get OS releases from REST API (like WS general.osinfo)

All,

I’m trying to enumerate the list of OS releases available to pass to a deployment but I’ve not found a way to get all the information back from the REST API that I get in the general.osinfo websocket method that the UI uses.

The pseudo-code for getting all available os releases I believe goes something like this:
for source in GET /MAAS/api/2.0/boot-sources/
for selection in GET /MAAS/api/2.0/boot-sources/{source.id}
releases += {name=??, release="{selection.os}/{selection.release}"

The part I’m missing here is the friendly name that I see in the UI which I believe comes from the OSRegistry seen here: https://git.launchpad.net/maas/tree/src/maasserver/utils/osystems.py#n36

Right now I’m reliant on calling general.osinfo on the websocket which is less than friendly from python.

If I can get the equivalent info from the REST API that would be great, can it be done, or is this a feature request?

Not sure if you still need this, for custom OS images the “friendly name” is shown as “title” from the REST API “GET http://{{MAAS_URL}}:5240/MAAS/api/2.0/boot-resources/”

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.