[Openstack] [OpenStackClient] Adding Image 'member' commands

Jay Pipes jaypipes at gmail.com
Tue Jan 6 14:55:45 UTC 2015


On 01/02/2015 03:10 PM, Dean Troyer wrote:
> Glance has the concept of 'image members' as the mechanism for sharing
> images between projects.  We need to add this to OSC and I'd like to
> work out the commands/options to do so  A while back, markwash and I sat
> down and sorted a simple set of additions to support the member
> operations for both Image v1 and v2 APIs.  I promptly went on and
> dropped this particular ball.
>
> I suppose first of all, does there remain a need/desire to add these for
> Image API v1?

Yes. There's many shops that still use the v1 Glance API. And, Nova 
itself, has little current support for v2 Glance API.

 > The v2 set we came up with is much cleaner and I think is
> highly preferable and if we can just leave OSC's Image v1 as-is I would
> prefer to do that.
>
> Conceptually, I see a shared image as an image with an attribute that is
> a list of projects that it is shared with in addition to its home
> (owner) project.  To maintain that list, two new options can be added to
> 'image create' and 'image set':
>
> --share <project> - add <project> to the shared-with list for this image
> --no-share <project> - remove <project> from the shared-with list
> ('image set' only)

Is image set equal to image update in v1 parlance?

> Both --share and --no-share options may be repeated, much as the
> --properties option works today.

I would prefer --share and --unshare or --add-member and 
--remove-member. Typically, --no- prefix on a CLI option means to 
disable a boolean option.

> In addition, the 'receiving' project must ACK the sharing, which would
> be an added option to 'image set':
>
> --share ack - the magic value 'ACK' (case insensitive) signifies the
> acceptance of a shared image by the 'receiving' project

IMHO. Would have been a bit nicer to have something like this:

  glance image member [confirm|decline] <IMAGE_ID> [<PROJECT_ID>]

> A couple of new options are added to 'image list' to select shared images:
>
> --shared - filter on shared images only
> --project <project> - filter on <project> (this may imply --shared?)

Or:

  --shared-with=<project>

> Some of the questions I have:
>
> * Is --no-share the correct antonym of --share?  --unshare maybe?  We
> have a pattern of using regular English words were possible
> (enable|disable) rather than the GNU style of prepending 'no-' to
> options, but that is my current backup.

Prefer --unshare to --no-share, but prefer --add-member/--remove-member 
to either :)

> * Do we need an 'un-ACK' option for a 'receiving' project to remove the
> shared image from their list without requiring the owner project to do
> so?  Is this even possible in the Image v2 API?

See suggestion above:

  glance image member decline <IMAGE_ID> [<PROJECT_ID>]

Best,
-jay




More information about the Openstack mailing list