Commit ac17257f authored by Georgios D. Tsoukalas's avatar Georgios D. Tsoukalas

Incorporate all resources into service definitions

- Add 'service_origin' key in resources, as the normative name of
  the service that exported it.
- Keep resources backwards compatible, export-resource-service
  reads resources from the service list.
parent 6e7ac4d0
......@@ -41,7 +41,16 @@ astakos_services = {
'endpoints': [
{'versionId': 'v1.0',
'publicURL': None},
]},
],
'resources': {
'pending_app': {
'desc': "Number of pending project applications",
'name': "astakos.pending_app",
'service_type': "account",
'service_origin': "astakos_account",
'allow_in_projects': False},
},
},
'astakos_keystone': {
'type': 'identity',
......@@ -51,7 +60,9 @@ astakos_services = {
'endpoints': [
{'versionId': 'v2.0',
'publicURL': None},
]},
],
'resources': {},
},
'astakos_ui': {
'type': 'astakos_ui',
......@@ -61,5 +72,6 @@ astakos_services = {
'endpoints': [
{'versionId': '',
'publicURL': None},
]},
],
},
}
......@@ -31,10 +31,7 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
resources = [
{"desc": "Number of pending project applications",
"name": "astakos.pending_app",
"allow_in_projects": False,
"service_type": "account",
}
]
from astakos.im.settings import astakos_services
from synnefo.util.keypath import get_path
resources = get_path(astakos_services, 'astakos_account.resources').values()
......@@ -43,7 +43,41 @@ cyclades_services = {
'endpoints': [
{'versionId': 'v2.0',
'publicURL': None},
]},
],
'resources': {
'vm': {
"name": "cyclades.vm",
"desc": "Number of virtual machines",
"service_type": "compute",
"service_origin": "cyclades_compute",
},
'cpu': {
"name": "cyclades.cpu",
"desc": "Number of virtual machine processors",
"service_type": "compute",
"service_origin": "cyclades_compute",
},
'ram': {
"name": "cyclades.ram",
"desc": "Virtual machine memory size",
"unit": "bytes",
"service_type": "compute",
"service_origin": "cyclades_compute",
},
'disk': {
"name": "cyclades.disk",
"desc": "Virtual machine disk size",
"unit": "bytes",
"service_type": "compute",
"service_origin": "cyclades_compute",
},
'network-private': {
"name": "cyclades.network.private",
"desc": "Number of private networks",
"service_type": "compute",
"service_origin": "cyclades_compute",
},
},
'cyclades_plankton': {
'type': 'image',
......@@ -52,8 +86,10 @@ cyclades_services = {
'public': True,
'endpoints': [
{'versionId': 'v1.0',
'publicURL': None}
]},
'publicURL': None},
],
'resources': {},
},
'cyclades_vmapi': {
'type': 'cyclades_vmapi',
......@@ -63,7 +99,9 @@ cyclades_services = {
'endpoints': [
{'versionId': 'v1.0',
'publicURL': None},
]},
],
'resources': {},
},
'cyclades_helpdesk': {
'type': 'cyclades_helpdesk',
......@@ -73,7 +111,8 @@ cyclades_services = {
'endpoints': [
{'versionId': '',
'publicURL': None},
]},
],
},
'cyclades_userdata': {
'type': 'cyclades_userdata',
......@@ -83,7 +122,9 @@ cyclades_services = {
'endpoints': [
{'versionId': '',
'publicURL': None},
]},
],
'resources': {},
},
'cyclades_ui': {
'type': 'cyclades_ui',
......@@ -93,5 +134,7 @@ cyclades_services = {
'endpoints': [
{'versionId': '',
'publicURL': None},
]},
],
'resources': {},
},
}
# Copyright 2013 GRNET S.A. All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
#
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
resources =\
[{"name": "cyclades.vm",
"desc": "Number of virtual machines",
"service_type": "compute",
},
{"name": "cyclades.cpu",
"desc": "Number of virtual machine processors",
"service_type": "compute",
},
{"name": "cyclades.ram",
"desc": "Virtual machine memory size",
"unit": "bytes",
"service_type": "compute",
},
{"name": "cyclades.disk",
"desc": "Virtual machine disk size",
"unit": "bytes",
"service_type": "compute",
},
{"name": "cyclades.network.private",
"desc": "Number of private networks",
"service_type": "compute",
}]
from synnefo.util.keypath import get_path
from synnefo.api import cyclades_services
resources = get_path('cyclades_compute.resources').values()
......@@ -31,11 +31,7 @@
# interpreted as representing official policies, either expressed
# or implied, of GRNET S.A.
from synnefo.util.keypath import get_path
from pithos.api.settings import pithos_services
resources = [
{"desc": "Pithos account diskspace",
"name": "pithos.diskspace",
"unit": "bytes",
"service_type": "object-store",
}
]
resources = get_path(pithos_services, 'pithos_object-store.resources').values()
......@@ -41,7 +41,17 @@ pithos_services = {
'endpoints': [
{'versionId': 'v1',
'publicURL': None},
]},
],
'resources': {
'diskspace': {
"desc": "Pithos account diskspace",
"name": "pithos.diskspace",
"unit": "bytes",
"service_type": "object-store",
"service_origin": "pithos_object-store",
},
},
},
'pithos_public': {
'type': 'public',
......@@ -51,7 +61,9 @@ pithos_services = {
'endpoints': [
{'versionId': 'v2.0',
'publicURL': None},
]},
],
'resources': {},
},
'pithos_ui': {
'type': 'pithos_ui',
......@@ -61,5 +73,7 @@ pithos_services = {
'endpoints': [
{'versionId': '',
'publicURL': None},
]},
],
'resources': {},
},
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment