0ee29c449f0a04e3ca6314ebd9681dcf5285e0b1
[pti/o2.git] / o2ims / views / api_ns.py
1 # Copyright (C) 2021-2022 Wind River Systems, Inc.
2 #
3 #  Licensed under the Apache License, Version 2.0 (the "License");
4 #  you may not use this file except in compliance with the License.
5 #  You may obtain a copy of the License at
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #  Unless required by applicable law or agreed to in writing, software
10 #  distributed under the License is distributed on an "AS IS" BASIS,
11 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #  See the License for the specific language governing permissions and
13 #  limitations under the License.
14
15 from flask import request
16 from flask_restx import Resource
17
18 from o2common.views.route import O2Namespace
19
20
21 api_ims_inventory = O2Namespace(
22     "O2IMS_Inventory",
23     description='IMS Inventory related operations.')
24
25 api_provision_v1 = O2Namespace(
26     "PROVISION",
27     description='Provision related operations.')
28
29 api_ims_monitoring = O2Namespace(
30     "O2IMS_InfrastructureMonitoring",
31     description='O2 IMS Monitoring related operations.')
32
33
34 @api_ims_inventory.route('/api_versions')
35 class InventoryVersion(Resource):
36     def get(self):
37         return {
38             'uriPrefix': request.base_url.rsplit('/', 1)[0],
39             'apiVersions': [{
40                 'version': '1.0.0',
41                 # 'isDeprecated': 'False',
42                 # 'retirementDate': ''
43             }]
44         }
45
46
47 @api_ims_monitoring.route('/api_versions')
48 class MonitoringVersion(Resource):
49     def get(self):
50         return {
51             'uriPrefix': request.base_url.rsplit('/', 1)[0],
52             'apiVersions': [{
53                 'version': '1.0.0',
54                 # 'isDeprecated': 'False',
55                 # 'retirementDate': ''
56             }]
57         }