from o2app import bootstrap
from o2ims.views import configure_namespace as ims_route_configure_namespace
-from o2dms.api import configure_namespace as dms_route_configure_namespace
from o2ims.adapter.clients.alarm_dict_client import load_alarm_definition
from o2common.authmw import authmiddleware
raise Exception('Get k8s token review url failed')
+FLASK_API_VERSION = '1.0.0'
+
if auth:
# perform service account identity&privilege check.
_get_k8s_url()
app.config.SWAGGER_UI_DOC_EXPANSION = 'list'
# app.config['RESTX_MASK_HEADER'] = 'fields'
app.config['RESTX_MASK_SWAGGER'] = False
-api = Api(app, version='1.0.0',
+api = Api(app, version=FLASK_API_VERSION,
title='INF O2 Services API',
description='Swagger OpenAPI document for the INF O2 Services',
)
bus = bootstrap.bootstrap()
ims_route_configure_namespace(api)
-dms_route_configure_namespace(api)
load_alarm_definition(bus.uow)
apimonitoring = config.get_o2ims_monitoring_api_base()
logger.info(
"Expose the O2 IMS API:{}\n \
- \nExpose Monitoring API: {}".
+ Expose Monitoring API: {}".
format(apiims, apimonitoring))
ocloud_route.configure_api_route()
return {
'uriPrefix': request.base_url.rsplit('/', 1)[0],
'apiVersions': [{
- 'version': '1',
+ 'version': '1.0.0',
# 'isDeprecated': 'False',
# 'retirementDate': ''
}]
from flask import request
from flask_restx import Resource
+
from o2common.views.route import O2Namespace
@api_ims_inventory.route('/api_versions')
class InventoryVersion(Resource):
- def get():
+ def get(self):
return {
'uriPrefix': request.base_url.rsplit('/', 1)[0],
'apiVersions': [{
- 'version': '1',
+ 'version': '1.0.0',
# 'isDeprecated': 'False',
# 'retirementDate': ''
}]
@api_ims_monitoring.route('/api_versions')
class MonitoringVersion(Resource):
- def get():
+ def get(self):
return {
'uriPrefix': request.base_url.rsplit('/', 1)[0],
'apiVersions': [{
- 'version': '1',
+ 'version': '1.0.0',
# 'isDeprecated': 'False',
# 'retirementDate': ''
}]
description='Deployment manager ID'),
'name': fields.String,
'description': fields.String,
+ 'oCloudId': fields.String,
'serviceUri': fields.String(attribute='serviceUri'),
# 'deploymentManagementServiceEndpoint': fields.String(
# attribute='serviceUri'),
description='Deployment manager ID'),
'name': fields.String,
'description': fields.String,
+ 'oCloudId': fields.String,
'serviceUri': fields.String(attribute='serviceUri'),
# 'deploymentManagementServiceEndpoint': fields.String(
# attribute='serviceUri'),
return {
'uriPrefix': request.base_url.rsplit('/', 1)[0],
'apiVersions': [{
- 'version': '1',
+ 'version': '1.0.0',
# 'isDeprecated': 'False',
# 'retirementDate': ''
}]