zhufl | da8d258 | 2018-09-29 15:58:04 +0800 | [diff] [blame] | 1 | # Copyright 2015 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 | |
| 15 | from tempest.lib.api_schema.response.compute.v2_1 import parameter_types |
| 16 | |
| 17 | create_group = { |
| 18 | 'status_code': [202], |
| 19 | 'response_body': { |
| 20 | 'type': 'object', |
| 21 | 'properties': { |
| 22 | 'group': { |
| 23 | 'type': 'object', |
| 24 | 'properties': { |
| 25 | 'id': {'type': 'string', 'format': 'uuid'}, |
| 26 | 'name': {'type': 'string'}, |
| 27 | }, |
| 28 | 'additionalProperties': False, |
| 29 | 'required': ['id', 'name'] |
| 30 | } |
| 31 | }, |
| 32 | 'additionalProperties': False, |
| 33 | 'required': ['group'] |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | delete_group = {'status_code': [202]} |
| 38 | |
| 39 | show_group = { |
| 40 | 'status_code': [200], |
| 41 | 'response_body': { |
| 42 | 'type': 'object', |
| 43 | 'properties': { |
| 44 | 'group': { |
| 45 | 'type': 'object', |
| 46 | 'properties': { |
| 47 | 'status': {'type': 'string'}, |
| 48 | 'description': {'type': ['string', 'null']}, |
| 49 | 'availability_zone': {'type': 'string'}, |
| 50 | 'created_at': parameter_types.date_time, |
| 51 | 'group_type': {'type': 'string', 'format': 'uuid'}, |
| 52 | 'group_snapshot_id': {'type': ['string', 'null']}, |
| 53 | 'source_group_id': {'type': ['string', 'null']}, |
| 54 | 'volume_types': { |
| 55 | 'type': 'array', |
| 56 | 'items': {'type': 'string', 'format': 'uuid'} |
| 57 | }, |
| 58 | 'id': {'type': 'string', 'format': 'uuid'}, |
| 59 | 'name': {'type': 'string'}, |
| 60 | # TODO(zhufl): volumes is added in 3.25, we should move it |
| 61 | # to the 3.25 schema file when microversion is supported |
| 62 | # in volume interfaces |
| 63 | 'volumes': { |
| 64 | 'type': 'array', |
| 65 | 'items': {'type': 'string', 'format': 'uuid'} |
| 66 | }, |
| 67 | 'replication_status': {'type': 'string'} |
| 68 | }, |
| 69 | 'additionalProperties': False, |
| 70 | 'required': ['status', 'description', 'created_at', |
| 71 | 'group_type', 'volume_types', 'id', 'name'] |
| 72 | } |
| 73 | }, |
| 74 | 'additionalProperties': False, |
| 75 | 'required': ['group'] |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | list_groups_no_detail = { |
| 80 | 'status_code': [200], |
| 81 | 'response_body': { |
| 82 | 'type': 'object', |
| 83 | 'properties': { |
| 84 | 'groups': { |
| 85 | 'type': 'array', |
| 86 | 'items': { |
| 87 | 'type': 'object', |
| 88 | 'properties': { |
| 89 | 'id': {'type': 'string', 'format': 'uuid'}, |
| 90 | 'name': {'type': 'string'} |
| 91 | }, |
| 92 | 'additionalProperties': False, |
| 93 | 'required': ['id', 'name'], |
| 94 | } |
| 95 | } |
| 96 | }, |
| 97 | 'additionalProperties': False, |
| 98 | 'required': ['groups'], |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | list_groups_with_detail = { |
| 103 | 'status_code': [200], |
| 104 | 'response_body': { |
| 105 | 'type': 'object', |
| 106 | 'properties': { |
| 107 | 'groups': { |
| 108 | 'type': 'array', |
| 109 | 'items': { |
| 110 | 'type': 'object', |
| 111 | 'properties': { |
| 112 | 'status': {'type': 'string'}, |
| 113 | 'description': {'type': ['string', 'null']}, |
| 114 | 'availability_zone': {'type': 'string'}, |
| 115 | 'created_at': parameter_types.date_time, |
| 116 | 'group_type': {'type': 'string', 'format': 'uuid'}, |
| 117 | 'group_snapshot_id': {'type': ['string', 'null']}, |
| 118 | 'source_group_id': {'type': ['string', 'null']}, |
| 119 | 'volume_types': { |
| 120 | 'type': 'array', |
| 121 | 'items': {'type': 'string', 'format': 'uuid'} |
| 122 | }, |
| 123 | 'id': {'type': 'string', 'format': 'uuid'}, |
| 124 | 'name': {'type': 'string'}, |
| 125 | # TODO(zhufl): volumes is added in 3.25, we should |
| 126 | # move it to the 3.25 schema file when microversion |
| 127 | # is supported in volume interfaces |
| 128 | 'volumes': { |
| 129 | 'type': 'array', |
| 130 | 'items': {'type': 'string', 'format': 'uuid'} |
| 131 | }, |
| 132 | }, |
| 133 | 'additionalProperties': False, |
| 134 | 'required': ['status', 'description', 'created_at', |
| 135 | 'group_type', 'volume_types', 'id', 'name'] |
| 136 | } |
| 137 | } |
| 138 | }, |
| 139 | 'additionalProperties': False, |
| 140 | 'required': ['groups'], |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | create_group_from_source = { |
| 145 | 'status_code': [202], |
| 146 | 'response_body': { |
| 147 | 'type': 'object', |
| 148 | 'properties': { |
| 149 | 'group': { |
| 150 | 'type': 'object', |
| 151 | 'properties': { |
| 152 | 'id': {'type': 'string', 'format': 'uuid'}, |
| 153 | 'name': {'type': 'string'}, |
| 154 | }, |
| 155 | 'additionalProperties': False, |
| 156 | 'required': ['id', 'name'] |
| 157 | } |
| 158 | }, |
| 159 | 'additionalProperties': False, |
| 160 | 'required': ['group'] |
| 161 | } |
| 162 | } |
| 163 | update_group = {'status_code': [202]} |
| 164 | reset_group_status = {'status_code': [202]} |