Remove EPA attribute 79/58079/2
authorDileep Ranganathan <dileep.ranganathan@intel.com>
Thu, 26 Jul 2018 23:35:13 +0000 (16:35 -0700)
committerDileep Ranganathan <dileep.ranganathan@intel.com>
Mon, 30 Jul 2018 13:31:55 +0000 (06:31 -0700)
Remove EPA property from multicloud as it is repaced by HPA attributes.

Change-Id: I96e2ebcc60ac55cb0f0559607de919da410f66b1
Issue-ID: AAI-1150
Signed-off-by: Dileep Ranganathan <dileep.ranganathan@intel.com>
35 files changed:
newton/newton/extensions/tests/test_epacaps.py [deleted file]
newton/newton/extensions/tests/test_extensions.py
newton/newton/extensions/urls.py
newton/newton/extensions/views/epacaps.py [deleted file]
ocata/ocata/extensions/tests/test_epacaps.py [deleted file]
ocata/ocata/extensions/tests/test_extensions.py
ocata/ocata/extensions/urls.py
ocata/ocata/extensions/views/epacaps.py [deleted file]
ocata/ocata/proxy/tests/test_identity_proxy.py
ocata/ocata/proxy/tests/test_service_proxy.py
ocata/ocata/vesagent/tests.py
ocata/ocata/vesagent/tests_tasks.py
ocata/vagrant/test/extsys.py
ocata/vagrant/test/test-extensions.sh
pike/pike/extensions/tests/test_epacaps.py [deleted file]
pike/pike/extensions/tests/test_extensions.py
pike/pike/extensions/urls.py
pike/pike/extensions/views/epacaps.py [deleted file]
pike/vagrant/test/extsys.py
pike/vagrant/test/test-extensions.sh
share/common/msapi/extsys.py
share/newton_base/extensions/epacaps.py [deleted file]
share/newton_base/extensions/extensions.py
share/newton_base/registration/registration.py
share/newton_base/tests/mock_info.py
windriver/titanium_cloud/extensions/tests/test_epacaps.py [deleted file]
windriver/titanium_cloud/extensions/tests/test_extensions.py
windriver/titanium_cloud/extensions/urls.py
windriver/titanium_cloud/extensions/views/epacaps.py [deleted file]
windriver/titanium_cloud/extensions/views/extensions.py
windriver/titanium_cloud/proxy/tests/test_identity_proxy.py
windriver/titanium_cloud/proxy/tests/test_service_proxy.py
windriver/titanium_cloud/registration/tests/test_registration2.py
windriver/titanium_cloud/vesagent/tests.py
windriver/titanium_cloud/vesagent/tests_tasks.py

diff --git a/newton/newton/extensions/tests/test_epacaps.py b/newton/newton/extensions/tests/test_epacaps.py
deleted file mode 100644 (file)
index 0588f77..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright (c) 2017 Intel Corporation.
-#
-# 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 json
-
-import mock
-from django.test import Client
-from rest_framework import status
-import unittest
-
-from newton_base.tests import test_base
-from newton_base.tests import mock_info
-from newton_base.util import VimDriverUtils
-
-
-class TestEpaCaps(unittest.TestCase):
-    def setUp(self):
-        self.client = Client()
-
-    @mock.patch.object(VimDriverUtils, 'get_vim_info')
-    def test_get_epa_caps_info(self, mock_get_vim_info):
-        mock_get_vim_info.return_value = mock_info.MOCK_VIM_INFO
-        cloud_owner = "windriver-hudson-dc"
-        cloud_region_id = "RegionOne"
-        vimid = cloud_owner + "_" + cloud_region_id
-
-        response = self.client.get(
-            "/api/%s/v0/%s/extensions/epa-caps" % (
-                test_base.MULTIVIM_VERSION,
-                vimid))
-        json_content = response.json()
-
-        self.assertEquals(status.HTTP_200_OK, response.status_code)
-        self.assertEquals(4, len(json_content.keys()))
-        self.assertEquals(cloud_owner, json_content["cloud-owner"])
-        self.assertEquals(cloud_region_id,
-                          json_content["cloud-region-id"])
-        self.assertEquals(vimid, json_content["vimid"])
-        self.assertEquals(
-            json.loads(mock_info.MOCK_VIM_INFO['cloud_epa_caps']),
-            json_content["cloud-epa-caps"])
index ebdb216..0a89c8b 100644 (file)
@@ -40,16 +40,3 @@ class TestExtensions(unittest.TestCase):
         self.assertEquals(cloud_region_id,
                           json_content["cloud-region-id"])
         self.assertEquals(vimid, json_content["vimid"])
-
-        self.assertEquals("epa-caps",
-                          json_content["extensions"][0]["alias"])
-        self.assertEquals("Multiple network support",
-                          json_content["extensions"][0][
-                              "description"])
-        self.assertEquals("EPACapsQuery",
-                          json_content["extensions"][0]["name"])
-        self.assertEquals(
-            "http://127.0.0.1:80/api/%s/v0/%s/extensions/epa-caps" % (
-                test_base.MULTIVIM_VERSION, vimid),
-            json_content["extensions"][0]["url"])
-        self.assertEquals("", json_content["extensions"][0]["spec"])
index ad61e1d..41bac1b 100644 (file)
@@ -16,11 +16,9 @@ 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
 
 urlpatterns = [
     url(r'^sions/?$', extensions.Extensions.as_view()),
-    url(r'^sions/epa-caps/?$', epacaps.EpaCaps.as_view()),
 ]
 
 urlpatterns = format_suffix_patterns(urlpatterns)
diff --git a/newton/newton/extensions/views/epacaps.py b/newton/newton/extensions/views/epacaps.py
deleted file mode 100644 (file)
index 025d55d..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (c) 2017-2018 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 django.conf import settings
-
-
-from newton_base.extensions import epacaps as newton_epacaps
-
-logger = logging.getLogger(__name__)
-
-# DEBUG=True
-
-
-class EpaCaps(newton_epacaps.EpaCaps):
-
-    def __init__(self):
-        self.proxy_prefix = settings.MULTICLOUD_PREFIX
-        self._logger = logger
diff --git a/ocata/ocata/extensions/tests/test_epacaps.py b/ocata/ocata/extensions/tests/test_epacaps.py
deleted file mode 100644 (file)
index 8120ba2..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright (c) 2017-2018 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 json
-
-import mock
-from django.test import Client
-from rest_framework import status
-import unittest
-
-from newton_base.util import VimDriverUtils
-
-MOCK_VIM_INFO = {
-    "createTime": "2017-04-01 02:22:27",
-    "domain": "Default",
-    "name": "TiS_R4",
-    "password": "admin",
-    "tenant": "admin",
-    "type": "openstack",
-    "url": "http://128.224.180.14:5000/v3",
-    "userName": "admin",
-    "vendor": "WindRiver",
-    "version": "ocata",
-    "vimId": "windriver-hudson-dc_RegionOne",
-    'cloud_owner':'windriver-hudson-dc',
-    'cloud_region_id':'RegionOne',
-    'cloud_extra_info':'',
-    'cloud_epa_caps':'{"huge_page":"true","cpu_pinning":"true",\
-        "cpu_thread_policy":"true","numa_aware":"true","sriov":"true",\
-        "dpdk_vswitch":"true","rdt":"false","numa_locality_pci":"true"}',
-    'insecure':'True',
-}
-
-
-class TestEpaCaps(unittest.TestCase):
-    def setUp(self):
-        self.client = Client()
-
-    @mock.patch.object(VimDriverUtils, 'get_vim_info')
-    def test_get_epa_caps_info(self, mock_get_vim_info):
-        mock_get_vim_info.return_value = MOCK_VIM_INFO
-        cloud_owner = "windriver-hudson-dc"
-        cloud_region_id = "RegionOne"
-        vimid = cloud_owner + "_" + cloud_region_id
-
-        response = self.client.get(
-            "/api/multicloud-ocata/v0/" + vimid + "/extensions/epa-caps")
-        json_content = response.json()
-
-        self.assertEquals(status.HTTP_200_OK, response.status_code)
-        self.assertEquals(4, len(json_content.keys()))
-        self.assertEquals(cloud_owner, json_content["cloud-owner"])
-        self.assertEquals(cloud_region_id, json_content["cloud-region-id"])
-        self.assertEquals(vimid, json_content["vimid"])
-        self.assertEquals(json.loads(MOCK_VIM_INFO['cloud_epa_caps']),
-                          json_content["cloud-epa-caps"])
index 762f001..2f584de 100644 (file)
@@ -36,10 +36,3 @@ class TestExtensions(unittest.TestCase):
         self.assertEquals(cloud_owner, json_content["cloud-owner"])
         self.assertEquals(cloud_region_id, json_content["cloud-region-id"])
         self.assertEquals(vimid, json_content["vimid"])
-
-        self.assertEquals("epa-caps", json_content["extensions"][0]["alias"])
-        self.assertEquals("Multiple network support", json_content["extensions"][0]["description"])
-        self.assertEquals("EPACapsQuery", json_content["extensions"][0]["name"])
-        self.assertEquals("http://127.0.0.1:80/api/multicloud-ocata/v0/%s/extensions/epa-caps" % vimid,
-                          json_content["extensions"][0]["url"])
-        self.assertEquals("", json_content["extensions"][0]["spec"])
index 0e364e0..9cb3b69 100644 (file)
@@ -16,11 +16,9 @@ from django.conf.urls import url
 from rest_framework.urlpatterns import format_suffix_patterns
 
 from ocata.extensions.views import extensions
-from ocata.extensions.views import epacaps
 
 urlpatterns = [
     url(r'^sions/?$', extensions.Extensions.as_view()),
-    url(r'^sions/epa-caps/?$', epacaps.EpaCaps.as_view()),
 ]
 
 urlpatterns = format_suffix_patterns(urlpatterns)
diff --git a/ocata/ocata/extensions/views/epacaps.py b/ocata/ocata/extensions/views/epacaps.py
deleted file mode 100644 (file)
index 025d55d..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (c) 2017-2018 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 django.conf import settings
-
-
-from newton_base.extensions import epacaps as newton_epacaps
-
-logger = logging.getLogger(__name__)
-
-# DEBUG=True
-
-
-class EpaCaps(newton_epacaps.EpaCaps):
-
-    def __init__(self):
-        self.proxy_prefix = settings.MULTICLOUD_PREFIX
-        self._logger = logger
index 185fe17..0c844c7 100644 (file)
@@ -42,9 +42,6 @@ mock_viminfo = {
     'cloud_owner':'windriver-hudson-dc',
     'cloud_region_id':'RegionOne',
     'cloud_extra_info':'',
-    'cloud_epa_caps':'{"huge_page":"true","cpu_pinning":"true",\
-        "cpu_thread_policy":"true","numa_aware":"true","sriov":"true",\
-        "dpdk_vswitch":"true","rdt":"false","numa_locality_pci":"true"}',
     'insecure':'True',
 }
 
index 3b784be..83fe524 100644 (file)
@@ -38,9 +38,6 @@ MOCK_VIM_INFO = {
     'cloud_owner':'windriver-hudson-dc',
     'cloud_region_id':'RegionOne',
     'cloud_extra_info':'',
-    'cloud_epa_caps':'{"huge_page":"true","cpu_pinning":"true",\
-        "cpu_thread_policy":"true","numa_aware":"true","sriov":"true",\
-        "dpdk_vswitch":"true","rdt":"false","numa_locality_pci":"true"}',
     'insecure':'True',
 }
 
index b170e02..9f34b3f 100644 (file)
@@ -39,7 +39,6 @@ MOCK_VIM_INFO = {
     'cloud_owner': 'windriver-hudson-dc',
     'cloud_region_id': 'RegionOne',
     'cloud_extra_info': '{"vesagent_config":{"backlogs":[{"source":"onap-aaf","domain":"fault","type":"vm","tenant":"VIM"}],"poll_interval_default":10,"ves_subscription":{"username":"user","password":"password","endpoint":"http://127.0.0.1:9005/sample"}}}',
-    'cloud_epa_caps': '',
     'insecure': 'True',
 }
 
index bd47133..45fbea1 100644 (file)
@@ -42,7 +42,6 @@ MOCK_VIM_INFO = {
     'cloud_owner': 'windriver-hudson-dc',
     'cloud_region_id': 'RegionOne',
     'cloud_extra_info': '{"vesagent_config":{"backlogs":[{"source":"onap-aaf","domain":"fault","type":"vm","tenant":"VIM"}],"poll_interval_default":10,"ves_subscription":{"username":"user","password":"password","endpoint":"http://127.0.0.1:9005/sample"}}}',
-    'cloud_epa_caps': '',
     'insecure': 'True',
 }
 
index 5de8815..db6088e 100644 (file)
@@ -38,9 +38,6 @@ tisr4 = {
     'cloud_owner':'openstack-hudson-dc',
     'cloud_region_id':'RegionOne',
     'cloud_extra_info':'',
-    'cloud_epa_caps':'{"huge_page":"true","cpu_pinning":"true",\
-        "cpu_thread_policy":"true","numa_aware":"true","sriov":"true",\
-        "dpdk_vswitch":"true","rdt":"false","numa_locality_pci":"true"}',
     'insecure':'True',
 }
 
@@ -104,7 +101,6 @@ def get_vim_by_id(vim_id):
             viminfo['name'] = tmp_viminfo['complex-name']
             viminfo['version'] = tmp_viminfo['cloud-region-version']
             viminfo['cloud_extra_info'] = tmp_viminfo['cloud-extra-info']
-            viminfo['cloud_epa_caps'] = tmp_viminfo['cloud-epa-caps']
 
             if tmp_authinfo:
                 viminfo['userName'] = tmp_authinfo['user-name']
index 65fc0d1..305a5a3 100644 (file)
@@ -3,4 +3,3 @@ set -ex
 
 MULTICLOUD_PLUGIN_ENDPOINT=http://172.16.77.40:9006/api/multicloud-ocata/v0/openstack-hudson-dc_RegionOne
 curl -v -s  -H "Content-Type: application/json" -X GET $MULTICLOUD_PLUGIN_ENDPOINT/extensions
-curl -v -s  -H "Content-Type: application/json" -X GET $MULTICLOUD_PLUGIN_ENDPOINT/extensions/epa-caps
diff --git a/pike/pike/extensions/tests/test_epacaps.py b/pike/pike/extensions/tests/test_epacaps.py
deleted file mode 100644 (file)
index 40f8d3a..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright (c) 2017-2018 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 json
-
-import mock
-from django.test import Client
-from rest_framework import status
-import unittest
-
-from newton_base.util import VimDriverUtils
-
-MOCK_VIM_INFO = {
-    "createTime": "2017-04-01 02:22:27",
-    "domain": "Default",
-    "name": "TiS_R4",
-    "password": "admin",
-    "tenant": "admin",
-    "type": "openstack",
-    "url": "http://128.224.180.14:5000/v3",
-    "userName": "admin",
-    "vendor": "WindRiver",
-    "version": "pike",
-    "vimId": "windriver-hudson-dc_RegionOne",
-    'cloud_owner':'windriver-hudson-dc',
-    'cloud_region_id':'RegionOne',
-    'cloud_extra_info':'',
-    'cloud_epa_caps':'{"huge_page":"true","cpu_pinning":"true",\
-        "cpu_thread_policy":"true","numa_aware":"true","sriov":"true",\
-        "dpdk_vswitch":"true","rdt":"false","numa_locality_pci":"true"}',
-    'insecure':'True',
-}
-
-
-class TestEpaCaps(unittest.TestCase):
-    def setUp(self):
-        self.client = Client()
-
-    @mock.patch.object(VimDriverUtils, 'get_vim_info')
-    def test_get_epa_caps_info(self, mock_get_vim_info):
-        mock_get_vim_info.return_value = MOCK_VIM_INFO
-        cloud_owner = "windriver-hudson-dc"
-        cloud_region_id = "RegionOne"
-        vimid = cloud_owner + "_" + cloud_region_id
-
-        response = self.client.get(
-            "/api/multicloud-pike/v0/" + vimid + "/extensions/epa-caps")
-        json_content = response.json()
-
-        self.assertEquals(status.HTTP_200_OK, response.status_code)
-        self.assertEquals(4, len(json_content.keys()))
-        self.assertEquals(cloud_owner, json_content["cloud-owner"])
-        self.assertEquals(cloud_region_id, json_content["cloud-region-id"])
-        self.assertEquals(vimid, json_content["vimid"])
-        self.assertEquals(json.loads(MOCK_VIM_INFO['cloud_epa_caps']),
-                          json_content["cloud-epa-caps"])
index 3842d4b..0dd4595 100644 (file)
@@ -36,10 +36,3 @@ class TestExtensions(unittest.TestCase):
         self.assertEquals(cloud_owner, json_content["cloud-owner"])
         self.assertEquals(cloud_region_id, json_content["cloud-region-id"])
         self.assertEquals(vimid, json_content["vimid"])
-
-        self.assertEquals("epa-caps", json_content["extensions"][0]["alias"])
-        self.assertEquals("Multiple network support", json_content["extensions"][0]["description"])
-        self.assertEquals("EPACapsQuery", json_content["extensions"][0]["name"])
-        self.assertEquals("http://127.0.0.1:80/api/multicloud-pike/v0/%s/extensions/epa-caps" % vimid,
-                          json_content["extensions"][0]["url"])
-        self.assertEquals("", json_content["extensions"][0]["spec"])
index 545dec9..b8e977c 100644 (file)
@@ -16,11 +16,9 @@ from django.conf.urls import url
 from rest_framework.urlpatterns import format_suffix_patterns
 
 from pike.extensions.views import extensions
-from pike.extensions.views import epacaps
 
 urlpatterns = [
     url(r'^sions/?$', extensions.Extensions.as_view()),
-    url(r'^sions/epa-caps/?$', epacaps.EpaCaps.as_view()),
 ]
 
 urlpatterns = format_suffix_patterns(urlpatterns)
diff --git a/pike/pike/extensions/views/epacaps.py b/pike/pike/extensions/views/epacaps.py
deleted file mode 100644 (file)
index 025d55d..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (c) 2017-2018 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 django.conf import settings
-
-
-from newton_base.extensions import epacaps as newton_epacaps
-
-logger = logging.getLogger(__name__)
-
-# DEBUG=True
-
-
-class EpaCaps(newton_epacaps.EpaCaps):
-
-    def __init__(self):
-        self.proxy_prefix = settings.MULTICLOUD_PREFIX
-        self._logger = logger
index 78b4138..1d930b8 100644 (file)
@@ -38,9 +38,6 @@ tisr4 = {
     'cloud_owner':'openstack-hudson-dc',
     'cloud_region_id':'RegionOne',
     'cloud_extra_info':'',
-    'cloud_epa_caps':'{"huge_page":"true","cpu_pinning":"true",\
-        "cpu_thread_policy":"true","numa_aware":"true","sriov":"true",\
-        "dpdk_vswitch":"true","rdt":"false","numa_locality_pci":"true"}',
     'insecure':'True',
 }
 
@@ -104,7 +101,6 @@ def get_vim_by_id(vim_id):
             viminfo['name'] = tmp_viminfo['complex-name']
             viminfo['version'] = tmp_viminfo['cloud-region-version']
             viminfo['cloud_extra_info'] = tmp_viminfo['cloud-extra-info']
-            viminfo['cloud_epa_caps'] = tmp_viminfo['cloud-epa-caps']
 
             if tmp_authinfo:
                 viminfo['userName'] = tmp_authinfo['user-name']
index 82c254a..215c3fc 100644 (file)
@@ -3,4 +3,3 @@ set -ex
 
 MULTICLOUD_PLUGIN_ENDPOINT=http://172.16.77.40:9007/api/multicloud-pike/v0/openstack-hudson-dc_RegionOne
 curl -v -s  -H "Content-Type: application/json" -X GET $MULTICLOUD_PLUGIN_ENDPOINT/extensions
-curl -v -s  -H "Content-Type: application/json" -X GET $MULTICLOUD_PLUGIN_ENDPOINT/extensions/epa-caps
index 626a38f..772a526 100644 (file)
@@ -61,7 +61,6 @@ def get_vim_by_id(vim_id):
             viminfo['name'] = tmp_viminfo.get('complex-name')
             viminfo['version'] = tmp_viminfo.get('cloud-region-version')
             viminfo['cloud_extra_info'] = tmp_viminfo.get('cloud-extra-info')
-            viminfo['cloud_epa_caps'] = tmp_viminfo.get('cloud-epa-caps')
 
             viminfo['userName'] = tmp_authinfo['user-name']
             viminfo['password'] = tmp_authinfo['password']
diff --git a/share/newton_base/extensions/epacaps.py b/share/newton_base/extensions/epacaps.py
deleted file mode 100644 (file)
index cc5420e..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright (c) 2017-2018 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 keystoneauth1.exceptions import HttpError
-from rest_framework import status
-from rest_framework.response import Response
-from rest_framework.views import APIView
-
-from common.exceptions import VimDriverNewtonException
-from newton_base.util import VimDriverUtils
-from common.msapi import extsys
-
-logger = logging.getLogger(__name__)
-
-
-class EpaCaps(APIView):
-
-    def __init__(self):
-        self.proxy_prefix = "multicloud"
-        self._logger = logger
-
-    def get(self, request, vimid=""):
-        logger.debug("EpaCaps--get::data> %s" % request.data)
-        logger.debug("EpaCaps--get::vimid> %s"
-                     % vimid)
-        try:
-
-            vim = VimDriverUtils.get_vim_info(vimid)
-            caps_json = json.loads(vim['cloud_epa_caps'])
-
-            cloud_owner, cloud_region_id = extsys.decode_vim_id(vimid)
-            content = {
-                "cloud-owner":cloud_owner,
-                "cloud-region-id":cloud_region_id,
-                "vimid":vimid,
-                "cloud-epa-caps": caps_json,
-            }
-            return Response(data=content, status=status.HTTP_200_OK)
-        except VimDriverNewtonException as e:
-            return Response(data={'error': e.content}, status=e.status_code)
-        except HttpError as e:
-            logger.error("HttpError: status:%s, response:%s" % (e.http_status, e.response.json()))
-            return Response(data=e.response.json(), status=e.http_status)
-        except Exception as e:
-            logger.error(traceback.format_exc())
-            return Response(data={'error': str(e)},
-                            status=status.HTTP_500_INTERNAL_SERVER_ERROR)
index a08da3e..dd6ee55 100644 (file)
@@ -45,17 +45,7 @@ class Extensions(APIView):
                      % vimid)
         try:
             cloud_owner, cloud_region_id = extsys.decode_vim_id(vimid)
-            registered_extensions = \
-                [
-                    {
-                        "alias": "epa-caps",
-                        "description": "Multiple network support",
-                        "name": "EPACapsQuery",
-                        "url": self.proxy_prefix + "/%s/extensions/epa-caps" \
-                                       % (vimid),
-                        "spec": ""
-                    }
-                ]
+            registered_extensions = []
 
             content = {
                 "cloud-owner":cloud_owner,
index 4e536b8..c3aaec2 100644 (file)
@@ -537,72 +537,6 @@ class Registry(APIView):
             self._logger.error(traceback.format_exc())
             return
 
-    def _update_epa_caps(self, cloud_owner, cloud_region_id, epa_caps_info):
-        '''
-        populate cloud EPA Capabilities information into AAI
-        :param cloud_owner:
-        :param cloud_region_id:
-        :param epa_caps_info: dict of meta data about cloud-region's epa caps
-
-        :return:
-        '''
-
-        cloud_epa_caps = {
-            'cloud-epa-caps': json.dumps(epa_caps_info),
-        }
-
-        if cloud_owner and cloud_region_id:
-            resource_url = "/cloud-infrastructure/cloud-regions/cloud-region/%s/%s" \
-                           % (cloud_owner, cloud_region_id)
-
-            # get cloud-region
-            retcode, content, status_code = \
-                restcall.req_to_aai(resource_url, "GET")
-
-            #add resource-version to url
-            if retcode == 0 and content:
-                content = json.JSONDecoder().decode(content)
-                #cloud_epa_caps["resource-version"] = content["resource-version"]
-                content.update(cloud_epa_caps)
-                cloud_epa_caps = content
-
-            #update cloud-region
-            retcode, content, status_code = \
-                restcall.req_to_aai(resource_url, "PUT", content=cloud_epa_caps)
-
-            self._logger.debug(
-                "update_epa_caps,vimid:%s_%s req_to_aai: update cloud-epa-caps, return %s, %s, %s"
-                % (cloud_owner,cloud_region_id, retcode, content, status_code))
-
-            return retcode
-        return 1  # unknown cloud owner,region_id
-
-    def _discover_epa_resources(self, vimid="", viminfo=None):
-        try:
-            cloud_epa_caps_info = {}
-            cloud_extra_info_str = viminfo.get('cloud_extra_info')
-            if cloud_extra_info_str:
-                cloud_extra_info = json.loads(cloud_extra_info_str)
-                cloud_epa_caps_info.update(cloud_extra_info.get("epa-caps"))
-
-            cloud_owner, cloud_region_id = extsys.decode_vim_id(vimid)
-            ret = self._update_epa_caps(cloud_owner, cloud_region_id,
-                                        cloud_epa_caps_info)
-            if ret != 0:
-                # failed to update image
-                self._logger.debug("failed to populate EPA CAPs info into AAI: %s, ret:%s"
-                                   % (vimid, ret))
-
-        except VimDriverNewtonException as e:
-            self._logger.error("VimDriverNewtonException: status:%s, response:%s" % (e.http_status, e.content))
-            return
-        except HttpError as e:
-            self._logger.error("HttpError: status:%s, response:%s" % (e.http_status, e.response.json()))
-            return
-        except Exception as e:
-            self._logger.error(traceback.format_exc())
-            return
-
     def _update_proxy_identity_endpoint(self, vimid):
         '''
         update cloud_region's identity url
@@ -624,7 +558,6 @@ class Registry(APIView):
                 # add resource-version to url
                 if retcode == 0 and content:
                     viminfo = json.JSONDecoder().decode(content)
-                    # cloud_epa_caps["resource-version"] = content["resource-version"]
                     viminfo['identity-url'] = self.proxy_prefix + "/%s/identity/v2.0" % vimid
 
                     retcode, content, status_code = \
@@ -690,9 +623,6 @@ class Registry(APIView):
             # discover all pservers
             self._discover_pservers(vimid, sess, viminfo)
 
-            # discover all epa resources, e.g. sriov pf and vf, etc.
-            self._discover_epa_resources(vimid, viminfo)
-
             return Response(status=status.HTTP_202_ACCEPTED)
 
         except VimDriverNewtonException as e:
index 0c7556e..715708f 100644 (file)
@@ -29,17 +29,6 @@ MOCK_VIM_INFO = {
     'cloud_owner': 'windriver-hudson-dc',
     'cloud_region_id': 'RegionOne',
     'cloud_extra_info': '',
-    'cloud_epa_caps':
-        '{'
-        '"huge_page":"true",'
-        '"cpu_pinning":"true",'
-        '"cpu_thread_policy":"true",'
-        '"numa_aware":"true",'
-        '"sriov":"true",'
-        '"dpdk_vswitch":"true",'
-        '"rdt":"false",'
-        '"numa_locality_pci":"true"'
-        '}',
     'insecure': 'True',
 }
 
diff --git a/windriver/titanium_cloud/extensions/tests/test_epacaps.py b/windriver/titanium_cloud/extensions/tests/test_epacaps.py
deleted file mode 100644 (file)
index 6b938da..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright (c) 2017-2018 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 json
-
-import mock
-from django.test import Client
-from rest_framework import status
-import unittest
-
-from newton_base.util import VimDriverUtils
-
-MOCK_VIM_INFO = {
-    "createTime": "2017-04-01 02:22:27",
-    "domain": "Default",
-    "name": "TiS_R4",
-    "password": "admin",
-    "tenant": "admin",
-    "type": "openstack",
-    "url": "http://128.224.180.14:5000/v3",
-    "userName": "admin",
-    "vendor": "WindRiver",
-    "version": "titanium_cloud",
-    "vimId": "windriver-hudson-dc_RegionOne",
-    'cloud_owner':'windriver-hudson-dc',
-    'cloud_region_id':'RegionOne',
-    'cloud_extra_info':'',
-    'cloud_epa_caps':'{"huge_page":"true","cpu_pinning":"true",\
-        "cpu_thread_policy":"true","numa_aware":"true","sriov":"true",\
-        "dpdk_vswitch":"true","rdt":"false","numa_locality_pci":"true"}',
-    'insecure':'True',
-}
-
-
-class TestEpaCaps(unittest.TestCase):
-    def setUp(self):
-        self.client = Client()
-
-    @mock.patch.object(VimDriverUtils, 'get_vim_info')
-    def test_get_epa_caps_info(self, mock_get_vim_info):
-        mock_get_vim_info.return_value = MOCK_VIM_INFO
-        cloud_owner = "windriver-hudson-dc"
-        cloud_region_id = "RegionOne"
-        vimid = cloud_owner + "_" + cloud_region_id
-
-        response = self.client.get(
-            "/api/multicloud-titanium_cloud/v0/" + vimid + "/extensions/epa-caps")
-        json_content = response.json()
-
-        self.assertEquals(status.HTTP_200_OK, response.status_code)
-        self.assertEquals(4, len(json_content.keys()))
-        self.assertEquals(cloud_owner, json_content["cloud-owner"])
-        self.assertEquals(cloud_region_id, json_content["cloud-region-id"])
-        self.assertEquals(vimid, json_content["vimid"])
-        self.assertEquals(json.loads(MOCK_VIM_INFO['cloud_epa_caps']),
-                          json_content["cloud-epa-caps"])
index f0dae16..1ab792b 100644 (file)
@@ -37,9 +37,5 @@ class TestExtensions(unittest.TestCase):
         self.assertEquals(cloud_region_id, json_content["cloud-region-id"])
         self.assertEquals(vimid, json_content["vimid"])
 
-        self.assertEquals("epa-caps", json_content["extensions"][0]["alias"])
         self.assertEquals("Multiple network support", json_content["extensions"][0]["description"])
-        self.assertEquals("EPACapsQuery", json_content["extensions"][0]["name"])
-        self.assertEquals("http://127.0.0.1:80/api/multicloud-titanium_cloud/v0/%s/extensions/epa-caps" % vimid,
-                          json_content["extensions"][0]["url"])
         self.assertEquals("", json_content["extensions"][0]["spec"])
index 891faeb..3bcf9a4 100644 (file)
@@ -16,11 +16,9 @@ from django.conf.urls import url
 from rest_framework.urlpatterns import format_suffix_patterns
 
 from titanium_cloud.extensions.views import extensions
-from titanium_cloud.extensions.views import epacaps
 
 urlpatterns = [
     url(r'^sions/?$', extensions.Extensions.as_view()),
-    url(r'^sions/epa-caps/?$', epacaps.EpaCaps.as_view()),
 ]
 
 urlpatterns = format_suffix_patterns(urlpatterns)
diff --git a/windriver/titanium_cloud/extensions/views/epacaps.py b/windriver/titanium_cloud/extensions/views/epacaps.py
deleted file mode 100644 (file)
index 025d55d..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (c) 2017-2018 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 django.conf import settings
-
-
-from newton_base.extensions import epacaps as newton_epacaps
-
-logger = logging.getLogger(__name__)
-
-# DEBUG=True
-
-
-class EpaCaps(newton_epacaps.EpaCaps):
-
-    def __init__(self):
-        self.proxy_prefix = settings.MULTICLOUD_PREFIX
-        self._logger = logger
index 2cd91bf..cfdc251 100644 (file)
@@ -44,13 +44,6 @@ class Extensions(newton_extensions.Extensions):
             cloud_owner, cloud_region_id = extsys.decode_vim_id(vimid)
             registered_extensions = \
                 [
-                    {
-                        "alias": "epa-caps",
-                        "description": "Multiple network support",
-                        "name": "EPACapsQuery",
-                        "url": self.proxy_prefix + "/%s/extensions/epa-caps" % (vimid),
-                        "spec": ""
-                    },
                     {
                         "alias": "guest-monitor",
                         "description": "Multiple network support",
index 8123122..a3b84f9 100644 (file)
@@ -42,9 +42,6 @@ mock_viminfo = {
     'cloud_owner':'windriver-hudson-dc',
     'cloud_region_id':'RegionOne',
     'cloud_extra_info':'',
-    'cloud_epa_caps':'{"huge_page":"true","cpu_pinning":"true",\
-        "cpu_thread_policy":"true","numa_aware":"true","sriov":"true",\
-        "dpdk_vswitch":"true","rdt":"false","numa_locality_pci":"true"}',
     'insecure':'True',
 }
 
index f9a9af4..7a838bc 100644 (file)
@@ -38,9 +38,6 @@ MOCK_VIM_INFO = {
     'cloud_owner':'windriver-hudson-dc',
     'cloud_region_id':'RegionOne',
     'cloud_extra_info':'',
-    'cloud_epa_caps':'{"huge_page":"true","cpu_pinning":"true",\
-        "cpu_thread_policy":"true","numa_aware":"true","sriov":"true",\
-        "dpdk_vswitch":"true","rdt":"false","numa_locality_pci":"true"}',
     'insecure':'True',
 }
 
index b15beb2..a9c034a 100644 (file)
@@ -46,17 +46,6 @@ MOCK_VIM_INFO = {
     'cloud_owner': 'windriver-hudson-dc',
     'cloud_region_id': 'RegionOne',
     'cloud_extra_info': '',
-    'cloud_epa_caps':
-        '{'
-        '"huge_page":"true",'
-        '"cpu_pinning":"true",'
-        '"cpu_thread_policy":"true",'
-        '"numa_aware":"true",'
-        '"sriov":"true",'
-        '"dpdk_vswitch":"true",'
-        '"rdt":"false",'
-        '"numa_locality_pci":"true"'
-        '}',
     'insecure': 'True',
 }
 
index a98177b..42d7695 100644 (file)
@@ -41,7 +41,6 @@ MOCK_VIM_INFO = {
     'cloud_owner': 'windriver-hudson-dc',
     'cloud_region_id': 'RegionOne',
     'cloud_extra_info': '{"vesagent_config":{"backlogs":[{"source":"onap-aaf","domain":"fault","type":"vm","tenant":"VIM"}],"poll_interval_default":10,"ves_subscription":{"username":"user","password":"password","endpoint":"http://127.0.0.1:9005/sample"}}}',
-    'cloud_epa_caps': '',
     'insecure': 'True',
 }
 
index 541a565..fef8e8e 100644 (file)
@@ -42,7 +42,6 @@ MOCK_VIM_INFO = {
     'cloud_owner': 'windriver-hudson-dc',
     'cloud_region_id': 'RegionOne',
     'cloud_extra_info': '{"vesagent_config":{"backlogs":[{"source":"onap-aaf","domain":"fault","type":"vm","tenant":"VIM"}],"poll_interval_default":10,"ves_subscription":{"username":"user","password":"password","endpoint":"http://127.0.0.1:9005/sample"}}}',
-    'cloud_epa_caps': '',
     'insecure': 'True',
 }