From 9dcfe85e44300d9bf483453c07a0d31033c28427 Mon Sep 17 00:00:00 2001 From: Michal Jagiello Date: Tue, 13 Jun 2023 04:58:19 +0000 Subject: [SO] Fix typo in module name Change catalog_cb_adapter into catalog_db_adapter Issue-ID: INT-2226 Signed-off-by: Michal Jagiello Change-Id: I891f59fec3e8f42e698ee125db1ad393668fda7c --- src/onapsdk/so/catalog_cb_adapter.py | 52 ------------------------------------ src/onapsdk/so/catalog_db_adapter.py | 52 ++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 52 deletions(-) delete mode 100644 src/onapsdk/so/catalog_cb_adapter.py create mode 100644 src/onapsdk/so/catalog_db_adapter.py (limited to 'src/onapsdk') diff --git a/src/onapsdk/so/catalog_cb_adapter.py b/src/onapsdk/so/catalog_cb_adapter.py deleted file mode 100644 index f8c54e0..0000000 --- a/src/onapsdk/so/catalog_cb_adapter.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 2023 Deutsche Telekom AG -# -# 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. -"""SO ecomp module.""" -from abc import ABC -from typing import Any, Dict - -from onapsdk.configuration import settings -from onapsdk.onap_service import OnapService -from onapsdk.so.so_element import SoElement -from onapsdk.utils.headers_creator import headers_so_catelog_db_creator - - -class CatalogDbAdapter(SoElement, ABC): - """SO catalog db adapter service class.""" - - base_url = settings.SO_CATALOG_DB_ADAPTER_URL - headers = headers_so_catelog_db_creator(OnapService.headers) - - @classmethod - def get_service_info(cls, service_model_uuid: str) -> Dict[Any, Any]: - """Get Service VNF and VF details. - - Returns: - The response in a dict format - - """ - url = (f"{cls.base_url}/ecomp/mso/catalog/v2/serviceResources?" - f"serviceModelUuid={service_model_uuid}") - return cls.send_message_json("GET", "Get Service Details", url, headers=cls.headers) - - @classmethod - def get_service_vnf_info(cls, service_model_uuid: str) -> Dict[Any, Any]: - """Get Service VNF and VF details. - - Returns: - The response in a dict format - - """ - url = (f"{cls.base_url}/ecomp/mso/catalog/v2/serviceVnfs?" - f"serviceModelUuid={service_model_uuid}") - return cls.send_message_json("GET", "Get Service Details", url, headers=cls.headers) diff --git a/src/onapsdk/so/catalog_db_adapter.py b/src/onapsdk/so/catalog_db_adapter.py new file mode 100644 index 0000000..f8c54e0 --- /dev/null +++ b/src/onapsdk/so/catalog_db_adapter.py @@ -0,0 +1,52 @@ +# Copyright 2023 Deutsche Telekom AG +# +# 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. +"""SO ecomp module.""" +from abc import ABC +from typing import Any, Dict + +from onapsdk.configuration import settings +from onapsdk.onap_service import OnapService +from onapsdk.so.so_element import SoElement +from onapsdk.utils.headers_creator import headers_so_catelog_db_creator + + +class CatalogDbAdapter(SoElement, ABC): + """SO catalog db adapter service class.""" + + base_url = settings.SO_CATALOG_DB_ADAPTER_URL + headers = headers_so_catelog_db_creator(OnapService.headers) + + @classmethod + def get_service_info(cls, service_model_uuid: str) -> Dict[Any, Any]: + """Get Service VNF and VF details. + + Returns: + The response in a dict format + + """ + url = (f"{cls.base_url}/ecomp/mso/catalog/v2/serviceResources?" + f"serviceModelUuid={service_model_uuid}") + return cls.send_message_json("GET", "Get Service Details", url, headers=cls.headers) + + @classmethod + def get_service_vnf_info(cls, service_model_uuid: str) -> Dict[Any, Any]: + """Get Service VNF and VF details. + + Returns: + The response in a dict format + + """ + url = (f"{cls.base_url}/ecomp/mso/catalog/v2/serviceVnfs?" + f"serviceModelUuid={service_model_uuid}") + return cls.send_message_json("GET", "Get Service Details", url, headers=cls.headers) -- cgit 1.2.3-korg