Jorge Chai | 83ba4ee | 2014-04-15 18:58:08 +0000 | [diff] [blame] | 1 | |
| 2 | # Copyright (c) 2014 Rackspace, Inc. |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| 13 | # implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | list_link = { |
| 18 | 'type': 'object', |
| 19 | 'properties': { |
| 20 | 'rel': {'type': 'string'}, |
| 21 | 'href': { |
| 22 | 'type': 'string', |
| 23 | 'format': 'uri' |
| 24 | } |
| 25 | }, |
| 26 | 'required': ['href', 'rel'] |
| 27 | } |
| 28 | |
| 29 | list_queue = { |
| 30 | 'type': 'object', |
| 31 | 'properties': { |
| 32 | 'name': {'type': 'string'}, |
| 33 | 'href': { |
| 34 | 'type': 'string', |
| 35 | 'format': 'uri' |
| 36 | }, |
| 37 | 'metadata': {'type': 'object'} |
| 38 | }, |
| 39 | 'required': ['name', 'href'] |
| 40 | } |
| 41 | |
| 42 | list_queues = { |
| 43 | 'status_code': [200, 204], |
| 44 | 'response_body': { |
| 45 | 'type': 'object', |
| 46 | 'properties': { |
| 47 | 'links': { |
| 48 | 'type': 'array', |
| 49 | 'items': list_link, |
| 50 | 'maxItems': 1 |
| 51 | }, |
| 52 | 'queues': { |
| 53 | 'type': 'array', |
| 54 | 'items': list_queue |
| 55 | } |
| 56 | }, |
| 57 | 'required': ['links', 'queues'] |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | message_link = { |
| 62 | 'type': 'object', |
| 63 | 'properties': { |
| 64 | 'href': { |
| 65 | 'type': 'string', |
| 66 | 'format': 'uri' |
| 67 | }, |
| 68 | 'age': {'type': 'number'}, |
| 69 | 'created': { |
| 70 | 'type': 'string', |
| 71 | 'format': 'date-time' |
| 72 | } |
| 73 | }, |
| 74 | 'required': ['href', 'age', 'created'] |
| 75 | } |
| 76 | |
| 77 | messages = { |
| 78 | 'type': 'object', |
| 79 | 'properties': { |
| 80 | 'free': {'type': 'number'}, |
| 81 | 'claimed': {'type': 'number'}, |
| 82 | 'total': {'type': 'number'}, |
| 83 | 'oldest': message_link, |
| 84 | 'newest': message_link |
| 85 | }, |
| 86 | 'required': ['free', 'claimed', 'total'] |
| 87 | } |
| 88 | |
| 89 | queue_stats = { |
| 90 | 'status_code': [200], |
| 91 | 'response_body': { |
| 92 | 'type': 'object', |
| 93 | 'properties': { |
| 94 | 'messages': messages |
| 95 | }, |
| 96 | 'required': ['messages'] |
| 97 | } |
| 98 | } |