Merge "Refactor floatin_ips V2.1 API response schema"
diff --git a/tempest/api_schema/response/compute/v2_1/floating_ips.py b/tempest/api_schema/response/compute/v2_1/floating_ips.py
index 7250773..7369bec 100644
--- a/tempest/api_schema/response/compute/v2_1/floating_ips.py
+++ b/tempest/api_schema/response/compute/v2_1/floating_ips.py
@@ -12,6 +12,28 @@
# License for the specific language governing permissions and limitations
# under the License.
+common_floating_ip_info = {
+ 'type': 'object',
+ 'properties': {
+ # NOTE: Now the type of 'id' is integer, but
+ # here allows 'string' also because we will be
+ # able to change it to 'uuid' in the future.
+ 'id': {'type': ['integer', 'string']},
+ 'pool': {'type': ['string', 'null']},
+ 'instance_id': {'type': ['string', 'null']},
+ 'ip': {
+ 'type': 'string',
+ 'format': 'ip-address'
+ },
+ 'fixed_ip': {
+ 'type': ['string', 'null'],
+ 'format': 'ip-address'
+ }
+ },
+ 'required': ['id', 'pool', 'instance_id',
+ 'ip', 'fixed_ip'],
+
+}
list_floating_ips = {
'status_code': [200],
'response_body': {
@@ -19,29 +41,10 @@
'properties': {
'floating_ips': {
'type': 'array',
- 'items': {
- 'type': 'object',
- 'properties': {
- # NOTE: Now the type of 'id' is integer, but
- # here allows 'string' also because we will be
- # able to change it to 'uuid' in the future.
- 'id': {'type': ['integer', 'string']},
- 'pool': {'type': ['string', 'null']},
- 'instance_id': {'type': ['string', 'null']},
- 'ip': {
- 'type': 'string',
- 'format': 'ip-address'
- },
- 'fixed_ip': {
- 'type': ['string', 'null'],
- 'format': 'ip-address'
- }
- },
- 'required': ['id', 'pool', 'instance_id', 'ip', 'fixed_ip']
- }
- }
+ 'items': common_floating_ip_info
+ },
},
- 'required': ['floating_ips']
+ 'required': ['floating_ips'],
}
}
@@ -50,28 +53,9 @@
'response_body': {
'type': 'object',
'properties': {
- 'floating_ip': {
- 'type': 'object',
- 'properties': {
- # NOTE: Now the type of 'id' is integer, but here allows
- # 'string' also because we will be able to change it to
- # 'uuid' in the future.
- 'id': {'type': ['integer', 'string']},
- 'pool': {'type': ['string', 'null']},
- 'instance_id': {'type': ['string', 'null']},
- 'ip': {
- 'type': 'string',
- 'format': 'ip-address'
- },
- 'fixed_ip': {
- 'type': ['string', 'null'],
- 'format': 'ip-address'
- }
- },
- 'required': ['id', 'pool', 'instance_id', 'ip', 'fixed_ip']
- }
+ 'floating_ip': common_floating_ip_info
},
- 'required': ['floating_ip']
+ 'required': ['floating_ip'],
}
}
@@ -87,11 +71,11 @@
'properties': {
'name': {'type': 'string'}
},
- 'required': ['name']
+ 'required': ['name'],
}
}
},
- 'required': ['floating_ip_pools']
+ 'required': ['floating_ip_pools'],
}
}
@@ -111,10 +95,10 @@
'ip_range': {'type': 'string'},
'pool': {'type': ['string', 'null']},
},
- 'required': ['interface', 'ip_range', 'pool']
+ 'required': ['interface', 'ip_range', 'pool'],
}
},
- 'required': ['floating_ips_bulk_create']
+ 'required': ['floating_ips_bulk_create'],
}
}
@@ -125,7 +109,7 @@
'properties': {
'floating_ips_bulk_delete': {'type': 'string'}
},
- 'required': ['floating_ips_bulk_delete']
+ 'required': ['floating_ips_bulk_delete'],
}
}
@@ -155,10 +139,10 @@
# NOTE: fixed_ip is introduced after JUNO release,
# So it is not defined as 'required'.
'required': ['address', 'instance_uuid', 'interface',
- 'pool', 'project_id']
+ 'pool', 'project_id'],
}
}
},
- 'required': ['floating_ip_info']
+ 'required': ['floating_ip_info'],
}
}