X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=o2ims%2Fviews%2Fapi_ns.py;h=0ee29c449f0a04e3ca6314ebd9681dcf5285e0b1;hb=refs%2Fchanges%2F30%2F9430%2F3;hp=955a5981934079f6e5969f4f60a04d3fa92e8bc7;hpb=6c304dfab28ffd1bbe69b9ada3d11e8fbbde014b;p=pti%2Fo2.git diff --git a/o2ims/views/api_ns.py b/o2ims/views/api_ns.py index 955a598..0ee29c4 100644 --- a/o2ims/views/api_ns.py +++ b/o2ims/views/api_ns.py @@ -1,10 +1,57 @@ -from flask_restx import Namespace - - -api_ims_inventory_v1 = Namespace( - "O2IMS_Inventory", - description='IMS Inventory related operations.') - -api_provision_v1 = Namespace( - "PROVISION", - description='Provision related operations.') +# Copyright (C) 2021-2022 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. + +from flask import request +from flask_restx import Resource + +from o2common.views.route import O2Namespace + + +api_ims_inventory = O2Namespace( + "O2IMS_Inventory", + description='IMS Inventory related operations.') + +api_provision_v1 = O2Namespace( + "PROVISION", + description='Provision related operations.') + +api_ims_monitoring = O2Namespace( + "O2IMS_InfrastructureMonitoring", + description='O2 IMS Monitoring related operations.') + + +@api_ims_inventory.route('/api_versions') +class InventoryVersion(Resource): + def get(self): + return { + 'uriPrefix': request.base_url.rsplit('/', 1)[0], + 'apiVersions': [{ + 'version': '1.0.0', + # 'isDeprecated': 'False', + # 'retirementDate': '' + }] + } + + +@api_ims_monitoring.route('/api_versions') +class MonitoringVersion(Resource): + def get(self): + return { + 'uriPrefix': request.base_url.rsplit('/', 1)[0], + 'apiVersions': [{ + 'version': '1.0.0', + # 'isDeprecated': 'False', + # 'retirementDate': '' + }] + }