On 2.0, api 1.0 version returns null

Bug #1557451 reported by Michael Foord on 2016-03-15
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
High
Jeffrey C Jones

Bug Description

Juju will support MAAS 1.9 and 2.0, so we need to know the version of MAAS in use. However, in order to ask the MAAS API which version it is we already need to know the version...

On 2.0 /api/1.0/version returns null.

Ideally there would be a version independent endpoint we can call to get the MAAS version, so we don't have to make two calls.

Related branches

Michael Foord (mfoord) wrote :

Also, on a 2.0 server 1.0 calls should probably error rather than returning null.

Andres Rodriguez (andreserl) wrote :

If the API is 2.0 then you are using MAAS 2.X series. If the API is 1.0, then you are using 1.x series. There won't be the case where you will need to check 2.X for the version. You just need to check for 2.0.

Changed in maas:
milestone: none → 2.0.0
importance: Undecided → High
summary: - No version independent version endpoint
+ On 2.0, api 1.0 version returns null
Changed in maas:
importance: High → Medium
status: New → Triaged
Michael Foord (mfoord) wrote :

Yes I know if the api is 2.0 then we are using MAAS 2.0. What we want to know is should we use API or 2.0.

We have a MAAS URL from the user config (*without* API version) and *we* need to decide which API version to use, which means we need to know which version of MAAS we have. And there is no way to find out without knowing which API version to use - chicken and egg.

Andres Rodriguez (andreserl) wrote :

I don't think it is required for Juju to have a version endpoint exposing the API version. Why?

juju is told that MAAS is in http://<ip-maas>/MAAS and then juju automatically assumes you are using /MAAS/api/1.0 . However, since juju is being told /MAAS , then Juju could check /MAAS/api/1.0 , if that returns null or non existant, then it could assume it is using /MAAS/api/2.0 .

That being said, users should still be able to input http://ip-of-maas/MAAS/api/1.0 (or 2.0) and it should just work.

Changed in maas:
importance: Medium → High
Changed in maas:
assignee: nobody → Jeffrey C Jones (trapnine)
status: Triaged → In Progress
Changed in maas:
status: In Progress → Fix Committed
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers