Assembly creation with plan uuid

Bug #1401272 reported by Melissa Kam on 2014-12-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Solum
Low
Unassigned

Bug Description

Assemblies currently can only be created with a plan uri and not a plan uuid. The plan uuid is taken from the plan uri to look up the plan anyway (https://github.com/stackforge/solum/blob/master/solum/api/controllers/v1/assembly.py#L89) so if given a uuid, it should follow this same logic.

Ed Cranford (ed--cranford) wrote :

The logic in assembly-create doesn't actually parse the contents of the resource identified by the plan URI. Instead, the URI is checked nominally for a matching host protocol and URL, and then the last field between slashes is parsed as the UUID.

Following the intent of the code, it seems requiring the whole URI is overkill, and we should consider just asking for the name-or-uuid of the plan if plans must live locally.

Alternatively, we should consider removing the same-host check, both because the method is flawed and because it's at odds with the U part of a URI. In that case, it seems the document at that URI (a planfile in some form) needs to be parsed into a plan so the assembly can use this new plan. If that is so, the creation of an assembly can be done in a single API call instead of requiring a plan get registered separately.

I don't know which of the two ways is better, though the former may be simpler from both an implementation and a user perspective.

Gilbert Pilz (gilbert.pilz) wrote :

The last paragraph of Section 6.11.1 of CAMP 1.1 (http://docs.oasis-open.org/camp/camp-spec/v1.1/cs01/camp-spec-v1.1-cs01.pdf) has some information about this.

I think the all-singing, all-dancing version of Solum could do the following:

1.) Accept '{plan_uuid: ...}' on a POST to the assemblies resource. The value of 'plan_uuid' should be the UUID of an existing plan resource on this instance of Solum. Process appropriately.

2.) If the client POSTs '{plan_uri: ...}' try to figure out if the URI references a local plan resource. If it does, proceed using the same logic as (1).

3.) If the client POSTs '{plan_uri: ...}' and it doesn't appear that the URI references a local plan resource, do a GET on that URI with an Accept header that indicates we would prefer YAML (plan file) but will accept JSON (plan resource). Process the response according to its Content-Type.

Adrian Otto (aotto) on 2015-06-12
Changed in solum:
status: New → Triaged
importance: Undecided → Low
milestone: none → 2015.1.1
tags: added: solum-api

Solum has moved away from plans and assemblies. So marking this as 'Won't Fix'.

Changed in solum:
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers