tuskar/tuskar — pull request #8 by mfojtik (2013-06-24 11:05:25+00:00)
Title: Initial support for updating the Rack resource

Hi,

This patch add initial support for updating the Rack resource through REST interface. The syntax is following:

```bash
$ curl -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' \
-d '{"id": "1", "name": "new-rack-name"}' http://0.0.0.0:6385/v1/racks
```

It is also possible to update 'capacities' and 'nodes'. Note, as this is a HTTP PUT operation, specifying the 'capacities' or 'nodes' will **always** replace the old list of capacities and nodes:

```bash
$ curl -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' \
-d '{"id": "1", "capacities":[]}' http://0.0.0.0:6385/v1/racks
```

This will remove all capacities currently associated with given Rack.

```bash
$ curl -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' \
-d '{"id": "1"}' http://0.0.0.0:6385/v1/racks
```

If 'capacities' or 'nodes' are omitted from the JSON body, they are ignored

Updating list of Nodes in Rack:

```bash
$ curl -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' \
-d '{"id": "1", "nodes": [ { "id": "123"}, {"id": "345"} ]}' http://0.0.0.0:6385/v1/racks
```