from synnefo.cyclades_settings import ( BASE_PATH, COMPUTE_PREFIX, NETWORK_PREFIX, VMAPI_PREFIX, PLANKTON_PREFIX, HELPDESK_PREFIX, UI_PREFIX, VOLUME_PREFIX, USERDATA_PREFIX, ADMIN_PREFIX, ASTAKOS_AUTH_PROXY_PATH, ASTAKOS_AUTH_URL, ASTAKOS_ACCOUNT_PROXY_PATH, ASTAKOS_ACCOUNT_URL, ASTAKOS_UI_PROXY_PATH, ASTAKOS_UI_URL, cyclades_services) from functools import partial urlpatterns = [] # Redirects should be first, otherwise they may get overridden by wildcards extend_endpoint_with_slash(urlpatterns, cyclades_services, 'cyclades_ui') extend_endpoint_with_slash(urlpatterns, cyclades_services, 'cyclades_helpdesk') extend_endpoint_with_slash(urlpatterns, cyclades_services, 'admin') extend_endpoint_with_slash(urlpatterns, cyclades_services, 'cyclades_userdata') cyclades_patterns = api_patterns( '', (prefix_pattern(VMAPI_PREFIX), include('synnefo.vmapi.urls')), (prefix_pattern(PLANKTON_PREFIX), include('synnefo.plankton.urls')), (prefix_pattern(COMPUTE_PREFIX), include('synnefo.api.compute_urls')), (prefix_pattern(NETWORK_PREFIX), include('synnefo.api.network_urls')), (prefix_pattern(USERDATA_PREFIX), include('synnefo.userdata.urls')), (prefix_pattern(ADMIN_PREFIX), include('synnefo.admin.urls')), (prefix_pattern(VOLUME_PREFIX), include('synnefo.volume.urls')), )
from django.conf.urls import include, patterns except ImportError: # Django==1.2 from django.conf.urls.defaults import include, patterns from synnefo.lib import join_urls from astakos.im.settings import ( BASE_PATH, ACCOUNTS_PREFIX, VIEWS_PREFIX, KEYSTONE_PREFIX, WEBLOGIN_PREFIX) from snf_django.lib.api.utils import prefix_pattern from snf_django.utils.urls import \ extend_with_root_redirects, extend_endpoint_with_slash from astakos.im.settings import astakos_services urlpatterns = [] # Redirects should be first, otherwise they may get overridden by wildcards extend_endpoint_with_slash(urlpatterns, astakos_services, 'astakos_ui') extend_endpoint_with_slash(urlpatterns, astakos_services, 'astakos_weblogin') astakos_patterns = patterns( '', (prefix_pattern(VIEWS_PREFIX), include('astakos.im.urls')), (prefix_pattern(ACCOUNTS_PREFIX), include('astakos.api.urls')), (prefix_pattern(KEYSTONE_PREFIX), include('astakos.api.keystone_urls')), (prefix_pattern(WEBLOGIN_PREFIX), include('astakos.im.weblogin_urls')), ) urlpatterns += patterns( '', (prefix_pattern(BASE_PATH), include(astakos_patterns)), )
from snf_django.lib.api.proxy import proxy from snf_django.lib.api.utils import prefix_pattern from snf_django.lib.api.urls import api_patterns from snf_django.lib.api import api_endpoint_not_found from snf_django.utils.urls import extend_endpoint_with_slash from pithos.api.settings import ( BASE_PATH, PITHOS_PREFIX, PUBLIC_PREFIX, VIEW_PREFIX, ASTAKOS_AUTH_PROXY_PATH, ASTAKOS_AUTH_URL, ASTAKOS_ACCOUNT_PROXY_PATH, ASTAKOS_ACCOUNT_URL, ASTAKOS_UI_PROXY_PATH, ASTAKOS_UI_URL, pithos_services) urlpatterns = [] # Redirects should be first, otherwise they may get overridden by wildcards extend_endpoint_with_slash(urlpatterns, pithos_services, "pithos_ui") extend_endpoint_with_slash(urlpatterns, pithos_services, "pithos_public") # TODO: This only works when in this order. pithos_api_patterns = api_patterns( 'pithos.api.functions', (r'^$', 'top_demux'), (r'^(?P<v_account>.+?)/(?P<v_container>.+?)/(?P<v_object>.+?)$', 'object_demux'), (r'^(?P<v_account>.+?)/(?P<v_container>.+?)/?$', 'container_demux'), (r'^(?P<v_account>.+?)/?$', 'account_demux')) pithos_view_patterns = patterns( 'pithos.api.views', (r'^(?P<v_account>.+?)/(?P<v_container>.+?)/(?P<v_object>.+?)$',
# interpreted as representing official policies, either expressed # or implied, of GRNET S.A. from django.conf.urls import include, patterns from astakos.im.settings import BASE_PATH, ACCOUNTS_PREFIX, \ VIEWS_PREFIX, KEYSTONE_PREFIX, WEBLOGIN_PREFIX, ADMIN_PREFIX from snf_django.lib.api.utils import prefix_pattern from snf_django.utils.urls import \ extend_with_root_redirects, extend_endpoint_with_slash from astakos.im.settings import astakos_services urlpatterns = [] # Redirects should be first, otherwise they may get overridden by wildcards extend_endpoint_with_slash(urlpatterns, astakos_services, 'astakos_ui') extend_endpoint_with_slash(urlpatterns, astakos_services, 'astakos_weblogin') astakos_patterns = patterns( '', (prefix_pattern(VIEWS_PREFIX), include('astakos.im.urls')), (prefix_pattern(ACCOUNTS_PREFIX), include('astakos.api.urls')), (prefix_pattern(KEYSTONE_PREFIX), include('astakos.api.keystone_urls')), (prefix_pattern(WEBLOGIN_PREFIX), include('astakos.im.weblogin_urls')), (prefix_pattern(ADMIN_PREFIX), include('astakos.admin.admin_urls')), ('', include('astakos.oa2.urls')), ) urlpatterns += patterns( '', (prefix_pattern(BASE_PATH), include(astakos_patterns)),