coreos/fleet — pull request #1077 by epipho (2014-12-25 09:12:10+00:00)
Title: [WIP] Dynamic Metadata

This is a work in progress solution for #555 which provides the ability to update metadata on a running instance. Please take a look at the progress so far to see if the approach makes sense.

- Metadata has been moved out of the /object key in etcd and into individual etcd keys under /metadata to allow for individual updates to metadata values without fear of stepping on each other.
- A new endpoint PATCH /machines/ was created to handle metadata updates for a single machine. It takes a json document with 1 or more keys to update, example below.
- Metadata supports per-value TTL.
- Metadata keys can be removed by setting their value to null or empty string
- Metadata in the machine heartbeat is ignored unless it is the first time it is seen. If the machine state needs to be created in etcd, the metadata in the heartbeat will be used as the starting point.

Example PATCH request
```
{
"foo": { "value": "bar" },
"baz": {"value": "stuff"; "ttl": 30},
"feh": {"value": null }
}
```