Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-19 Thread Ori Liel
In the interest of moving forward, let's agree that, since there seems to be an overwhelming majority for option 1 (see below), then if by the start of next week (i.e Monday, April 23) no one will object to option 1, I will start the implementation. Thanks, Ori. >Current summary: > >There

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-19 Thread Ori Liel
Current summary: There are four options for Floating-Disks modelling: two that were previously discussed, and two that were recently added by Livnat, using PUT. See full list of options below. Itamar, Geert, Einav & Ori are currently pro option #1 (if anyone changed his mind - please say so)

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-18 Thread Itamar Heim
h, like delete is "in the same direction" of removing something. preserve implies this is in the other direction from the delete. hope this makes sense - Original Message - From: "Ori Liel" To: engine-devel@ovirt.org Cc: "Eoghan Glynn" Sent: Monday

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-18 Thread Ori Liel
Another possibility of using PUT is on the root collection of disks, PUT .../api/disks Updating the vm-ids of this disk. But I don't like this solution as well (opinions?) If you had in mind a different way of using PUT, please explain it. >> Comments? >> >> >&g

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-18 Thread Livnat Peer
- Original Message - >> From: "Ori Liel" >> To: engine-devel@ovirt.org >> Cc: "Eoghan Glynn" >> Sent: Monday, April 16, 2012 3:33:27 PM >> Subject: Re: [Engine-devel] Floating Disks implementation in REST-API >> >> I'd like us to m

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-18 Thread Livnat Peer
On 17/04/12 19:31, Geert Jansen wrote: > > On 04/17/2012 05:54 PM, Itamar Heim wrote: > >>> If we can expose the "shared" flag though, i think the API gets more >>> natural. We can then only show the shared disks in the root context. >>> >>> Itamar, can we expose this flag, or do you consider thi

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-18 Thread Einav Cohen
symmetrical, adding a new POST action is avoided). Comments? - Original Message - > From: "Ori Liel" > To: engine-devel@ovirt.org > Cc: "Eoghan Glynn" > Sent: Monday, April 16, 2012 3:33:27 PM > Subject: Re: [Engine-devel] Floating Disks implementation

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-17 Thread Geert Jansen
On 04/17/2012 05:54 PM, Itamar Heim wrote: If we can expose the "shared" flag though, i think the API gets more natural. We can then only show the shared disks in the root context. Itamar, can we expose this flag, or do you consider this flag is internal to the BE? we have to expose this fla

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-17 Thread Itamar Heim
On 04/17/2012 05:56 PM, Geert Jansen wrote: On 04/17/2012 04:53 PM, Ori Liel wrote: iirc, shared disk is a flag on the disk to allow it to be shared. doesn't mean it is shared yet, rather can be shared. Right, but there's no contradiction: a disk can have 'shared' flag and also show the list

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-17 Thread Geert Jansen
On 04/17/2012 04:53 PM, Ori Liel wrote: iirc, shared disk is a flag on the disk to allow it to be shared. doesn't mean it is shared yet, rather can be shared. Right, but there's no contradiction: a disk can have 'shared' flag and also show the list of VMs it's attached to. The flag tells you

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-17 Thread Ori Liel
>On 04/17/2012 05:26 PM, Ori Liel wrote: >>> > Floating disks should be both in the root context, and also in the VM > context for each VM the floating disk is attached to, right? So floating > disks would appear 1+N_attach times in the API, once in the root > context, and once for

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-17 Thread Itamar Heim
On 04/17/2012 05:26 PM, Ori Liel wrote: Floating disks should be both in the root context, and also in the VM context for each VM the floating disk is attached to, right? So floating disks would appear 1+N_attach times in the API, once in the root context, and once for each VM they are attached

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-17 Thread Ori Liel
> >>> Floating disks should be both in the root context, and also in the VM >>> context for each VM the floating disk is attached to, right? So floating >>> disks would appear 1+N_attach times in the API, once in the root >>> context, and once for each VM they are attached to. >>> >> >> IIUC a floa

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-17 Thread Geert Jansen
Floating disks should be both in the root context, and also in the VM context for each VM the floating disk is attached to, right? So floating disks would appear 1+N_attach times in the API, once in the root context, and once for each VM they are attached to. IIUC a floating disk is not assoc

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-17 Thread Ori Liel
> >On 04/17/2012 02:27 PM, Ori Liel wrote: > >>> My idea for that was to introducetrue|false as well. >>> Without force=true, we won't delete a disk if it's currently floating. >>> >> >> If the disk is floating it will only appear in root collection >> (...api/disks), and DELETE from >> there is

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-17 Thread Geert Jansen
On 04/17/2012 02:27 PM, Ori Liel wrote: My idea for that was to introducetrue|false as well. Without force=true, we won't delete a disk if it's currently floating. If the disk is floating it will only appear in root collection (...api/disks), and DELETE from there is non-ambiguous, as ther

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-17 Thread Ori Liel
> > >On 04/16/2012 02:33 PM, Ori Liel wrote: >> I'd like us to move forward with this. >> >> The option of using 'attach' action does not exist, because, as Eoghan >> observed, we would be executing an action on an entity which doesn't exist >> in the collection: (.../api/vms/{vm:id}/disks/???-no

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-16 Thread Geert Jansen
On 04/16/2012 02:39 PM, Andrew Cathrow wrote: Is there a 3rd option based on #1 where we just detach the disk rather than detaching and deleting? That could be further extended by adding an optional delete flag This was discussed and the problem with that is that it's not backwards compatib

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-16 Thread Andrew Cathrow
- Original Message - > From: "Ori Liel" > To: engine-devel@ovirt.org > Cc: "Eoghan Glynn" > Sent: Monday, April 16, 2012 8:33:27 AM > Subject: Re: [Engine-devel] Floating Disks implementation in REST-API > > I'd like us to move forwa

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-16 Thread Geert Jansen
On 04/16/2012 02:33 PM, Ori Liel wrote: I'd like us to move forward with this. The option of using 'attach' action does not exist, because, as Eoghan observed, we would be executing an action on an entity which doesn't exist in the collection: (.../api/vms/{vm:id}/disks/???-no entity-???/att

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-16 Thread Ori Liel
I'd like us to move forward with this. The option of using 'attach' action does not exist, because, as Eoghan observed, we would be executing an action on an entity which doesn't exist in the collection: (.../api/vms/{vm:id}/disks/???-no entity-???/attach) There are two options left on the tab

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-11 Thread Geert Jansen
On 04/11/2012 02:53 PM, Itamar Heim wrote: Detach a disk from VM (becomes floating): DELETE api/vms/{vm:id}/disks/{disk:id} Delete a disk ('real' delete)" DELETE api/disks/{disk:id} Assuming this also works when the disk is attached to a VM then the above seems to me like the simplest and cl

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-11 Thread Geert Jansen
On 04/10/2012 04:46 PM, Ori Liel wrote: I assume that a floating disk can be attached to 0 VMs as well, right? So i would assume we get a top-level /disks collection correct?? And I assume that collection would only list floating disks? Indeed, there will be a root collection. but I do not se

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-11 Thread Itamar Heim
On 04/11/2012 11:50 AM, Ayal Baron wrote: - Original Message - On 10/04/12 14:35, Geert Jansen wrote: On 04/09/2012 05:14 PM, Ori Liel wrote: The "Floating Disks" feature makes disks into stand-alone entities: a given disk may be attached to a VM (as all disks are today), or it may

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-11 Thread Ori Liel
> > >- Original Message - >From: "Eoghan Glynn" >To: "Ori Liel" >Cc: meyer...@redhat.com, jhern...@redhat.com, "Geert Jansen" >, "Einav Cohen" , "Michael Pasternak" >, "Michael Kublin" , >engine-devel@ovirt.org >Sent: Tuesday, April 10, 2012 1:42:04 PM >Subject: Re: Floating Disks impl

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-11 Thread Ayal Baron
- Original Message - > On 10/04/12 14:35, Geert Jansen wrote: > > > > > > On 04/09/2012 05:14 PM, Ori Liel wrote: > >> The "Floating Disks" feature makes disks into stand-alone > >> entities: a > >> given disk may be attached to a VM (as all disks are today), or it > >> may > >> be not

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-10 Thread Ori Liel
> > >On 04/09/2012 05:14 PM, Ori Liel wrote: >> The "Floating Disks" feature makes disks into stand-alone entities: a given >> disk may be attached to a VM (as all disks are today), or it may be not >> attached to any VM, which makes it a floating disk >> (http://www.ovirt.org/wiki/Features/Floa

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-10 Thread Eoghan Glynn
> In my view, backwards compatible DELETE semantics for a floating disk > aren't that bad: > > DELETE /vms/{vm:id}/disks/{disk:id} > > => Accept a true|false argument. > => Defaults to "false" for compatibility. > > This means that DELETE will by default really DELETE any non-floating > disk.

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-10 Thread Livnat Peer
On 10/04/12 14:35, Geert Jansen wrote: > > > On 04/09/2012 05:14 PM, Ori Liel wrote: >> The "Floating Disks" feature makes disks into stand-alone entities: a >> given disk may be attached to a VM (as all disks are today), or it may >> be not attached to any VM, which makes it a floating disk >> (

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-10 Thread Geert Jansen
On 04/09/2012 05:14 PM, Ori Liel wrote: The "Floating Disks" feature makes disks into stand-alone entities: a given disk may be attached to a VM (as all disks are today), or it may be not attached to any VM, which makes it a floating disk (http://www.ovirt.org/wiki/Features/FloatingDisk) To

Re: [Engine-devel] Floating Disks implementation in REST-API

2012-04-10 Thread Eoghan Glynn
> The "Floating Disks" feature makes disks into stand-alone entities: a > given disk may be attached to a VM (as all disks are today), or it > may be not attached to any VM, which makes it a floating disk > (http://www.ovirt.org/wiki/Features/FloatingDisk) > > To implement attach/detach of disk