dinsdag 29 maart 2011

Tagging: a basic implementation

For the moment tagging is implemented as follows: when starting a new server the user can choose to add tags that will describe this server (or his functions). These tags will be submitted to the cloud in which the server will run. More on the format of these tags on the serverside later. Scarlet Nebula will also save the tags locally for two reasons
  • Not all Cloud Providers support tagging
  • Changing tags on a running server is impossible in most Cloud Providers

When linking a previously unlinked server, the cloudprovider this server resides in will be queried and the tags (if any) returned will be used by Scarlet Nebula.

The Dasein Tag Format

Dasein does not use a typical interpretation of tags, it instead defines a tag as a (key,value) tuple. This has two complications
  • A Scarlet Nebula tag consisting only of a value needs to be stored as key,value
  • A Dasein tag consisting of a key, value pair needs to be stored as a value
I solved the first problem by converting a Scarlet Nebula tag containing "foo" to a Dasein tag "tagX:foo" with X being an incrementing integer (keys need to be unique). Later on I'll recognize this format when linking unlinked servers.

The second problem is solved by converting (key, value) = (foo,bar) to foo:bar unless it's a Scarlet Nebula tag in which case it will be converted to just "bar".

Geen opmerkingen:

Een reactie plaatsen