apibase = config.get_o2ims_api_base()
api_monitoring_base = config.get_o2ims_monitoring_api_base()
+monitor_api_version = config.get_o2ims_monitoring_api_v1()
+inventory_api_version = config.get_o2ims_inventory_api_v1()
def main():
datastr = m['data']
data = json.loads(datastr)
logger.info('ResourceChanged with cmd:{}'.format(data))
- ref = apibase + '/resourcePools/' + data['resourcePoolId'] +\
- '/resources/' + data['id']
+ ref = apibase + inventory_api_version + '/resourcePools/' + \
+ data['resourcePoolId'] + '/resources/' + data['id']
cmd = imscmd.PubMessage2SMO(data=Message2SMO(
id=data['id'], ref=ref,
eventtype=data['notificationEventType'],
datastr = m['data']
data = json.loads(datastr)
logger.info('AlarmEventChanged with cmd:{}'.format(data))
- ref = api_monitoring_base + '/alarms/' + data['id']
+ ref = api_monitoring_base + \
+ monitor_api_version + '/alarms/' + data['id']
cmd = imscmd.PubAlarm2SMO(data=AlarmEvent2SMO(
id=data['id'], ref=ref,
eventtype=data['notificationEventType'],
return get_root_api_base() + 'o2ims-infrastructureInventory'
+def get_o2ims_monitoring_api_v1():
+ return '/v1'
+
+
+def get_o2ims_inventory_api_v1():
+ return '/v1'
+
+
def get_o2ims_monitoring_api_base():
return get_root_api_base() + 'o2ims-infrastructureMonitoring'