[openstack-dev] [TripleO][Tuskar] REST API spec for Juno questions

Petr Blaho pblaho at redhat.com
Wed Jul 23 17:04:55 UTC 2014


Hi all,

I am working on API endpoints for Tuskar according to
https://github.com/openstack/tripleo-specs/blob/master/specs/juno/tripleo-juno-tuskar-rest-api.rst
and I found some inconsistencies.

On following lines I will present what I think are mistakes or I do not understand
well. Please, correct me if I am wrong. Then I am ok to write patch
for that spec.

1) UUID vs. id.
I can see usage of UUIDs in urls
(https://github.com/openstack/tripleo-specs/blame/master/specs/juno/tripleo-juno-tuskar-rest-api.rst#L107)
and UUID is referenced in condition for 404 HTTP status
(https://github.com/openstack/tripleo-specs/blame/master/specs/juno/tripleo-juno-tuskar-rest-api.rst#L125).
On the other hand we have id in returned json for plan
(https://github.com/openstack/tripleo-specs/blame/master/specs/juno/tripleo-juno-tuskar-rest-api.rst#L148).
The same applies for roles and its UUIDs or ids.
The problem I am pointing at is not in format of value but in its name.
I am convinced that these should be consistent and we should use UUIDs.

2) Request Data when adding role to plan.
According to
https://github.com/openstack/tripleo-specs/blame/master/specs/juno/tripleo-juno-tuskar-rest-api.rst#L376
there should be name and version of the role but json example has only
id value
(https://github.com/openstack/tripleo-specs/blame/master/specs/juno/tripleo-juno-tuskar-rest-api.rst#L382-L384).
I understand that that json code is just an example but I was confused
by differences between words describing data and example.
I can see from json representation of roles list
(https://github.com/openstack/tripleo-specs/blame/master/specs/juno/tripleo-juno-tuskar-rest-api.rst#L508-L527)
that role can be identified both by UUID/id and combination of
name+version.
>From spec for DELETE role from plan 
(https://github.com/openstack/tripleo-specs/blame/master/specs/juno/tripleo-juno-tuskar-rest-api.rst#L405)
I can tell that we probably will be using name+version identifier to
know which role I want to add to plan so example mentioned above is just
missing name and version attributes.
Am I correct with this?

3) /v2/clouds in href for plan
This is probably remnant from previous versions of spec. We have
/v2/clouds where we probably should have /v2/plans
(https://github.com/openstack/tripleo-specs/blame/master/specs/juno/tripleo-juno-tuskar-rest-api.rst#L182).

4) Links to roles from plan json
We have a link for each role in plan that points to url like
/v2/roles/:role_uuid
(https://github.com/openstack/tripleo-specs/blame/master/specs/juno/tripleo-juno-tuskar-rest-api.rst#L158).
But we do not have an API endpoint returning single role.
We should either remove these links to single role or add GET
/v2/roles/:role_uuid endpoint and add this kind of links to list of
roles too.

I proposed solutions to points 1, 2 and 3 in
https://review.openstack.org/#/c/109040/.

Thanks for reading this.
I am looking for your input.
-- 
Petr Blaho, pblaho at redhat.com
Software Engineer



More information about the OpenStack-dev mailing list