Merge "Return the project id in the service"

This commit is contained in:
Jenkins 2015-09-10 14:08:21 +00:00 committed by Gerrit Code Review
commit 6b26c9a918
4 changed files with 5 additions and 0 deletions

View File

@ -36,6 +36,7 @@ class Model(collections.OrderedDict):
super(Model, self).__init__()
self["name"] = util.help_escape(service_obj.name)
self["id"] = str(service_obj.service_id)
self["project_id"] = str(service_obj.project_id)
self["domains"] = [domain.Model(d) for d in service_obj.domains]
self["origins"] = [origin.Model(o) for o in service_obj.origins]
self["restrictions"] = [restriction.Model(r) for r in

View File

@ -140,6 +140,7 @@ class TestGetServiceByDomain(base.TestBase):
self.assertEqual(body['caching'], self.caching_list)
self.assertEqual(body['restrictions'], self.restrictions_list)
self.assertEqual(body['flavor_id'], self.flavor_id)
self.assertEqual(body['project_id'], self.user_project_id)
def test_get_service_by_multiple_domains(self):
self.skipTest('See https://bugs.launchpad.net/poppy/+bug/1486103')

View File

@ -77,6 +77,7 @@ class TestCreateService(providers.TestProviderBase):
body = resp.json()
self.assertSchema(body, services.get_service)
self.assertEqual(body['project_id'], self.user_project_id)
for item in domain_list:
if 'protocol' not in item:

View File

@ -77,12 +77,14 @@ log_delivery = {'type': 'object'}
service_name = {'type': 'string', 'pattern': '([a-zA-Z0-9_\-\.]{1,256})'}
uuid4 = '([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12})' # noqa
service_id = {'type': 'string', 'pattern': uuid4}
project_id = {'type': 'string', 'pattern': '([a-zA-Z0-9_\-\.]{1,256})'}
# Response Schema Definition for Get Service API
get_service = {
'type': 'object',
'properties': {
'id': service_id,
'project_id': project_id,
'name': service_name,
'domains': {'type': 'array',
'items': {'anyOf': [domain, domain_https]},