On Wed, 2010-05-05 at 17:17 -0700, David Lutterkort wrote:
>       * returning the representation of a new instance from a
>         POST /api/instances: again, in some drivers, like Terremark,
>         that requires making two calls to the backend cloud, which is
>         too fragile for this operation. Instead, the result from
>         POST /api/instances should contain the URL of the new instance
>         in a Location: header, and optionally the instance
>         representation for drivers where that is cheap to do.


In many cases, might it be possible to "fake" a minimal representation
of the new resource, from the Deltacloud driver's presumed knowledge of
the backend cloud's URI structure?

For example if cloud-specific VM URI looked like /vms/XXX, then in the
least case the driver could fabricate a representation like this:

  <vm href="/vms/XXX">
    <id>XXXX</id>
  <vm>

The point being that the id may be all that a lot of clients need to
know initially about the returned representation. Having the id
available would allow the client to populate their internal data
structures, and/or produce a basic rendering of the newly created
instance. If the user subsequently wanted to drill down into any more
detail, that would require a dereference on the href, which is fine if
needed, but it may not be so in a lot of cases. At least not straight
away after the creation. 

Yeah I know this is on dangerous ground, as making assumptions about URI
structure is universally thought of as badness. But I guess one could
view a Deltacloud driver as not being a normal client but rather a
super-knowledgeable facade over the underlying API.

Cheers,
Eoghan

_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to