On Thu, Jun 02, 2011 at 05:20:32PM +0100, 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
Hmm... Are we in fact having a UI for launching an instance, or is it
just "paste in the URL of the image you want to launch"?
We don't have any UX for the list of images to choose from, yet...
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
(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
Glad to see this coming along!
--H
--
== Hugh Brock, hbrock(a)redhat.com ==
== Engineering Manager, Cloud BU ==
== Aeolus Project: Manage virtual infrastructure across clouds. ==
==
http://aeolusproject.org ==
"I know that you believe you understand what you think I said, but I’m
not sure you realize that what you heard is not what I meant."
--Robert McCloskey