Vertex Properties refactoring

Rename vitrage properties to start with the vitrage prefix
so it will be easier work with and to recognize.

Change-Id: Ia8afaa1a13897927984a9c8d8d9b85343ef69c01
This commit is contained in:
Alexey Weyl 2017-06-06 07:12:57 +00:00
parent 0af2b7ceb5
commit 3b1de001ec
117 changed files with 1790 additions and 1556 deletions

View File

@ -20,7 +20,7 @@ In order to add a new datasource to Vitrage do the following steps:
a. Driver and transformer with the path to your driver and transformer
classes respectively.
b. ``update_method`` property that describes the type of update mechanism for
b. ``update_method`` property that describes the vitrage_type of update mechanism for
this datasource. The options are (string): push, pull or none.
c. In addition to those three, you may add any other configuration options
you may need for your datasource.

View File

@ -16,7 +16,7 @@ Since each data-source might represent severity differently, for each
data-source we can supply it's own mapping to the aggregated severity supported
in Vitrage. This way we can know which severity is more important.
In addition we also normalize the severities for the horizon UI (called
``operational_severity``) in order for the UI to know what color to show in
``vitrage_operational_severity``) in order for the UI to know what color to show in
Horizon.
This page explains how to handle this mapping for a given

View File

@ -16,7 +16,7 @@ Since each data-source might represent state differently, for each
data-source we can supply it's own mapping to the aggregated state supported
in Vitrage. This way we can know which state is more important.
In addition we also normalize the states for the horizon UI (called
operational_state) in order for the UI to know what color to show in Horizon.
vitrage_operational_state) in order for the UI to know what color to show in Horizon.
This page explains how to handle this mapping for a given
data-source.

View File

@ -34,8 +34,8 @@ The following describes all the possible status code and their messages:
+------------------+---------------------------------------------------------+-------------------------------+
| 43 | At least one entity must be defined | syntax |
+------------------+---------------------------------------------------------+-------------------------------+
| 45 | Invalid entity category. Category must be from types: | syntax |
| | [entities_categories] | |
| 45 | Invalid entity category. Category must be from | syntax |
| | types: [entities_categories] | |
+------------------+---------------------------------------------------------+-------------------------------+
| 46 | Entity field is required | syntax |
+------------------+---------------------------------------------------------+-------------------------------+

View File

@ -60,13 +60,13 @@ Let's take a basic template as example
expected_entities = {
'alarm': Vertex(vertex_id='alarm',
properties={'category': 'ALARM',
'type': 'nagios',
'name': 'HOST_HIGH_CPU_LOAD'
properties={'vitrage_category': 'ALARM',
'vitrage_type': 'nagios',
'name': 'HOST_HIGH_CPU_LOAD',
}),
'resource': Vertex(vertex_id='resource',
properties={'category': 'RESOURCE',
'type': 'nova.host'
properties={'vitrage_category': 'RESOURCE',
'vitrage_type': 'nova.host',
})
}

View File

@ -167,19 +167,19 @@ Query example
[
"=":
{
"type":"host"
"vitrage_type":"host"
},
"=":
{
"type":"instance"
"vitrage_type":"instance"
},
"=":
{
"type":"zone"
"vitrage_type":"zone"
},
"=":
{
"type":"node"
"vitrage_type":"node"
}
]
}
@ -215,257 +215,257 @@ Response Examples
"graph": {},
"nodes": [
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "vm-8",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "ACTIVE",
"project_id": "0683517e1e354d2ba25cba6937f44e79",
"type": "nova.instance",
"vitrage_type": "nova.instance",
"id": "20d12a8a-ea9a-89c6-5947-83bea959362e",
"vitrage_id": "RESOURCE:nova.instance:20d12a8a-ea9a-89c6-5947-83bea959362e"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "vm-2",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "ACTIVE",
"project_id": "0683517e1e354d2ba25cba6937f44e79",
"type": "nova.instance",
"vitrage_type": "nova.instance",
"id": "dc35fa2f-4515-1653-ef6b-03b471bb395b",
"vitrage_id": "RESOURCE:nova.instance:dc35fa2f-4515-1653-ef6b-03b471bb395b"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "vm-13",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "ACTIVE",
"project_id": "0683517e1e354d2ba25cba6937f44e79",
"type": "nova.instance",
"vitrage_type": "nova.instance",
"id": "9879cf5a-bdcf-3651-3017-961ed887ec86",
"vitrage_id": "RESOURCE:nova.instance:9879cf5a-bdcf-3651-3017-961ed887ec86"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "vm-10",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "ACTIVE",
"project_id": "0683517e1e354d2ba25cba6937f44e79",
"type": "nova.instance",
"vitrage_type": "nova.instance",
"id": "fe124f4b-9ed7-4591-fcd1-803cf5c33cb1",
"vitrage_id": "RESOURCE:nova.instance:fe124f4b-9ed7-4591-fcd1-803cf5c33cb1"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "vm-11",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "ACTIVE",
"project_id": "0683517e1e354d2ba25cba6937f44e79",
"type": "nova.instance",
"vitrage_type": "nova.instance",
"id": "f2e48a97-7350-061e-12d3-84c6dc3e67c0",
"vitrage_id": "RESOURCE:nova.instance:f2e48a97-7350-061e-12d3-84c6dc3e67c0"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "host-2",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "available",
"type": "nova.host",
"vitrage_type": "nova.host",
"id": "host-2",
"vitrage_id": "RESOURCE:nova.host:host-2"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "host-3",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "available",
"type": "nova.host",
"vitrage_type": "nova.host",
"id": "host-3",
"vitrage_id": "RESOURCE:nova.host:host-3"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "host-0",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "available",
"type": "nova.host",
"vitrage_type": "nova.host",
"id": "host-0",
"vitrage_id": "RESOURCE:nova.host:host-0"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "host-1",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "available",
"type": "nova.host",
"vitrage_type": "nova.host",
"id": "host-1",
"vitrage_id": "RESOURCE:nova.host:host-1"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "vm-9",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "ACTIVE",
"project_id": "0683517e1e354d2ba25cba6937f44e79",
"type": "nova.instance",
"vitrage_type": "nova.instance",
"id": "275097cf-954e-8e24-b185-9514e24b8591",
"vitrage_id": "RESOURCE:nova.instance:275097cf-954e-8e24-b185-9514e24b8591"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "vm-1",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "ACTIVE",
"project_id": "0683517e1e354d2ba25cba6937f44e79",
"type": "nova.instance",
"vitrage_type": "nova.instance",
"id": "a0f0805f-c804-cffe-c25a-1b38f555ed68",
"vitrage_id": "RESOURCE:nova.instance:a0f0805f-c804-cffe-c25a-1b38f555ed68"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "vm-14",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "ACTIVE",
"project_id": "0683517e1e354d2ba25cba6937f44e79",
"type": "nova.instance",
"vitrage_type": "nova.instance",
"id": "56af57d2-34a4-19b1-5106-b613637a11a7",
"vitrage_id": "RESOURCE:nova.instance:56af57d2-34a4-19b1-5106-b613637a11a7"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "zone-1",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "available",
"type": "nova.zone",
"vitrage_type": "nova.zone",
"id": "zone-1",
"vitrage_id": "RESOURCE:nova.zone:zone-1"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "vm-3",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "ACTIVE",
"project_id": "0683517e1e354d2ba25cba6937f44e79",
"type": "nova.instance",
"vitrage_type": "nova.instance",
"id": "16e14c58-d254-2bec-53e4-c766e48810aa",
"vitrage_id": "RESOURCE:nova.instance:16e14c58-d254-2bec-53e4-c766e48810aa"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "vm-7",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "ACTIVE",
"project_id": "0683517e1e354d2ba25cba6937f44e79",
"type": "nova.instance",
"vitrage_type": "nova.instance",
"id": "f35a1e10-74ff-7332-8edf-83cd6ffcb2de",
"vitrage_id": "RESOURCE:nova.instance:f35a1e10-74ff-7332-8edf-83cd6ffcb2de"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "vm-4",
"update_timestamp": "2015-12-01T12:46:41Z?vitrage_id=all",
"state": "ACTIVE",
"project_id": "0683517e1e354d2ba25cba6937f44e79",
"type": "nova.instance",
"vitrage_type": "nova.instance",
"id": "ea8a450e-cab1-2272-f431-494b40c5c378",
"vitrage_id": "RESOURCE:nova.instance:ea8a450e-cab1-2272-f431-494b40c5c378"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "vm-6",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "ACTIVE",
"project_id": "0683517e1e354d2ba25cba6937f44e79",
"type": "nova.instance",
"vitrage_type": "nova.instance",
"id": "6e42bdc3-b776-1b2c-2c7d-b7a8bb98f721",
"vitrage_id": "RESOURCE:nova.instance:6e42bdc3-b776-1b2c-2c7d-b7a8bb98f721"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "vm-5",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "ACTIVE",
"project_id": "0683517e1e354d2ba25cba6937f44e79",
"type": "nova.instance",
"vitrage_type": "nova.instance",
"id": "8c951613-c660-87c0-c18b-0fa3293ce8d8",
"vitrage_id": "RESOURCE:nova.instance:8c951613-c660-87c0-c18b-0fa3293ce8d8"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "zone-0",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "available",
"type": "nova.zone",
"vitrage_type": "nova.zone",
"id": "zone-0",
"vitrage_id": "RESOURCE:nova.zone:zone-0"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "vm-0",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "ACTIVE",
"project_id": "0683517e1e354d2ba25cba6937f44e79",
"type": "nova.instance",
"vitrage_type": "nova.instance",
"id": "78353ce4-2710-49b5-1341-b8cbb6000ebc",
"vitrage_id": "RESOURCE:nova.instance:78353ce4-2710-49b5-1341-b8cbb6000ebc"
},TODO
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "vm-12",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "ACTIVE",
"project_id": "0683517e1e354d2ba25cba6937f44e79",
"type": "nova.instance",
"vitrage_type": "nova.instance",
"id": "35bf479a-75d9-80a9-874e-d3b50fb2dd2e",
"vitrage_id": "RESOURCE:nova.instance:35bf479a-75d9-80a9-874e-d3b50fb2dd2e"
},
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "openstack.cluster",
"type": "openstack.cluster",
"vitrage_type": "openstack.cluster",
"id": "openstack.cluster",
"vitrage_id": "RESOURCE:openstack.cluster"
}
@ -473,147 +473,147 @@ Response Examples
"links": [
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 3,
"key": "contains",
"source": 5
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 1,
"key": "contains",
"source": 5
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 16,
"key": "contains",
"source": 5
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 11,
"key": "contains",
"source": 5
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 13,
"key": "contains",
"source": 6
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 4,
"key": "contains",
"source": 6
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 14,
"key": "contains",
"source": 6
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 20,
"key": "contains",
"source": 7
},?vitrage_id=all
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 0,
"key": "contains",
"source": 7
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 19,
"key": "contains",
"source": 7
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 15,
"key": "contains",
"source": 7
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 9,
"key": "contains",
"source": 8
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 10,
"key": "contains",
"source": 8
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 2,
"key": "contains",
"source": 8
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 17,
"key": "contains",
"source": 8
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 6,
"key": "contains",
"source": 12
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 8,
"key": "contains",
"source": 12
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 5,
"key": "contains",
"source": 18
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 7,
"key": "contains",
"source": 18
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 18,
"key": "contains",
"source": 21
},
{
"relationship_name": "contains",
"is_deleted": false,
"vitrage_is_deleted": false,
"target": 12,
"key": "contains",
"source": 21
@ -685,8 +685,8 @@ Response Examples
},
"nodes": [
{
"category": "ALARM",
"type": "nagios",
"vitrage_category": "ALARM",
"vitrage_type": "nagios",
"name": "CPU load",
"state": "Active",
"severity": "WARNING",
@ -699,8 +699,8 @@ Response Examples
"vitrage_id": "ALARM:nagios:host0:CPU load"
},
{
"category": "ALARM",
"type": "vitrage",
"vitrage_category": "ALARM",
"vitrage_type": "vitrage",
"name": "Machine Suboptimal",
"state": "Active",
"severity": "WARNING",
@ -712,8 +712,8 @@ Response Examples
"vitrage_id": "ALARM:vitrage:vm0:Machine Suboptimal"
},
{
"category": "ALARM",
"type": "vitrage",
"vitrage_category": "ALARM",
"vitrage_type": "vitrage",
"name": "Machine Suboptimal",
"state": "Active",
"severity": "WARNING",
@ -799,8 +799,8 @@ Response Examples
[
{
"category": "ALARM",
"type": "nagios",
"vitrage_category": "ALARM",
"vitrage_type": "nagios",
"name": "CPU load",
"state": "Active",
"severity": "WARNING",
@ -814,8 +814,8 @@ Response Examples
"normalized_severity": "WARNING"
},
{
"category": "ALARM",
"type": "vitrage",
"vitrage_category": "ALARM",
"vitrage_type": "vitrage",
"name": "Machine Suboptimal",
"state": "Active",
"severity": "CRITICAL",
@ -828,8 +828,8 @@ Response Examples
"normalized_severity": "CRITICAL"
},
{
"category": "ALARM",
"type": "vitrage",
"vitrage_category": "ALARM",
"vitrage_type": "vitrage",
"name": "Machine Suboptimal",
"state": "Active",
"severity": "CRITICAL",
@ -842,8 +842,8 @@ Response Examples
"normalized_severity": "CRITICAL"
},
{
"category": "ALARM",
"type": "aodh",
"vitrage_category": "ALARM",
"vitrage_type": "aodh",
"name": "Memory overload",
"state": "Active",
"severity": "WARNING",
@ -1130,30 +1130,30 @@ Response Examples
"entities": [
{
"entity": {
"category": "ALARM",
"type": "nagios",
"vitrage_category": "ALARM",
"vitrage_type": "nagios",
"name": "check_libvirtd",
"template_id": "alarm_1"
}
},
{
"entity": {
"category": "RESOURCE",
"type": "nova.host",
"vitrage_category": "RESOURCE",
"vitrage_type": "nova.host",
"template_id": "host"
}
},
{
"entity": {
"category": "RESOURCE",
"type": "nova.instance",
"vitrage_category": "RESOURCE",
"vitrage_type": "nova.instance",
"template_id": "instance"
}
},
{
"entity": {
"category": "ALARM",
"type": "vitrage",
"vitrage_category": "ALARM",
"vitrage_type": "vitrage",
"name": "exploding_world",
"template_id": "alarm_2"
}
@ -1317,9 +1317,9 @@ Response Examples
[
{
"vitrage_id": "RESOURCE:nova.host:cloud",
"aggregated_state": "AVAILABLE",
"vitrage_aggregated_state": "AVAILABLE",
"state": "available",
"type": "nova.host",
"vitrage_type": "nova.host",
"id": "cloud",
"metadata": {
"name": "cloud",
@ -1387,14 +1387,14 @@ Response Examples
::
{
"category": "RESOURCE",
"is_placeholder": false,
"is_deleted": false,
"vitrage_category": "RESOURCE",
"vitrage_is_placeholder": false,
"vitrage_is_deleted": false,
"name": "vm-1",
"update_timestamp": "2015-12-01T12:46:41Z",
"state": "ACTIVE",
"project_id": "0683517e1e354d2ba25cba6937f44e79",
"type": "nova.instance",
"vitrage_type": "nova.instance",
"id": "dc35fa2f-4515-1653-ef6b-03b471bb395b",
"vitrage_id": "RESOURCE:nova.instance:dc35fa2f-4515-1653-ef6b-03b471bb395b"
}

View File

@ -294,26 +294,26 @@ Adding/removing a template
Common parameters and their acceptable values - for writing templates
---------------------------------------------------------------------
+-------------------+---------------+-------------------------+------------------------------------+
| block | key | supported values | comments |
+===================+===============+=========================+====================================+
| entity | category | ALARM | |
| | | RESOURCE | |
+-------------------+---------------+-------------------------+------------------------------------+
| entity (ALARM) | type | any string | |
+-------------------+---------------+-------------------------+------------------------------------+
| entity (RESOURCE) | type | openstack.cluster, | These are for the datasources that |
| | | nova.zone, | come with vitrage by default. |
| | | nova.host, | Adding datasources will add more |
| | | nova.instance, | supported types, as defined in the |
| | | cinder.volume, | datasource transformer |
| | | switch | |
+-------------------+---------------+-------------------------+------------------------------------+
| action | action_type | raise_alarm, | |
| | | set_state, | |
| | | add_causal_relationship | |
| | | mark_down | |
+-------------------+---------------+-------------------------+------------------------------------+
+-------------------+-----------------------+-------------------------+------------------------------------+
| block | key | supported values | comments |
+===================+=======================+=========================+====================================+
| entity | category | ALARM | |
| | | RESOURCE | |
+-------------------+-----------------------+-------------------------+------------------------------------+
| entity (ALARM) | type | any string | |
+-------------------+-----------------------+-------------------------+------------------------------------+
| entity (RESOURCE) | type | openstack.cluster, | These are for the datasources that |
| | | nova.zone, | come with vitrage by default. |
| | | nova.host, | Adding datasources will add more |
| | | nova.instance, | supported types, as defined in the |
| | | cinder.volume, | datasource transformer |
| | | switch | |
+-------------------+-----------------------+-------------------------+------------------------------------+
| action | action_type | raise_alarm, | |
| | | set_state, | |
| | | add_causal_relationship | |
| | | mark_down | |
+-------------------+-----------------------+-------------------------+------------------------------------+
Supported Actions

View File

@ -104,8 +104,8 @@ Vitrage configuration
zabbix:
- zabbix_host: Zabbix server
type: nova.host
name: Zabbix server
type: nova.host
name: Zabbix server
4. Restart vitrage service in devstack/openstack

View File

@ -48,10 +48,10 @@ class AlarmApis(EntityGraphApisBase):
is_admin_project)
alarms = set(alarms)
else:
alarms = self.entity_graph.neighbors(
vitrage_id,
vertex_attr_filter={VProps.CATEGORY: EntityCategory.ALARM,
VProps.IS_DELETED: False})
query = {VProps.VITRAGE_CATEGORY: EntityCategory.ALARM,
VProps.VITRAGE_IS_DELETED: False}
alarms = self.entity_graph.neighbors(vitrage_id,
vertex_attr_filter=query)
return json.dumps({'alarms': [v.properties for v in alarms]})

View File

@ -30,15 +30,15 @@ LOG = log.getLogger(__name__)
# Used for Sunburst to show only specific resources
TREE_TOPOLOGY_QUERY = {
'and': [
{'==': {VProps.CATEGORY: EntityCategory.RESOURCE}},
{'==': {VProps.IS_DELETED: False}},
{'==': {VProps.IS_PLACEHOLDER: False}},
{'==': {VProps.VITRAGE_CATEGORY: EntityCategory.RESOURCE}},
{'==': {VProps.VITRAGE_IS_DELETED: False}},
{'==': {VProps.VITRAGE_IS_PLACEHOLDER: False}},
{
'or': [
{'==': {VProps.TYPE: OPENSTACK_CLUSTER}},
{'==': {VProps.TYPE: NOVA_INSTANCE_DATASOURCE}},
{'==': {VProps.TYPE: NOVA_HOST_DATASOURCE}},
{'==': {VProps.TYPE: NOVA_ZONE_DATASOURCE}}
{'==': {VProps.VITRAGE_TYPE: OPENSTACK_CLUSTER}},
{'==': {VProps.VITRAGE_TYPE: NOVA_INSTANCE_DATASOURCE}},
{'==': {VProps.VITRAGE_TYPE: NOVA_HOST_DATASOURCE}},
{'==': {VProps.VITRAGE_TYPE: NOVA_ZONE_DATASOURCE}}
]
}
]
@ -46,12 +46,12 @@ TREE_TOPOLOGY_QUERY = {
TOPOLOGY_AND_ALARMS_QUERY = {
'and': [
{'==': {VProps.IS_DELETED: False}},
{'==': {VProps.IS_PLACEHOLDER: False}},
{'==': {VProps.VITRAGE_IS_DELETED: False}},
{'==': {VProps.VITRAGE_IS_PLACEHOLDER: False}},
{
'or': [
{'==': {VProps.CATEGORY: EntityCategory.ALARM}},
{'==': {VProps.CATEGORY: EntityCategory.RESOURCE}}
{'==': {VProps.VITRAGE_CATEGORY: EntityCategory.ALARM}},
{'==': {VProps.VITRAGE_CATEGORY: EntityCategory.RESOURCE}}
]
}
]
@ -59,31 +59,31 @@ TOPOLOGY_AND_ALARMS_QUERY = {
RCA_QUERY = {
'and': [
{'==': {VProps.CATEGORY: EntityCategory.ALARM}},
{'==': {VProps.IS_DELETED: False}}
{'==': {VProps.VITRAGE_CATEGORY: EntityCategory.ALARM}},
{'==': {VProps.VITRAGE_IS_DELETED: False}}
]
}
ALARMS_ALL_QUERY = {
'and': [
{'==': {VProps.CATEGORY: EntityCategory.ALARM}},
{'==': {VProps.IS_DELETED: False}}
{'==': {VProps.VITRAGE_CATEGORY: EntityCategory.ALARM}},
{'==': {VProps.VITRAGE_IS_DELETED: False}}
]
}
ALARM_QUERY = {
VProps.CATEGORY: EntityCategory.ALARM,
VProps.IS_DELETED: False,
VProps.IS_PLACEHOLDER: False
VProps.VITRAGE_CATEGORY: EntityCategory.ALARM,
VProps.VITRAGE_IS_DELETED: False,
VProps.VITRAGE_IS_PLACEHOLDER: False
}
EDGE_QUERY = {'==': {EProps.IS_DELETED: False}}
EDGE_QUERY = {'==': {EProps.VITRAGE_IS_DELETED: False}}
RESOURCES_ALL_QUERY = {
'and': [
{'==': {VProps.CATEGORY: EntityCategory.RESOURCE}},
{'==': {VProps.IS_DELETED: False}},
{'==': {VProps.IS_PLACEHOLDER: False}}
{'==': {VProps.VITRAGE_CATEGORY: EntityCategory.RESOURCE}},
{'==': {VProps.VITRAGE_IS_DELETED: False}},
{'==': {VProps.VITRAGE_IS_PLACEHOLDER: False}}
]
}
@ -93,13 +93,13 @@ class EntityGraphApisBase(object):
IS_ADMIN_PROJECT_PROPERTY = 'is_admin'
@staticmethod
def _get_query_with_project(category, project_id, is_admin):
def _get_query_with_project(vitrage_category, project_id, is_admin):
"""Generate query with tenant data
Creates query for entity graph which takes into consideration the
category, project_id and if the tenant is admin
vitrage_category, project_id and if the tenant is admin
:type category: string
:type vitrage_category: string
:type project_id: string
:type is_admin: boolean
:rtype: dictionary
@ -107,9 +107,9 @@ class EntityGraphApisBase(object):
query = {
'and': [
{'==': {VProps.IS_DELETED: False}},
{'==': {VProps.IS_PLACEHOLDER: False}},
{'==': {VProps.CATEGORY: category}}
{'==': {VProps.VITRAGE_IS_DELETED: False}},
{'==': {VProps.VITRAGE_IS_PLACEHOLDER: False}},
{'==': {VProps.VITRAGE_CATEGORY: vitrage_category}}
]
}
@ -141,7 +141,7 @@ class EntityGraphApisBase(object):
for alarm in alarms:
alarm_project_id = alarm.get(VProps.PROJECT_ID, None)
if not alarm_project_id:
cat_filter = {VProps.CATEGORY: EntityCategory.RESOURCE}
cat_filter = {VProps.VITRAGE_CATEGORY: EntityCategory.RESOURCE}
alarms_resource = \
self.entity_graph.neighbors(alarm.vertex_id,
vertex_attr_filter=cat_filter)
@ -183,7 +183,7 @@ class EntityGraphApisBase(object):
entities = self.entity_graph.neighbors(entity.vertex_id,
direction=Direction.OUT)
for entity in entities:
if entity[VProps.CATEGORY] == EntityCategory.RESOURCE:
if entity[VProps.VITRAGE_CATEGORY] == EntityCategory.RESOURCE:
resource_project_id = entity.get(VProps.PROJECT_ID)
if resource_project_id == project_id or \
(not resource_project_id and is_admin_project):

View File

@ -47,7 +47,7 @@ class ResourceApis(EntityGraphApisBase):
query = copy.deepcopy(resource_query)
if resource_type:
type_query = {'==': {VProps.TYPE: resource_type}}
type_query = {'==': {VProps.VITRAGE_TYPE: resource_type}}
query['and'].append(type_query)
resources = self.entity_graph.get_vertices(query_dict=query)

View File

@ -65,7 +65,7 @@ class TopologyApis(EntityGraphApisBase):
q = query if query else TOPOLOGY_AND_ALARMS_QUERY
graph = ga.create_graph_from_matching_vertices(
query_dict=q,
edge_attr_filter={VProps.IS_DELETED: False})
edge_attr_filter={VProps.VITRAGE_IS_DELETED: False})
else:
graph = self._get_topology_for_specific_project(
ga,
@ -115,7 +115,7 @@ class TopologyApis(EntityGraphApisBase):
tmp_graph = ga.create_graph_from_matching_vertices(query_dict=q)
graph = self._create_graph_of_connected_components(ga, tmp_graph, root)
edge_query = {EProps.IS_DELETED: False}
edge_query = {EProps.VITRAGE_IS_DELETED: False}
self._remove_unnecessary_elements(ga,
graph,
project_id,
@ -153,7 +153,7 @@ class TopologyApis(EntityGraphApisBase):
for alarm in graph.get_vertices(query_dict=ALARMS_ALL_QUERY):
if not alarm.get(VProps.PROJECT_ID, None):
cat_filter = {VProps.CATEGORY: EntityCategory.RESOURCE}
cat_filter = {VProps.VITRAGE_CATEGORY: EntityCategory.RESOURCE}
resource_neighbors = \
self.entity_graph.neighbors(alarm.vertex_id,
vertex_attr_filter=cat_filter)
@ -220,7 +220,7 @@ class TopologyApis(EntityGraphApisBase):
@staticmethod
def _find_instance_in_graph(graph):
for node, node_data in graph.nodes_iter(data=True):
if node_data[VProps.CATEGORY] == EntityCategory.RESOURCE and \
node_data[VProps.TYPE] == NOVA_INSTANCE_DATASOURCE:
if node_data[VProps.VITRAGE_CATEGORY] == EntityCategory.RESOURCE and \
node_data[VProps.VITRAGE_TYPE] == NOVA_INSTANCE_DATASOURCE:
return node
return None

View File

@ -15,23 +15,24 @@
class VertexProperties(object):
CATEGORY = 'category'
TYPE = 'type'
ID = 'id'
IS_DELETED = 'is_deleted'
STATE = 'state'
VITRAGE_CATEGORY = 'vitrage_category'
VITRAGE_TYPE = 'vitrage_type'
VITRAGE_ID = 'vitrage_id'
VITRAGE_STATE = 'vitrage_state'
AGGREGATED_STATE = 'aggregated_state'
OPERATIONAL_STATE = 'operational_state'
VITRAGE_IS_DELETED = 'vitrage_is_deleted'
VITRAGE_IS_PLACEHOLDER = 'vitrage_is_placeholder'
VITRAGE_SAMPLE_TIMESTAMP = 'vitrage_sample_timestamp'
VITRAGE_AGGREGATED_STATE = 'vitrage_aggregated_state'
VITRAGE_OPERATIONAL_STATE = 'vitrage_operational_state'
VITRAGE_AGGREGATED_SEVERITY = 'vitrage_aggregated_severity'
VITRAGE_OPERATIONAL_SEVERITY = 'vitrage_operational_severity'
VITRAGE_RESOURCE_ID = 'vitrage_resource_id'
ID = 'id'
STATE = 'state'
PROJECT_ID = 'project_id'
UPDATE_TIMESTAMP = 'update_timestamp'
SAMPLE_TIMESTAMP = 'sample_timestamp'
NAME = 'name'
IS_PLACEHOLDER = 'is_placeholder'
SEVERITY = 'severity'
AGGREGATED_SEVERITY = 'aggregated_severity'
OPERATIONAL_SEVERITY = 'operational_severity'
VITRAGE_ID = 'vitrage_id'
IS_MARKED_DOWN = 'is_marked_down'
INFO = 'info'
GRAPH_INDEX = 'graph_index'
@ -45,7 +46,7 @@ class VertexProperties(object):
class EdgeProperties(object):
RELATIONSHIP_TYPE = 'relationship_type'
IS_DELETED = 'is_deleted'
VITRAGE_IS_DELETED = 'vitrage_is_deleted'
UPDATE_TIMESTAMP = 'update_timestamp'

View File

@ -27,8 +27,8 @@ class AlarmDriverBase(DriverBase):
super(DriverBase, self).__init__()
self.cache = dict()
def _entity_type(self):
"""Return the type of the datasource """
def _vitrage_type(self):
"""Return the vitrage_type of the datasource """
pass
def _alarm_key(self, alarm):
@ -74,12 +74,12 @@ class AlarmDriverBase(DriverBase):
def get_all(self, datasource_action):
return self.make_pickleable(self._get_all_alarms(),
self._entity_type(),
self._vitrage_type(),
datasource_action)
def get_changes(self, datasource_action):
return self.make_pickleable(self._get_changed_alarms(),
self._entity_type(),
self._vitrage_type(),
datasource_action)
def _get_all_alarms(self):

View File

@ -42,7 +42,7 @@ class AodhDriver(AlarmDriverBase):
self._client = os_clients.ceilometer_client(self.conf)
return self._client
def _entity_type(self):
def _vitrage_type(self):
return AODH_DATASOURCE
def _alarm_key(self, alarm):

View File

@ -24,6 +24,8 @@ from vitrage.datasources.aodh.properties import AodhProperties as AodhProps
from vitrage.datasources.aodh.properties import AodhState
from vitrage.datasources import transformer_base as tbase
from vitrage.datasources.transformer_base import Neighbor
from vitrage.evaluator.actions.evaluator_event_transformer \
import VITRAGE_DATASOURCE
import vitrage.graph.utils as graph_utils
from vitrage.utils import datetime as datetime_utils
@ -67,18 +69,18 @@ class AodhTransformer(AlarmTransformerBase):
metadata[AodhProps.STATE_TIMESTAMP] = \
entity_event[AodhProps.STATE_TIMESTAMP]
sample_timestamp = entity_event[DSProps.SAMPLE_DATE]
vitrage_sample_timestamp = entity_event[DSProps.SAMPLE_DATE]
update_timestamp = self._format_update_timestamp(
AodhTransformer._timestamp(entity_event), sample_timestamp)
AodhTransformer._timestamp(entity_event), vitrage_sample_timestamp)
return graph_utils.create_vertex(
self._create_entity_key(entity_event),
vitrage_category=EntityCategory.ALARM,
vitrage_type=entity_event[DSProps.ENTITY_TYPE],
vitrage_sample_timestamp=vitrage_sample_timestamp,
entity_id=entity_event[AodhProps.ALARM_ID],
entity_category=EntityCategory.ALARM,
entity_type=entity_event[DSProps.ENTITY_TYPE],
entity_state=self._get_alarm_state(entity_event),
sample_timestamp=sample_timestamp,
update_timestamp=update_timestamp,
metadata=metadata)
@ -110,16 +112,16 @@ class AodhTransformer(AlarmTransformerBase):
AodhProps.DESCRIPTION: entity_event[AodhProps.DESCRIPTION],
VProps.PROJECT_ID: entity_event[AodhProps.PROJECT_ID],
}
sample_timestamp = entity_event[DSProps.SAMPLE_DATE]
vitrage_sample_timestamp = entity_event[DSProps.SAMPLE_DATE]
update_timestamp = self._format_update_timestamp(
AodhTransformer._timestamp(entity_event), sample_timestamp)
AodhTransformer._timestamp(entity_event), vitrage_sample_timestamp)
return graph_utils.create_vertex(
self._create_entity_key(entity_event),
vitrage_category=EntityCategory.ALARM,
vitrage_type=VITRAGE_DATASOURCE,
vitrage_sample_timestamp=vitrage_sample_timestamp,
entity_id=entity_event.get(AodhProps.ALARM_ID),
entity_category=EntityCategory.ALARM,
entity_type='vitrage',
sample_timestamp=sample_timestamp,
update_timestamp=update_timestamp,
metadata=metadata)
@ -148,7 +150,7 @@ class AodhTransformer(AlarmTransformerBase):
return None
return {VProps.ID: affected_resource_id}
def get_type(self):
def get_vitrage_type(self):
return AODH_DATASOURCE

View File

@ -112,15 +112,15 @@ class CinderVolumeTransformer(ResourceTransformerBase):
entity_key = self._create_entity_key(entity_event)
sample_timestamp = entity_event[DSProps.SAMPLE_DATE]
vitrage_sample_timestamp = entity_event[DSProps.SAMPLE_DATE]
return graph_utils.create_vertex(
entity_key,
vitrage_category=EntityCategory.RESOURCE,
vitrage_type=CINDER_VOLUME_DATASOURCE,
vitrage_sample_timestamp=vitrage_sample_timestamp,
entity_id=volume_id,
entity_category=EntityCategory.RESOURCE,
entity_type=CINDER_VOLUME_DATASOURCE,
entity_state=volume_state,
sample_timestamp=sample_timestamp,
update_timestamp=update_timestamp,
metadata=metadata)
@ -159,5 +159,5 @@ class CinderVolumeTransformer(ResourceTransformerBase):
return neighbors
def get_type(self):
def get_vitrage_type(self):
return CINDER_VOLUME_DATASOURCE

View File

@ -37,7 +37,7 @@ class CollectdDriver(AlarmDriverBase):
CollectdDriver.conf_map = \
CollectdDriver._configuration_mapping(conf)
def _entity_type(self):
def _vitrage_type(self):
return COLLECTD_DATASOURCE
def _alarm_key(self, alarm):

View File

@ -45,7 +45,7 @@ class CollectdTransformer(AlarmTransformerBase):
update_timestamp = entity_event['timestamp']
sample_timestamp = entity_event[DSProps.SAMPLE_DATE]
vitrage_sample_timestamp = entity_event[DSProps.SAMPLE_DATE]
entity_state = AlarmProps.INACTIVE_STATE \
if self._ok_status(entity_event) else AlarmProps.ACTIVE_STATE
@ -59,10 +59,10 @@ class CollectdTransformer(AlarmTransformerBase):
return graph_utils.create_vertex(
self._create_entity_key(entity_event),
entity_category=EntityCategory.ALARM,
entity_type=entity_event[DSProps.ENTITY_TYPE],
vitrage_category=EntityCategory.ALARM,
vitrage_type=entity_event[DSProps.ENTITY_TYPE],
vitrage_sample_timestamp=vitrage_sample_timestamp,
entity_state=entity_state,
sample_timestamp=sample_timestamp,
update_timestamp=update_timestamp,
metadata=metadata)
@ -97,7 +97,7 @@ class CollectdTransformer(AlarmTransformerBase):
resource_name,
alarm_id))
def get_type(self):
def get_vitrage_type(self):
return COLLECTD_DATASOURCE
@staticmethod

View File

@ -47,7 +47,7 @@ class ConsistencyTransformer(ResourceTransformerBase):
return graph_utils.create_vertex(
entity_event[VProps.VITRAGE_ID],
sample_timestamp=entity_event[DSProps.SAMPLE_DATE],
vitrage_sample_timestamp=entity_event[DSProps.SAMPLE_DATE],
metadata=metadata
)
@ -60,5 +60,5 @@ class ConsistencyTransformer(ResourceTransformerBase):
def _create_update_neighbors(self, entity_event):
return None
def get_type(self):
def get_vitrage_type(self):
return CONSISTENCY_DATASOURCE

View File

@ -37,7 +37,7 @@ class DoctorDriver(AlarmDriverBase):
self.conf = conf
self._client = None
def _entity_type(self):
def _vitrage_type(self):
return DOCTOR_DATASOURCE
def _alarm_key(self, alarm):

View File

@ -54,10 +54,10 @@ class DoctorTransformer(AlarmTransformerBase):
return graph_utils.create_vertex(
self._create_entity_key(entity_event),
entity_category=EntityCategory.ALARM,
entity_type=entity_event[DSProps.ENTITY_TYPE],
vitrage_category=EntityCategory.ALARM,
vitrage_type=entity_event[DSProps.ENTITY_TYPE],
vitrage_sample_timestamp=entity_event[DSProps.SAMPLE_DATE],
entity_state=self._get_alarm_state(entity_event),
sample_timestamp=entity_event[DSProps.SAMPLE_DATE],
update_timestamp=entity_event[DoctorProps.UPDATE_TIME],
metadata=details)
@ -76,7 +76,7 @@ class DoctorTransformer(AlarmTransformerBase):
entity_event[EventProps.TYPE],
get_detail(entity_event, DoctorDetails.HOSTNAME)))
def get_type(self):
def get_vitrage_type(self):
return DOCTOR_DATASOURCE
def _ok_status(self, entity_event):

View File

@ -91,15 +91,15 @@ class HeatStackTransformer(ResourceTransformerBase):
entity_key = self._create_entity_key(entity_event)
sample_timestamp = entity_event[DSProps.SAMPLE_DATE]
vitrage_sample_timestamp = entity_event[DSProps.SAMPLE_DATE]
return graph_utils.create_vertex(
entity_key,
vitrage_category=EntityCategory.RESOURCE,
vitrage_type=HEAT_STACK_DATASOURCE,
vitrage_sample_timestamp=vitrage_sample_timestamp,
entity_id=stack_id,
entity_category=EntityCategory.RESOURCE,
entity_type=HEAT_STACK_DATASOURCE,
entity_state=stack_state,
sample_timestamp=sample_timestamp,
update_timestamp=update_timestamp,
metadata=metadata)
@ -133,5 +133,5 @@ class HeatStackTransformer(ResourceTransformerBase):
return neighbors
def get_type(self):
def get_vitrage_type(self):
return HEAT_STACK_DATASOURCE

View File

@ -46,7 +46,7 @@ class NagiosConfig(object):
config[NAME])
def get_vitrage_resource(self, nagios_host):
"""Get Vitrage resource type and name for the given nagios host name
"""Get Resource type and name for the given nagios host name
Go over the configuration mappings one by one, and return the resource
by the first mapping that applies to nagios host name.

View File

@ -37,7 +37,7 @@ class NagiosDriver(AlarmDriverBase):
self.conf = conf
self.config = NagiosConfig(conf)
def _entity_type(self):
def _vitrage_type(self):
return NAGIOS_DATASOURCE
def _alarm_key(self, alarm):