blob: a3ab3c8be29e5d46205b302ce9ddcd0251ab8f8b [file] [log] [blame]
Haiwei Xu88173c82014-03-20 03:15:13 +09001# Copyright 2014 NEC Corporation. All rights reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
Haiwei Xue20f9b72014-04-08 21:59:02 +090015import copy
16
Haiwei Xu7e40d022014-03-25 22:42:13 +090017aggregate = {
18 'type': 'object',
Haiwei Xue20f9b72014-04-08 21:59:02 +090019 'properties': {
Haiwei Xu7e40d022014-03-25 22:42:13 +090020 'availability_zone': {'type': ['string', 'null']},
21 'created_at': {'type': 'string'},
22 'deleted': {'type': 'boolean'},
23 'deleted_at': {'type': ['string', 'null']},
24 'hosts': {'type': 'array'},
25 'id': {'type': 'integer'},
26 'metadata': {'type': 'object'},
27 'name': {'type': 'string'},
28 'updated_at': {'type': ['string', 'null']}
29 },
30 'required': ['availability_zone', 'created_at', 'deleted',
31 'deleted_at', 'hosts', 'id', 'metadata',
32 'name', 'updated_at']
33}
34
Haiwei Xu88173c82014-03-20 03:15:13 +090035list_aggregates = {
36 'status_code': [200],
37 'response_body': {
38 'type': 'object',
39 'properties': {
40 'aggregates': {
41 'type': 'array',
Haiwei Xu7e40d022014-03-25 22:42:13 +090042 'items': aggregate
Haiwei Xu88173c82014-03-20 03:15:13 +090043 }
44 },
45 'required': ['aggregates']
46 }
47}
Haiwei Xu7e40d022014-03-25 22:42:13 +090048
49get_aggregate = {
50 'status_code': [200],
51 'response_body': {
52 'type': 'object',
53 'properties': {
54 'aggregate': aggregate
55 },
56 'required': ['aggregate']
57 }
58}
Haiwei Xuddd3cda2014-04-03 23:39:48 +090059
60aggregate_set_metadata = get_aggregate
Haiwei Xue20f9b72014-04-08 21:59:02 +090061# The 'updated_at' attribute of 'update_aggregate' can't be null.
62update_aggregate = copy.deepcopy(get_aggregate)
63update_aggregate['response_body']['properties']['aggregate']['properties'][
64 'updated_at'] = {
65 'type': 'string'
66 }