Merge "Move server groups schema into its own file"

This commit is contained in:
Zuul 2018-07-30 19:33:04 +00:00 committed by Gerrit Code Review
commit 2131fef873
4 changed files with 75 additions and 59 deletions

View File

@ -0,0 +1,65 @@
# Copyright 2017 NTT Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
common_server_group = {
'type': 'object',
'properties': {
'id': {'type': 'string'},
'name': {'type': 'string'},
'policies': {
'type': 'array',
'items': {'type': 'string'}
},
# 'members' attribute contains the array of instance's UUID of
# instances present in server group
'members': {
'type': 'array',
'items': {'type': 'string'}
},
'metadata': {'type': 'object'}
},
'additionalProperties': False,
'required': ['id', 'name', 'policies', 'members', 'metadata']
}
create_show_server_group = {
'status_code': [200],
'response_body': {
'type': 'object',
'properties': {
'server_group': common_server_group
},
'additionalProperties': False,
'required': ['server_group']
}
}
delete_server_group = {
'status_code': [204]
}
list_server_groups = {
'status_code': [200],
'response_body': {
'type': 'object',
'properties': {
'server_groups': {
'type': 'array',
'items': common_server_group
}
},
'additionalProperties': False,
'required': ['server_groups']
}
}

View File

@ -345,58 +345,6 @@ list_addresses = {
}
}
common_server_group = {
'type': 'object',
'properties': {
'id': {'type': 'string'},
'name': {'type': 'string'},
'policies': {
'type': 'array',
'items': {'type': 'string'}
},
# 'members' attribute contains the array of instance's UUID of
# instances present in server group
'members': {
'type': 'array',
'items': {'type': 'string'}
},
'metadata': {'type': 'object'}
},
'additionalProperties': False,
'required': ['id', 'name', 'policies', 'members', 'metadata']
}
create_show_server_group = {
'status_code': [200],
'response_body': {
'type': 'object',
'properties': {
'server_group': common_server_group
},
'additionalProperties': False,
'required': ['server_group']
}
}
delete_server_group = {
'status_code': [204]
}
list_server_groups = {
'status_code': [200],
'response_body': {
'type': 'object',
'properties': {
'server_groups': {
'type': 'array',
'items': common_server_group
}
},
'additionalProperties': False,
'required': ['server_groups']
}
}
instance_actions = {
'type': 'object',
'properties': {

View File

@ -14,21 +14,22 @@
import copy
from tempest.lib.api_schema.response.compute.v2_1 import servers
from tempest.lib.api_schema.response.compute.v2_1 import server_groups
common_server_group = copy.deepcopy(servers.common_server_group)
common_server_group = copy.deepcopy(server_groups.common_server_group)
common_server_group['properties']['project_id'] = {'type': 'string'}
common_server_group['properties']['user_id'] = {'type': 'string'}
common_server_group['required'].append('project_id')
common_server_group['required'].append('user_id')
create_show_server_group = copy.deepcopy(servers.create_show_server_group)
create_show_server_group = copy.deepcopy(
server_groups.create_show_server_group)
create_show_server_group['response_body']['properties'][
'server_group'] = common_server_group
delete_server_group = copy.deepcopy(servers.delete_server_group)
delete_server_group = copy.deepcopy(server_groups.delete_server_group)
list_server_groups = copy.deepcopy(servers.list_server_groups)
list_server_groups = copy.deepcopy(server_groups.list_server_groups)
list_server_groups['response_body']['properties']['server_groups'][
'items'] = common_server_group

View File

@ -16,8 +16,10 @@
from oslo_serialization import jsonutils as json
from tempest.lib.api_schema.response.compute.v2_1 import servers as schema
from tempest.lib.api_schema.response.compute.v2_13 import servers as schemav213
from tempest.lib.api_schema.response.compute.v2_1 import server_groups \
as schema
from tempest.lib.api_schema.response.compute.v2_13 import server_groups \
as schemav213
from tempest.lib.common import rest_client
from tempest.lib.services.compute import base_compute_client