--- /dev/null
+# Copyright 2017 Intel Research and Development Ireland Limited
+# *************************************************************
+
+# This file is part of OSM Monitoring module
+# All Rights Reserved to Intel Corporation
+
+# 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.
+
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+##
+
+'''
+This is a kafka consumer app that reads the messages from the message bus for
+alarms and metrics responses.
+
+'''
+
+__author__ = "Prithiv Mohan"
+__date__ = "06/Sep/2017"
+
+
+from kafka import KafkaConsumer
+from kafka.errors import KafkaError
+import json
+import logging
+import logging.config
+import os
+
+def logging_handler(filename, mode='a+', encoding=None):
+ if not os.path.exists(filename):
+ open(filename, 'a').close()
+ return logging.FileHandler(filename, mode)
+
+log_config = {
+ 'version': 1,
+ 'formatters': {
+ 'default': {
+ 'format': '%(asctime)s %(levelname)s %(name)s %(message)s'
+ },
+ },
+ 'handlers': {
+ 'file':{
+ '()': logging_handler,
+ 'level':'DEBUG',
+ 'formatter': 'default',
+ 'filename': '/var/log/osm_mon.log',
+ 'mode': 'a+',
+ 'encoding': 'utf-8',
+ },
+ },
+ 'kafka': {
+ 'handlers': ['file'],
+ 'level': 'DEBUG',
+ },
+ 'root': {
+ 'handlers': ['file'],
+ 'level': 'DEBUG',
+ },
+}
+
+
+logging.config.dictConfig(log_config)
+logger = logging.getLogger('kafka')
+
+
+
+alarm_consumer = KafkaConsumer('alarm_response', 'osm_mon', bootstrap_servers = 'localhost:9092')
+metric_consumer = KafkaConsumer('metric_response', 'osm_mon', bootstrap_servers = 'localhost:9092')
+try:
+ for message in alarm_consumer:
+ logger.debug(message)
+ for message in metric_consumer:
+ logger.debug(message)
+except KafkaError:
+ log.exception()
+ pass
+
+alarm_consumer.subscribe('alarm_response')
+metric_consumer.subscribe('metric_response')
+++ /dev/null
-
-# Copyright© 2017 Intel Research and Development Ireland Limited
-# *************************************************************
-
-# This file is part of OSM Monitoring module
-# All Rights Reserved to Intel Corporation
-
-# 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.
-
-# For those usages not covered by the Apache License, Version 2.0 please
-# contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
-##
-
-'''
-This is a kafka consumer app that reads the messages from the message bus for
-alarms and metrics responses.
-
-#TODO: (Prithiv Mohan)
- - Modify topics based on new schema definitions
- - Include consumer logging
-'''
-
-__author__ = "Prithiv Mohan"
-__date__ = "06/Sep/2017"
-
-from kafka import KafkaConsumer
-from kafka.errors import KafkaError
-import logging
-
-class KafkaConsumer(object):
- """Adds messages to a kafka topic. Topic is hardcoded as 'alarms' and group as
- 'my_group' for now.
-
- """
-
- def __init__(self, uri):
- """Init
-
- uri - kafka connection details
- """
- if not cfg.CONF.kafka.uri:
- raise Exception("Kafka URI Not Found. Check the config file for Kafka URI")
- else:
- broker = cfg.CONF.kafka.uri
- consumer = KafkaConsumer('alarms',
- group_id='my_group',
- bootstrap_servers=broker, api_version=(0,10))
- #KafkaConsumer(value_deserializer=lambda m: json.loads(m.decode('ascii')))
-
- def consume(self, topic, messages):
- for message in self._consumer:
- print ("%s:%d:%d: key=%s value=%s" % (message.topic, message.partition, message.offset, message.key, message.value))
-# Copyright© 2017 Intel Research and Development Ireland Limited
+# Copyright 2017 Intel Research and Development Ireland Limited
# *************************************************************
# This file is part of OSM Monitoring module
'''
This is a kafka producer app that interacts with the SO and the plugins of the
datacenters like OpenStack, VMWare, AWS.
-#TODO: Interfacing with the APIs of the monitoring tool plugins (Prithiv Mohan).
'''
__author__ = "Prithiv Mohan"
from kafka.errors import KafkaError
import logging
import json
+import jsmin
import os
from os import listdir
-
-
+from jsmin import jsmin
class KafkaProducer(object):
- def __init__(self, topic, message):
+ def __init__(self, topic):
self._topic= topic
- self._message = message
if "ZOOKEEPER_URI" in os.environ:
broker = os.getenv("ZOOKEEPER_URI")
def publish(self, key, message, topic=None):
try:
- future = producer.send('alarms', key, payload)
+ future = producer.send('key', 'payload',group_id='osm_mon')
producer.flush()
except Exception:
log.exception("Error publishing to {} topic." .format(topic))
#External to MON
- payload_create_alarm = json.loads(open(os.path.join(json_path,
+ payload_create_alarm = jsmin(open(os.path.join(json_path,
'create_alarm.json')).read())
publish(key,
value=json.dumps(payload_create_alarm),
#Internal to MON
- payload_create_alarm_resp = json.loads(open(os.path.join(json_path,
+ payload_create_alarm_resp = jsmin(open(os.path.join(json_path,
'create_alarm_resp.json')).read())
publish(key,
value = json.dumps(payload_create_alarm_resp),
topic = 'alarm_response')
+ def acknowledge_alarm(self, key, message, topic):
+
+ #Internal to MON
+
+ payload_acknowledge_alarm = jsmin(open(os.path.join(json_path,
+ 'acknowledge_alarm.json')).read())
+
+ publish(key,
+ value = json.dumps(payload_acknowledge_alarm),
+ topic = 'alarm_request')
def list_alarm_request(self, key, message, topic):
#External to MON
- payload_alarm_list_req = json.loads(open(os.path.join(json_path,
+ payload_alarm_list_req = jsmin(open(os.path.join(json_path,
'list_alarm_req.json')).read())
publish(key,
def notify_alarm(self, key, message, topic):
- payload_notify_alarm = json.loads(open(os.path.join(json_path,
+ payload_notify_alarm = jsmin(open(os.path.join(json_path,
'notify_alarm.json')).read())
publish(key,
def list_alarm_response(self, key, message, topic):
- payload_list_alarm_resp = json.loads(open(os.path.join(json_path,
+ payload_list_alarm_resp = jsmin(open(os.path.join(json_path,
'list_alarm_resp.json')).read())
publish(key,
# External to Mon
- payload_update_alarm_req = json.loads(open(os.path.join(json_path,
+ payload_update_alarm_req = jsmin(open(os.path.join(json_path,
'update_alarm_req.json')).read())
publish(key,
# Internal to Mon
- payload_update_alarm_resp = json.loads(open(os.path.join(json_path,
+ payload_update_alarm_resp = jsmin(open(os.path.join(json_path,
'update_alarm_resp.json')).read())
publish(key,
# External to Mon
- payload_delete_alarm_req = json.loads(open(os.path.join(json_path,
+ payload_delete_alarm_req = jsmin(open(os.path.join(json_path,
'delete_alarm_req.json')).read())
publish(key,
# Internal to Mon
- payload_delete_alarm_resp = json.loads(open(os.path.join(json_path,
+ payload_delete_alarm_resp = jsmin(open(os.path.join(json_path,
'delete_alarm_resp.json')).read())
publish(key,
# External to Mon
- payload_create_metrics_req = json.loads(open(os.path.join(json_path,
+ payload_create_metrics_req = jsmin(open(os.path.join(json_path,
'create_metric_req.json')).read())
publish(key,
# Internal to Mon
- payload_create_metrics_resp = json.loads(open(os.path.join(json_path,
+ payload_create_metrics_resp = jsmin(open(os.path.join(json_path,
'create_metric_resp.json')).read())
publish(key,
# External to Mon
- payload_read_metric_data_request = json.loads(open(os.path.join(json_path,
+ payload_read_metric_data_request = jsmin(open(os.path.join(json_path,
'read_metric_data_req.json')).read())
publish(key,
# Internal to Mon
- payload_metric_data_response = json.loads(open(os.path.join(json_path,
+ payload_metric_data_response = jsmin(open(os.path.join(json_path,
'read_metric_data_resp.json')).read())
publish(key,
#External to MON
- payload_metric_list_req = json.loads(open(os.path.join(json_path,
+ payload_metric_list_req = jsmin(open(os.path.join(json_path,
'list_metric_req.json')).read())
publish(key,
#Internal to MON
- payload_metric_list_resp = json.loads(open(os.path.join(json_path,
+ payload_metric_list_resp = jsmin(open(os.path.join(json_path,
'list_metrics_resp.json')).read())
publish(key,
# External to Mon
- payload_delete_metric_req = json.loads(open(os.path.join(json_path,
+ payload_delete_metric_req = jsmin(open(os.path.join(json_path,
'delete_metric_req.json')).read())
publish(key,
# Internal to Mon
- payload_delete_metric_resp = json.loads(open(os.path.join(json_path,
+ payload_delete_metric_resp = jsmin(open(os.path.join(json_path,
'delete_metric_resp.json')).read())
publish(key,
# External to Mon
- payload_update_metric_req = json.loads(open(os.path.join(json_path,
+ payload_update_metric_req = jsmin(open(os.path.join(json_path,
'update_metric_req.json')).read())
publish(key,
# Internal to Mon
- payload_update_metric_resp = json.loads(open(os.path.join(json_path,
+ payload_update_metric_resp = jsmin(open(os.path.join(json_path,
'update_metric_resp.json')).read())
publish(key,
value=json.dumps(payload_update_metric_resp),
- topic='metric_response)
+ topic='metric_response')
def access_credentials(self, key, message, topic):
- payload_access_credentials = json.loads(open(os.path.join(json_path,
+ payload_access_credentials = jsmin(open(os.path.join(json_path,
'access_credentials.json')).read())
publish(key,
-{
+
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+# This file is part of OSM Monitoring module
+# All Rights Reserved to Intel Corporation
+
+# 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.
+
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+# This is the message bus schema for acknowledge_alarm */
+
+{
"schema_version": { "type": "string" },
"schema_type": { "type": "string" },
+ "vim_type": { "type": "string" },
"ack_details":
{
"alarm_uuid": { "type": "string" },
"resource_uuid": { "type": "string" },
- "tenant_uuid": { "type": "string" },
- "vim_type": { "type": "string" }
+ "tenant_uuid": { "type": "string" }
},
"required": [ "schema_version",
"schema_type",
+ "vim_type",
"alarm_uuid",
"resource_uuid",
- "tenant_uuid",
- "vim_type" ]
+ "tenant_uuid" ]
}
\ No newline at end of file
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+# This file is part of OSM Monitoring module
+# All Rights Reserved to Intel Corporation
+
+# 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.
+
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+# This is the message bus schema to create_alarm */
+
{
"schema_version": { "type": "string" },
"schema_type": { "type": "string" },
+ "vim_type": { "type": "string "},
"alarm_create_request":
{
"correlation_id": { "type": "integer" },
"alarm_name": { "type": "string" },
+ "metric_name": { "type": "string" },
"tenant_uuid": { "type": "string" },
"resource_uuid": { "type": "string" },
- "vim_type": { "type": "string" },
"description": { "type": "string" },
"severity": { "type": "string" },
"operation": { "type": "string" },
},
"required": [ "schema_version",
"schema_type",
+ "vim_type",
"correlation_id",
"alarm_name",
+ "metric_name",
"resource_uuid",
- "vim_type",
"severity",
"operation",
"threshold_value",
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+ # This file is part of OSM Monitoring module
+ # All Rights Reserved to Intel Corporation
+
+ # 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.
+
+ # For those usages not covered by the Apache License, Version 2.0 please
+ # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+ # This is the message bus schema for create_alarm response */
+
{
"schema_version": { "type": "string" },
"schema_type": { "type": "string" },
"status": { "type": "boolean" }
},
"required": [ "schema_version",
- "schema_type",
- "correlation_id",
- "alarm_uuid",
- "status" ]
+ "schema_type",
+ "correlation_id",
+ "alarm_uuid",
+ "status" ]
}
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+ # This file is part of OSM Monitoring module
+ # All Rights Reserved to Intel Corporation
+
+ # 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.
+
+ # For those usages not covered by the Apache License, Version 2.0 please
+ # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+ # This is the message bus schema to create_metric */
+
+
{
"schema_version": { "type": "string" },
"schema_type": { "type": "string" },
"tenant_uuid": { "type": "string" },
"correlation_id": { "type": "integer" },
"vim_type": { "type": "string" },
- "metrics_configuration":
+ "metric_create":
{
- "metric_uuid": { "type": "string" },
+ "metric_name": { "type" : "string" },
"metric_unit": { "type": "string" },
"resource_uuid": { "type": "string" }
},
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+ # This file is part of OSM Monitoring module
+ # All Rights Reserved to Intel Corporation
+
+ # 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.
+
+ # For those usages not covered by the Apache License, Version 2.0 please
+ # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+ # This is the message bus schema for create_metric response*/
+
{
"schema_version": { "type": "string" },
"schema_type": { "type": "string" },
"correlation_id": { "type": "integer" },
- "metrics_create_response":
+ "metric_create_response":
{
"metric_uuid": { "type": "string" },
"resource_uuid": { "type": "string" },
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+ # This file is part of OSM Monitoring module
+ # All Rights Reserved to Intel Corporation
+
+ # 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.
+
+ # For those usages not covered by the Apache License, Version 2.0 please
+ # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+ # This is the message bus schema to delete_alarm */
+
{
"schema_version": { "type": "string" },
"schema_type": { "type": "string" },
+ "vim_type": { "type": "string" },
"alarm_delete_request":
{
"alarm_uuid": { "type": "string" },
- "correlation_id": { "type": "integer" },
- "vim_type": { "type": "string" }
+ "correlation_id": { "type": "integer" }
},
"required": [ "schema_version",
"schema_type",
+ "vim_type",
"alarm_uuid",
- "correlation_id",
- "vim_type" ]
+ "correlation_id"
+ ]
}
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+ # This file is part of OSM Monitoring module
+ # All Rights Reserved to Intel Corporation
+
+ # 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.
+
+ # For those usages not covered by the Apache License, Version 2.0 please
+ # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+ This is the message bus schema for delete_metric_response */
+
{
"schema_version": { "type": "string" },
"schema_type": { "type": "string" },
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+ # This file is part of OSM Monitoring module
+ # All Rights Reserved to Intel Corporation
+
+ # 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.
+
+ # For those usages not covered by the Apache License, Version 2.0 please
+ # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+ # This is the message bus schema to delete_metric */
+
{
"schema_version": { "type": "string" },
"schema_type": { "type": "string" },
"metric_name",
"metric_uuid",
"resource_uuid",
- "tenant_uuid",
"correlation_uuid",
"vim_type" ]
}
\ No newline at end of file
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+ # This file is part of OSM Monitoring module
+ # All Rights Reserved to Intel Corporation
+
+ # 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.
+
+ # For those usages not covered by the Apache License, Version 2.0 please
+ # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+ # This is the message bus schema for delete_metric_response */
+
{
"schema_version": { "type": "string" },
"schema_type": { "type": "string" },
"resource_uuid": { "type": "string" },
"tenant_uuid": { "type": "string" },
"correlation_id": { "type": "integer" },
+ "status": { "type": "boolean" },
"required": [ "schema_version",
"schema_type",
"metric_name",
"metric_uuid",
"resource_uuid",
- "tenant_uuid",
+ "status",
"correlation_id" ]
}
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+# This file is part of OSM Monitoring module
+# All Rights Reserved to Intel Corporation
+
+# 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.
+
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+# This is the message bus schema to list_alarm */
+
{
"schema_version": { "type": "string" },
"schema_type": { "type": "string" },
+ "vim_type": { "type": "string" },
"alarm_list_request":
{
"correlation_id": { "type": "integer" },
"resource_uuid": { "type": "string" },
"alarm_name": { "type": "string" },
- "vim_type": { "type": "string" },
"severity": { "type" : "string" }
},
"required": [ "schema_version",
"schema_type",
+ "vim_type",
"correlation_id",
- "vim_type"
+ "resource_uuid"
]
}
\ No newline at end of file
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+ # This file is part of OSM Monitoring module
+ # All Rights Reserved to Intel Corporation
+
+ # 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.
+
+ # For those usages not covered by the Apache License, Version 2.0 please
+ # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+ # This is the message bus schema for list_alarm response */
+
{
"schema_version": { "type": "string" },
"schema_type": { "type": "string" },
- "list_alarm_resp": { "type": "array" }
+ "list_alarm_resp": { "$ref": "definitions.json#/notify_details" }
}
\ No newline at end of file
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+ # This file is part of OSM Monitoring module
+ # All Rights Reserved to Intel Corporation
+
+ # 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.
+
+ # For those usages not covered by the Apache License, Version 2.0 please
+ # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+ # This is the message bus schema to list_metric */
+
{
"schema_version": { "type": "string" },
"schema_type": { "type": "string" },
+ "vim_type": { "type": "string" },
"metrics_list_request":
{
"metric_name": { "type": "string" },
"correlation_id": { "type": "integer" },
- "resource_uuid": { "type": "string" },
- "vim_type": { "type": "string" }
+ "resource_uuid": { "type": "string" }
},
"required": [ "schema_version",
"schema_type",
- "metric_name",
- "correlation_id",
- "resource_uuid",
- "vim_type"]
+ "vim_type",
+ "correlation_id"
+ ]
}
\ No newline at end of file
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+ # This file is part of OSM Monitoring module
+ # All Rights Reserved to Intel Corporation
+
+ # 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.
+
+ # For those usages not covered by the Apache License, Version 2.0 please
+ # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+ # This is the message bus schema for list_metric response */
+
{
-"schema_version": { "type": "string" },
-"schema_type": { "type", "string" },
-"tenant_uuid": { "type": "string" },
-"correlation_uuid": { "type": "string" },
-"vim_type": { "type": "string" },
-"metrics_list":
- {
- "metric_name": { "type": "string" },
- "metric_uuid": { "type": "string" },
- "metric_unit": { "type": "string" },
- "resource_uuid": { "type": "string" }
- },
- "required": [ "schema_version",
- "schema_type",
- "tenant_uuid",
- "correlation_uuid",
- "vim_type",
- "metric_name",
- "metric_uuid",
- "metric_unit",
- "resource_uuid" ]
+ "schema_version": { "type": "string" },
+ "schema_type": { "type": "string" },
+ "tenant_uuid": { "type": "string" },
+ "correlation_uuid": { "type": "integer" },
+ "vim_type": { "type": "string" },
+ "metrics_list":
+ {
+ "metric_name": { "type": "string" },
+ "metric_uuid": { "type": "string" },
+ "metric_unit": { "type": "string" },
+ "resource_uuid": { "type": "string" }
+ },
+ "required": [ "schema_version",
+ "schema_type",
+ "correlation_uuid",
+ "vim_type",
+ "metric_name",
+ "metric_uuid",
+ "metric_unit",
+ "resource_uuid" ]
}
\ No newline at end of file
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+ # This file is part of OSM Monitoring module
+ # All Rights Reserved to Intel Corporation
+
+ # 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.
+
+ # For those usages not covered by the Apache License, Version 2.0 please
+ # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+ # This is the message bus schema to notify_alarm */
+
{
"schema_version": { "type": "string" },
"schema_type": { "type": "string" },
- "notify_details":
+ "definitions":
{
- "alarm_uuid": { "type": "string" },
- "resource_uuid": { "type": "string" },
- "description": { "type": "string" },
- "tenant_uuid": { "type": "string" },
- "vim_type": { "type": "string" },
- "severity": { "type" : ["integer", "string"] },
- "status": { "type": "string" },
- "start_date": { "type": "date-time" },
- "update_date": { "type": "date-time" },
- "cancel_date": { "type": "date-time" }
- },
- "required": [ "schema_version",
- "schema_type",
- "alarm_uuid",
- "resource_uuid",
- "tenant_uuid",
- "vim_type",
- "severity",
- "status",
- "start_date" ]
+ "notify_details":
+ {
+ "alarm_uuid": { "type": "string" },
+ "resource_uuid": { "type": "string" },
+ "description": { "type": "string" },
+ "tenant_uuid": { "type": "string" },
+ "vim_type": { "type": "string" },
+ "severity": { "type" : "string" },
+ "status": { "type": "string" },
+ "start_date": { "type": "string" },
+ "update_date": { "type": "string" },
+ "cancel_date": { "type": "string" }
+ },
+ "required": [ "schema_version",
+ "schema_type",
+ "alarm_uuid",
+ "resource_uuid",
+ "vim_type",
+ "severity",
+ "status",
+ "start_date" ]
+ }
}
\ No newline at end of file
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+ # This file is part of OSM Monitoring module
+ # All Rights Reserved to Intel Corporation
+
+ # 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.
+
+ # For those usages not covered by the Apache License, Version 2.0 please
+ # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+ # This is the message bus schema to read_metric_data */
+
{
"schema_version": { "type": "string" },
"schema_type": { "type": "string" },
"metric_name": { "type": "string" },
- "metric_uuid": { "type": "String" },
+ "metric_uuid": { "type": "string" },
"resource_uuid": { "type": "string" },
"tenant_uuid": { "type": "string" },
- "correlation_uuid": { "type": "string" },
+ "correlation_uuid": { "type": "integer" },
"vim_type": { "type": "string" },
- "collection_period": { "type": "string" },
+ "collection_period": { "type": "integer" },
+ "collection_unit": { "type": "string" },
"required": ["schema_version",
"schema_type",
- "tenant_uuid",
"metric_name",
"metric_uuid",
"correlation_uuid",
"vim_type",
"collection_period",
+ "collection_unit",
"resource_uuid"]
}
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+ # This file is part of OSM Monitoring module
+ # All Rights Reserved to Intel Corporation
+
+ # 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.
+
+ # For those usages not covered by the Apache License, Version 2.0 please
+ # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+ # This is the message bus schema for read_metric_data response */
+
{
"schema_version": { "type": "string" },
- "schema_type": "metric_data_response",
- "metrics_name": { "type": "string" },
+ "schema_type": {"type": "string" },
+ "metric_name": { "type": "string" },
"metric_uuid": { "type": "string" },
"correlation_id": { "type": "integer" },
"resource_uuid": { "type": "string" },
"tenant_uuid": { "type": "string" },
"metrics_data":
{
- "time_series": { "type": "array" },
- "metrics_series": { "type": "array" },
- "unit": { "type": "string" }
+ "time_series": [{
+ "type": "array",
+ "properties":
+ { "time_stamp":
+ { "type": "integer" }}}
+ ]
},
+ "metrics_series": [{
+ "type": "array",
+ "properties":
+ { "data":
+ { "type":
+ ["integer",
+ "string",
+ "decimal"
+ ]
+ }
+ }
+ }
+ ],
+ "unit": { "type": "string" },
"required": [ "schema_version",
"schema_type",
"metric_name",
"metric_uuid",
"resource_uuid",
- "tenant_uuid",
+ "correlation_id",
"time_series",
"metrics_series" ]
}
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+ # This file is part of OSM Monitoring module
+ # All Rights Reserved to Intel Corporation
+
+ # 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.
+
+ # For those usages not covered by the Apache License, Version 2.0 please
+ # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+ # This is the message bus schema to update_alarm */
+
{
"schema_version": { "type": "string" },
"schema_type": { "type": "string" },
+ "vim_type": { "type": "string" },
"alarm_update_request":
{
- "alarm_uuid": { "type": "string" },
"correlation_id": { "type": "integer" },
- "vim_type": { "type": "string" },
+ "alarm_uuid": { "type": "string" },
+ "metric_uuid": { "type": "string" },
"description": { "type": "string" },
"severity": { "type": "string" },
"operation": { "type": "string" },
},
"required": [ "schema_version",
"scema_type",
+ "vim_type",
"correlation_id",
- "alarm_uuid",
- "vim_type" ]
+ "alarm_uuid",
+ "metric_uuid" ]
}
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+ # This file is part of OSM Monitoring module
+ # All Rights Reserved to Intel Corporation
+
+ # 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.
+
+ # For those usages not covered by the Apache License, Version 2.0 please
+ # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+ # This is the message bus schema for update_alarm response */
+
{
"schema_version": { "type": "string" },
"schema_type": { "type": "string" },
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+ # This file is part of OSM Monitoring module
+ # All Rights Reserved to Intel Corporation
+
+ # 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.
+
+ # For those usages not covered by the Apache License, Version 2.0 please
+ # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+ # This is the message bus schema for update_metric response */
+
{
"schema_version": { "type": "string" },
"schema_type": { "type": "string" },
"tenant_uuid": { "type": "string" },
"correlation_id": { "type": "integer" },
"vim_type": { "type": "string" },
- "metric_update_request":
+ "metric_create":
{
"metric_name": { "type": "string" },
- "metric_uuid": { "type": "string" },
"metric_unit": { "type": "string" },
"resource_uuid": { "type": "string" }
},
"required": [ "schema_version",
"schema_type",
- "tenant_uuid",
"correlation_id",
"vim_type",
- "metric_name",
- "metric_uuid",
- "resource_uuid",
- "metric_unit"]
+ "resource_uuid"
+ ]
}
\ No newline at end of file
+/* Copyright© 2017 Intel Research and Development Ireland Limited
+ # This file is part of OSM Monitoring module
+ # All Rights Reserved to Intel Corporation
+
+ # 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.
+
+ # For those usages not covered by the Apache License, Version 2.0 please
+ # contact: prithiv.mohan@intel.com or adrian.hoban@intel.com
+
+ # This is the message bus schema to update_metric */
+
{
"schema_version": { "type": "string" },
"schema_type": { "type": "string" },