Verify the response attributes of 'create-aggregate' API

This patch verifies the response attributes of 'create-aggregate'.
The response attributes of v2 and v3 are the same:
{
    "aggregate": {
        "availability_zone": "nova",
        "created_at": "2012-10-01T18:50:27.781065",
        "deleted": false,
        "deleted_at": null,
        "id": 1,
        "name": "name",
        "updated_at": null
    }
}
The status_code is different:
  v2 -> 200
  v3 -> 201
This patch also fixed a typo bug in the compute/aggregates.py

Partially implements blueprint nova-api-attribute-test

Change-Id: I584ee2b9ac6033fb365a8dadd4e3844b1c37edb2
This commit is contained in:
Haiwei Xu
2014-03-31 20:13:25 +09:00
committed by Ghanshyam
parent 9f921d698f
commit c51d570c1a
5 changed files with 36 additions and 0 deletions

View File

@@ -50,6 +50,7 @@ class AggregatesV3ClientJSON(rest_client.RestClient):
resp, body = self.post('os-aggregates', post_body)
body = json.loads(body)
self.validate_response(v3_schema.create_aggregate, resp, body)
return resp, body['aggregate']
def update_aggregate(self, aggregate_id, name, availability_zone=None):