softlayer / jumpgate

A simple library to make more clouds compatible with OpenStack.
http://softlayer.github.io/jumpgate/
MIT License
46 stars 30 forks source link

Add ability to set tags on viritual images #77

Open rhodgin opened 10 years ago

rhodgin commented 10 years ago

OpenStack's image service, glance, supports APIs to set tags on images to differentiate them (v2/images/​{image_id}​/tags/​{tag}​). It looks like the SoftLayer API has a similar ability (SoftLayer_Virtual_Guest_Block_Device_Template_Group::setTags). Would you please consider enhancing the JumpGate API to support this functionality?

aparnapatil commented 10 years ago

@rhodgin: For supporting tagging functionality, Jumpgate API should handle

  1. PUT v2/images/​{image_id}​/tags/​{tag} and
  2. DELETE v2/images/​{image_id}​/tags/​{tag}

we can set Tags using SoftLayer_Virtual_Guest_Block_Device_Template_Group::setTags(). However , there is no such method for deleting specific tag on Softlayer side. In this case, we can reuse setTags() as -

  1. Retrieve tagReferences for specified image.
  2. delete given tag from list and set updated list again.

And, Openstack Image service allows to set maximum number of tags allowed per image in .conf. but while adding tag to image on SL replaces previous tags so here also, we can load tag_list, append new tag to list and set the updated list. @sudorandom, @underscorephil : can you please confirm if above approach is feasible enough to go ahead?

bodenr commented 10 years ago

@beittenc @sudorandom -- It appears this issue was also proposed here https://github.com/softlayer/jumpgate/issues/51 and the suggestion made was that an internal request would need to be created to support metadata on SL image templates. Has an internal request been discussed to support image metadata? If not how would we go about moving forward with something like that?

Note -- another (less than optimal) option might be to shove the metadata in the image's notes. However from the web UI I can see that field is limited to 1000 chars which suggests the backend API is also capped.