Revision b55b9692
b/astakosclient/astakosclient/services.py | ||
---|---|---|
59 | 59 |
'prefix': 'ui', |
60 | 60 |
'public': False, |
61 | 61 |
'endpoints': [ |
62 |
{'versionId': 'v1.0',
|
|
62 |
{'versionId': '', |
|
63 | 63 |
'publicURL': None}, |
64 | 64 |
]}, |
65 | 65 |
} |
b/snf-astakos-app/astakos/im/management/commands/service-export-astakos.py | ||
---|---|---|
35 | 35 |
from django.core.management.base import NoArgsCommand |
36 | 36 |
# import from settings, after any post-processing |
37 | 37 |
from astakos.im.settings import astakos_services |
38 |
from synnefo.lib.services import filter_public |
|
38 | 39 |
|
39 | 40 |
|
40 | 41 |
class Command(NoArgsCommand): |
41 | 42 |
help = "Export Astakos services in JSON format." |
42 | 43 |
|
43 | 44 |
def handle(self, *args, **options): |
44 |
output = json.dumps(astakos_services, indent=4)
|
|
45 |
output = json.dumps(filter_public(astakos_services), indent=4)
|
|
45 | 46 |
self.stdout.write(output + "\n") |
b/snf-common/synnefo/lib/services.py | ||
---|---|---|
31 | 31 |
# interpreted as representing official policies, either expressed |
32 | 32 |
# or implied, of GRNET S.A. |
33 | 33 |
|
34 |
from copy import deepcopy |
|
34 | 35 |
from synnefo.lib import join_urls |
35 | 36 |
from synnefo.util.keypath import get_path, set_path |
36 | 37 |
|
... | ... | |
47 | 48 |
|
48 | 49 |
publicURL = join_urls(base_url, prefix, version) |
49 | 50 |
set_path(endpoint, 'publicURL', publicURL) |
51 |
|
|
52 |
|
|
53 |
def filter_public(services): |
|
54 |
public_services = {} |
|
55 |
for name, service in services.iteritems(): |
|
56 |
if service.get('public', False): |
|
57 |
public_services[name] = deepcopy(service) |
|
58 |
return public_services |
b/snf-cyclades-app/synnefo/api/management/commands/service-export-cyclades.py | ||
---|---|---|
34 | 34 |
from django.utils import simplejson as json |
35 | 35 |
from django.core.management.base import NoArgsCommand |
36 | 36 |
from synnefo.cyclades_settings import cyclades_services |
37 |
from synnefo.lib.services import filter_public |
|
37 | 38 |
|
38 | 39 |
|
39 | 40 |
class Command(NoArgsCommand): |
40 | 41 |
help = "Export Cyclades services in JSON format." |
41 | 42 |
|
42 | 43 |
def handle(self, *args, **options): |
43 |
output = json.dumps(cyclades_services, indent=4)
|
|
44 |
output = json.dumps(filter_public(cyclades_services), indent=4)
|
|
44 | 45 |
self.stdout.write(output + "\n") |
b/snf-pithos-app/pithos/api/management/commands/service-export-pithos.py | ||
---|---|---|
34 | 34 |
from django.utils import simplejson as json |
35 | 35 |
from django.core.management.base import NoArgsCommand |
36 | 36 |
from pithos.api.settings import pithos_services |
37 |
from synnefo.lib.services import filter_public |
|
37 | 38 |
|
38 | 39 |
|
39 | 40 |
class Command(NoArgsCommand): |
40 | 41 |
help = "Export Pithos services in JSON format." |
41 | 42 |
|
42 | 43 |
def handle(self, *args, **options): |
43 |
output = json.dumps(pithos_services, indent=4)
|
|
44 |
output = json.dumps(filter_public(pithos_services), indent=4)
|
|
44 | 45 |
self.stdout.write(output + "\n") |
b/snf-pithos-app/pithos/api/services.py | ||
---|---|---|
57 | 57 |
'type': 'pithos_ui', |
58 | 58 |
'component': 'pithos', |
59 | 59 |
'prefix': 'ui', |
60 |
'public': True,
|
|
60 |
'public': False,
|
|
61 | 61 |
'endpoints': [ |
62 | 62 |
{'versionId': '', |
63 | 63 |
'publicURL': None}, |
Also available in: Unified diff