Implement EC2 API for Tags

Registered by Stephen Gran

The EC2 API allows end users to 'tag' resources with arbitrary key-value pairs. This facility is also used by internal AWS tools such as autoscaling and cloudformation to group resources spawned by them. The openstack EC2 API implementation does not offer the tags related API calls DescribeTags, CreateTags, DeleteTags or the ability to filter resource searches by tags ("filter": [{ "tag:key": "value"}]} and {"filter": [{"tag-key": "value"}]}.

The difficulty I see is that tags can be applied to many resource types, including ones handled by Quantum and Glance and so on. It is not clear to me if reusing the instance-metadata table (and creating a 'security-group-metadata and so on tables) is the best way, or if this should be done with a new table 'tags' that stores all tags and a reference to the resource.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
Stephen Gran
Direction:
Needs approval
Assignee:
Stephen Gran
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Stephen Gran
Completed by
Stephen Gran

Whiteboard

After discussion on the mailing list, it was decided to implement this as a table per resource type, with data being stored local to the service implementing it and API calls from the EC2 API.

Create lookup table in ec2utils that turns resource ids like 'ami-XXXX' and 'sg-XXXX' into a tuple of resource type, resource id
Create CRUD methods in EC2 API (CreateTags, DeleteTags, DescribeTags) that uses lookup table to determine which API to call out out to
Call out to Nova Compute API for tags related to instances
Add stubs for calling out to other APIs that returns a sensible error for now

Gerrit topic: https://review.openstack.org/#q,topic:bug/1096821,n,z

Addressed by: https://review.openstack.org/23256
    Add CRUD methods for tags to the EC2 API.

Gerrit topic: https://review.openstack.org/#q,topic:describe-instances-tags,n,z

(?)

Work Items

Work items:
Lookup table in ec2utils: TODO
CRUD methods: TODO
Compute API callout: TODO
Stubs for other APIs: TODO

This blueprint contains Public information 
Everyone can see this information.