summaryrefslogtreecommitdiffstats
path: root/ocata/ocata/extensions
diff options
context:
space:
mode:
authorBin Yang <bin.yang@windriver.com>2017-09-13 17:57:00 +0800
committerBin Yang <bin.yang@windriver.com>2017-09-13 17:57:00 +0800
commit51f18c6e84a88eaea53237b3a21d32ad4ab0e8a5 (patch)
treeaed163e17ddfde30bb46e9aafa857550b07d1f05 /ocata/ocata/extensions
parent530818aab2a02921e0445b6062260aad9e4b2810 (diff)
Refactor newton and ocato proxy
refactor code and fix bugs to update proxy prefix Change-Id: I4a02b0570759f087581e875cc683d4475bd2121b Issue-Id: MULTICLOUD-89 Signed-off-by: Bin Yang <bin.yang@windriver.com>
Diffstat (limited to 'ocata/ocata/extensions')
-rw-r--r--ocata/ocata/extensions/urls.py4
-rw-r--r--ocata/ocata/extensions/views/__init__.py10
-rw-r--r--ocata/ocata/extensions/views/epacaps.py32
-rw-r--r--ocata/ocata/extensions/views/extensions.py28
4 files changed, 72 insertions, 2 deletions
diff --git a/ocata/ocata/extensions/urls.py b/ocata/ocata/extensions/urls.py
index e87a02eb..4dc46983 100644
--- a/ocata/ocata/extensions/urls.py
+++ b/ocata/ocata/extensions/urls.py
@@ -15,8 +15,8 @@
from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
-from newton.extensions.views import extensions
-from newton.extensions.views import epacaps
+from ocata.extensions.views import extensions
+from ocata.extensions.views import epacaps
urlpatterns = [
url(r'^sions$', extensions.Extensions.as_view()),
diff --git a/ocata/ocata/extensions/views/__init__.py b/ocata/ocata/extensions/views/__init__.py
new file mode 100644
index 00000000..802f3fba
--- /dev/null
+++ b/ocata/ocata/extensions/views/__init__.py
@@ -0,0 +1,10 @@
+# Copyright (c) 2017 Wind River Systems, Inc.
+#
+# 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.
diff --git a/ocata/ocata/extensions/views/epacaps.py b/ocata/ocata/extensions/views/epacaps.py
new file mode 100644
index 00000000..72942064
--- /dev/null
+++ b/ocata/ocata/extensions/views/epacaps.py
@@ -0,0 +1,32 @@
+# Copyright (c) 2017 Wind River Systems, Inc.
+#
+# 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.
+import logging
+import json
+import traceback
+
+from ocata.pub.config import config
+
+
+from newton.extensions.views import epacaps as newton_epacaps
+
+logger = logging.getLogger(__name__)
+
+DEBUG=True
+
+
+class EpaCaps(newton_epacaps.EpaCaps):
+
+ def __init__(self):
+ self.proxy_prefix = config.MULTICLOUD_PREFIX
+ self._logger = logger
diff --git a/ocata/ocata/extensions/views/extensions.py b/ocata/ocata/extensions/views/extensions.py
new file mode 100644
index 00000000..beb02fde
--- /dev/null
+++ b/ocata/ocata/extensions/views/extensions.py
@@ -0,0 +1,28 @@
+# Copyright (c) 2017 Wind River Systems, Inc.
+#
+# 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.
+import logging
+
+from ocata.pub.config import config
+from newton.extensions.views import extensions as newton_extensions
+
+logger = logging.getLogger(__name__)
+
+DEBUG=True
+
+class Extensions(newton_extensions.Extensions):
+
+ def __init__(self):
+ self._logger = logger
+ self.proxy_prefix = config.MULTICLOUD_PREFIX
+