On 06/02/2011 06:20 PM, Mark McLoughlin wrote:
Hi Tomas,
This looks great. I just talked through on IRC what Conductor needs, so
I thought I'd re-post here:
1) in the UI for launching an instance (i.e. no deployable involved),
we need to have a list of images for the user to choose from
that does sound like an ActiveRecord thing that queries iwhd
and the query is very simple (ignoring environments for now) e.g.
$> curl
http://localhost:9090/images
or, if you want to be pedantic
$> curl -d '$object_type == "image"'
http://localhost:9090/images/_query
that gives you a list of UUIDs, then you want to query each image
to get the image XML that will contain a name and description for
the image so e.g.
$> curl
http://localhost:9090/images/$uuid
2) when we launch an instance or deployable, we have an image UUID and
we need to resolve that to a list of provider images condormatic is
the one that is doing this in order to do the matching and decide
which provider is going to be used so, there are a number of
queries needed to do this
a) find the latest build associated with the image
$> curl
http://localhost:9090/images/$uuid/latest_build
b) find all the target images associated with the build
$> curl -d '$object_type == "target_image"&& $build ==
"${build_uuid}"'
http://localhost:9090/target_images/
c) find all the provider images associated with each target image
$> curl -d '$object_type == "provider_image"&&
$target_image == "${target_image_uuid}"'
http://localhost:9090/provider_images/
And that's it, I think.
It looks like you're just missing:
i) a way to do complex queries like the one above. This would probably
be a query() method in warehouse_client.rb and each model would
perhaps have a where() method that would take a query string
ok I am going to
implement it right now.
(If we wanted to go further with the ActiveRecord-like
modelling,
we might have something like ':has_many target_images' on the build
model and automatically construct the appropriate query ... but I
think that's probably overkill for now)
ii) some useful iwhd test data for your rspec tests. I'm happy to
help
you out with this, if you like
I would appreciate help
Cheers,
Mark.
_______________________________________________
aeolus-devel mailing list
aeolus-devel(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/aeolus-devel