change normalized state to normalized value

Change-Id: I795995d57234a79935286c37393fd6a48b555bcf
This commit is contained in:
Alexey Weyl 2016-04-11 14:17:17 +03:00
parent fa24ee3c96
commit 623b01cc70
26 changed files with 294 additions and 294 deletions

View File

@ -156,12 +156,12 @@ function configure_vitrage {
cp $VITRAGE_DIR/etc/vitrage/*.sample.json $VITRAGE_CONF_DIR cp $VITRAGE_DIR/etc/vitrage/*.sample.json $VITRAGE_CONF_DIR
# create some folders # create some folders
mkdir -p $VITRAGE_CONF_DIR/datasources_states mkdir -p $VITRAGE_CONF_DIR/datasources_values
mkdir -p $VITRAGE_CONF_DIR/static_datasources mkdir -p $VITRAGE_CONF_DIR/static_datasources
mkdir -p $VITRAGE_CONF_DIR/templates mkdir -p $VITRAGE_CONF_DIR/templates
# copy datasources # copy datasources
cp $VITRAGE_DIR/etc/vitrage/datasources_states/*.yaml $VITRAGE_CONF_DIR/datasources_states cp $VITRAGE_DIR/etc/vitrage/datasources_values/*.yaml $VITRAGE_CONF_DIR/datasources_values
configure_auth_token_middleware $VITRAGE_CONF vitrage $VITRAGE_AUTH_CACHE_DIR configure_auth_token_middleware $VITRAGE_CONF vitrage $VITRAGE_AUTH_CACHE_DIR

View File

@ -25,33 +25,33 @@ The alarm severity configuration is handled via config files. The location of
these files can be determined in **/etc/vitrage/vitrage.conf**. Under the these files can be determined in **/etc/vitrage/vitrage.conf**. Under the
[entity_graph] section, set: [entity_graph] section, set:
+----------------------+------------------------------------+--------------------------------+ +------------------------+------------------------------------+----------------------------------+
| Name | Description | Default Value | | Name | Description | Default Value |
+======================+====================================+================================+ +========================+====================================+==================================+
| states_plugins_dir | Directory path from where to load | /etc/vitrage/states_plugins/ | | datasources_values_dir | Directory path from where to load | /etc/vitrage/datasources_values/ |
| | the states configurations | | | | the values configurations | |
+----------------------+------------------------------------+--------------------------------+ +------------------------+------------------------------------+----------------------------------+
Configure Alarm State Mapping Configure Alarm Severity Mapping
----------------------------- --------------------------------
The alarm severity configuration files configure how the severity of each The alarm severity configuration files configure how the severity of each
alarm is normalized. There are several guidelines for creating a config file: alarm is normalized. There are several guidelines for creating a config file:
- Normalized alarm states which can be mapped to can be found in - Normalized alarm values which can be mapped to can be found in
normalized_alarm_severity.py (NormalizedAlarmSeverity class). normalized_alarm_severity.py (NormalizedAlarmSeverity class).
- Each normalized severity also comes with a priority, so - Each normalized severity also comes with a priority, so
that if an alarm is given different severities from different sources (e.g., that if an alarm is given different severities from different sources (e.g.,
a host alarm raised both by nagios and Vitrage), the severity with the a host alarm raised both by nagios and Vitrage), the severity with the
highest priority will be used as the **aggregated state**. highest priority will be used as the **aggregated severity**.
- The *UNKNOWN* severity will be used for severities with no corresponding - The *UNKNOWN* severity will be used for severities with no corresponding
normalized severity. This severity *must* appear in the config file. normalized severity. This severity *must* appear in the config file.
- The config file is in YAML format. - The config file is in YAML format.
- The config filename must be <datasource name>.yaml, for the relevant - The config filename must be <datasource name>.yaml, for the relevant
datasource. datasource.
- Defining a config file for each datasource is recommended, but not mandatory. - Defining a config file for each datasource is recommended, but not mandatory.
Datasources with no such configuration will use the states as-is. Datasources with no such configuration will use the values as-is.
Default Configuration Default Configuration
@ -68,14 +68,14 @@ Format
:: ::
category: ALARM category: ALARM
states: values:
- normalized state: - normalized value:
name: <normalized alarm severity> name: <normalized alarm severity>
priority: <Alarm severity priority - an integer> priority: <Alarm severity priority - an integer>
original states: original values:
- name: <Original alarm severity name> - name: <Original alarm severity name>
- name: ... # can list several severities for one normalized - name: ... # can list several severities for one normalized
- normalized state: - normalized value:
name: ... # can list several normalized severities name: ... # can list several normalized severities
... ...
@ -87,37 +87,37 @@ Example
+++++++ +++++++
The following file will map alarm severities. The following file will map alarm severities.
Original severities 'CRITICAL' and 'DOWN' will be mapped to normalized state Original severities 'CRITICAL' and 'DOWN' will be mapped to normalized value
'CRITICAL'. Normalized state 'SEVERE' has no original severity. 'CRITICAL'. Normalized value 'SEVERE' has no original severity.
Original state 'WARNING' is mapped to normalized state 'WARNING', etc. Original value 'WARNING' is mapped to normalized value 'WARNING', etc.
:: ::
category: ALARM category: ALARM
states: values:
- normalized state: - normalized value:
name: CRITICAL name: CRITICAL
priority: 50 priority: 50
original states: original values:
- name: CRITICAL - name: CRITICAL
- name: DOWN - name: DOWN
- normalized state: - normalized value:
name: SEVERE name: SEVERE
priority: 40 priority: 40
original states: original values:
- normalized state: - normalized value:
name: WARNING name: WARNING
priority: 30 priority: 30
original states: original values:
- name: WARNING - name: WARNING
- normalized state: - normalized value:
name: UNKNOWN name: UNKNOWN
priority: 20 priority: 20
original states: original values:
- name: UNKNOWN - name: UNKNOWN
- normalized state: - normalized value:
name: OK name: OK
priority: 10 priority: 10
original states: original values:
- name: OK - name: OK
- name: UP - name: UP

View File

@ -7,12 +7,12 @@ Configure Access to Resource State
The following should be set in **/etc/vitrage/vitrage.conf**, under entity_graph section: The following should be set in **/etc/vitrage/vitrage.conf**, under entity_graph section:
+----------------------+------------------------------------+--------------------------------+ +------------------------+------------------------------------+----------------------------------+
| Name | Description | Default Value | | Name | Description | Default Value |
+======================+====================================+================================+ +========================+====================================+==================================+
| states_plugins_dir | Directory path from where to load | /etc/vitrage/states_plugins/ | | datasources_values_dir | Directory path from where to load | /etc/vitrage/datasources_values/ |
| | the states configurations | | | | the values configurations | |
+----------------------+------------------------------------+--------------------------------+ +------------------------+------------------------------------+----------------------------------+
Configure Resource State Mapping Configure Resource State Mapping
@ -29,43 +29,43 @@ State configuration yaml file has to be defined for all the plugins which were c
:: ::
category: RESOURCE category: RESOURCE
states: values:
- normalized state: - normalized value:
name: <Normalized resource state name - must be from NormalizedResourceState class> name: <Normalized resource value name - must be from NormalizedResourcevalue class>
priority: <Resource state priority - an integer> priority: <Resource value priority - an integer>
original states: original values:
- name: <Original resource state name> - name: <Original resource value name>
- name: <Original resource state name> - name: <Original resource value name>
- normalized state: - normalized value:
name: <Normalized resource state name - must be from NormalizedResourceState class> name: <Normalized resource value name - must be from NormalizedResourcevalue class>
priority: <Resource state priority - an integer> priority: <Resource value priority - an integer>
original states: original values:
- name: <Original resource state name> - name: <Original resource value name>
- name: <Original resource state name> - name: <Original resource value name>
... ...
**Example** **Example**
The following is mapping resource states. The following is mapping resource values.
Original states 'DELETED' and 'TERMINATED' will be mapped to normalized state 'TERMINATED'. Original values 'DELETED' and 'TERMINATED' will be mapped to normalized value 'TERMINATED'.
Original states 'ACTIVE' and 'RUNNING' to normalized state 'RUNNING'. Original values 'ACTIVE' and 'RUNNING' to normalized value 'RUNNING'.
:: ::
category: RESOURCE category: RESOURCE
states: values:
- normalized state: - normalized value:
name: TERMINATED name: TERMINATED
priority: 20 priority: 20
original states: original values:
- name: DELETED - name: DELETED
- name: TERMINATED - name: TERMINATED
- normalized state: - normalized value:
name: RUNNING name: RUNNING
priority: 10 priority: 10
original states: original values:
- name: ACTIVE - name: ACTIVE
- name: RUNNING - name: RUNNING
@ -73,7 +73,7 @@ Original states 'ACTIVE' and 'RUNNING' to normalized state 'RUNNING'.
**Default Configuration** **Default Configuration**
Default configurations for resource states will be installed with Vitrage. Default configurations for resource values will be installed with Vitrage.

View File

@ -1,36 +1,36 @@
category: RESOURCE category: RESOURCE
states: values:
- normalized state: - normalized value:
name: ERROR name: ERROR
priority: 50 priority: 50
original states: original values:
- name: ERROR - name: ERROR
- name: ERROR_DELETING - name: ERROR_DELETING
- name: ERROR_RESTORING - name: ERROR_RESTORING
- name: ERROR_EXTENDING - name: ERROR_EXTENDING
- normalized state: - normalized value:
name: UNRECOGNIZED name: UNRECOGNIZED
priority: 40 priority: 40
original states: original values:
- name: UNRECOGNIZED - name: UNRECOGNIZED
- normalized state: - normalized value:
name: TRANSIENT name: TRANSIENT
priority: 30 priority: 30
original states: original values:
- name: CREATING - name: CREATING
- name: ATTACHING - name: ATTACHING
- name: DELETING - name: DELETING
- name: RESTORING-BACKUP - name: RESTORING-BACKUP
- name: BACKING-UP - name: BACKING-UP
- name: DETACHING - name: DETACHING
- normalized state: - normalized value:
name: SUBOPTIMAL name: SUBOPTIMAL
priority: 20 priority: 20
original states: original values:
- name: SUBOPTIMAL - name: SUBOPTIMAL
- normalized state: - normalized value:
name: RUNNING name: RUNNING
priority: 10 priority: 10
original states: original values:
- name: IN-USE - name: IN-USE
- name: AVAILABLE - name: AVAILABLE

View File

@ -1,28 +1,28 @@
category: ALARM category: ALARM
states: values:
- normalized state: - normalized value:
name: CRITICAL name: CRITICAL
priority: 50 priority: 50
original states: original values:
- name: CRITICAL - name: CRITICAL
- name: DOWN - name: DOWN
- normalized state: - normalized value:
name: SEVERE name: SEVERE
priority: 40 priority: 40
original states: original values:
- normalized state: - normalized value:
name: WARNING name: WARNING
priority: 30 priority: 30
original states: original values:
- name: WARNING - name: WARNING
- normalized state: - normalized value:
name: UNKNOWN name: UNKNOWN
priority: 20 priority: 20
original states: original values:
- name: UNKNOWN - name: UNKNOWN
- normalized state: - normalized value:
name: DISABLED name: DISABLED
priority: 10 priority: 10
original states: original values:
- name: OK - name: OK
- name: UP - name: UP

View File

@ -1,26 +1,26 @@
category: RESOURCE category: RESOURCE
states: values:
- normalized state: - normalized value:
name: TERMINATED name: TERMINATED
priority: 50 priority: 50
original states: original values:
- name: DELETED - name: DELETED
- normalized state: - normalized value:
name: ERROR name: ERROR
priority: 40 priority: 40
original states: original values:
- name: ERROR - name: ERROR
- normalized state: - normalized value:
name: UNRECOGNIZED name: UNRECOGNIZED
priority: 30 priority: 30
original states: original values:
- normalized state: - normalized value:
name: SUBOPTIMAL name: SUBOPTIMAL
priority: 20 priority: 20
original states: original values:
- name: SUBOPTIMAL - name: SUBOPTIMAL
- normalized state: - normalized value:
name: RUNNING name: RUNNING
priority: 10 priority: 10
original states: original values:
- name: available - name: available

View File

@ -1,55 +1,55 @@
category: RESOURCE category: RESOURCE
states: values:
- normalized state: - normalized value:
name: TERMINATED name: TERMINATED
priority: 90 priority: 90
original states: original values:
- name: DELETED - name: DELETED
- name: HARD_DELETED - name: HARD_DELETED
- name: SHELVED_OFFLOADED - name: SHELVED_OFFLOADED
- name: SOFT_DELETED - name: SOFT_DELETED
- normalized state: - normalized value:
name: ERROR name: ERROR
priority: 80 priority: 80
original states: original values:
- name: ERROR - name: ERROR
- normalized state: - normalized value:
name: UNRECOGNIZED name: UNRECOGNIZED
priority: 70 priority: 70
original states: original values:
- name: UNRECOGNIZED - name: UNRECOGNIZED
- normalized state: - normalized value:
name: SUSPENDED name: SUSPENDED
priority: 60 priority: 60
original states: original values:
- name: SUSPENDED - name: SUSPENDED
- name: PAUSED - name: PAUSED
- name: STOPPED - name: STOPPED
- name: SHELVED - name: SHELVED
- normalized state: - normalized value:
name: RESCUED name: RESCUED
priority: 50 priority: 50
original states: original values:
- name: RESCUED - name: RESCUED
- normalized state: - normalized value:
name: RESIZED name: RESIZED
priority: 40 priority: 40
original states: original values:
- name: RESIZED - name: RESIZED
- normalized state: - normalized value:
name: TRANSIENT name: TRANSIENT
priority: 30 priority: 30
original states: original values:
- name: BUILDING - name: BUILDING
- name: INITIALIZED - name: INITIALIZED
- normalized state: - normalized value:
name: SUBOPTIMAL name: SUBOPTIMAL
priority: 20 priority: 20
original states: original values:
- name: SUBOPTIMAL - name: SUBOPTIMAL
- normalized state: - normalized value:
name: RUNNING name: RUNNING
priority: 10 priority: 10
original states: original values:
- name: ACTIVE - name: ACTIVE
- name: RESIZED - name: RESIZED

View File

@ -1,26 +1,26 @@
category: RESOURCE category: RESOURCE
states: values:
- normalized state: - normalized value:
name: TERMINATED name: TERMINATED
priority: 50 priority: 50
original states: original values:
- name: DELETED - name: DELETED
- normalized state: - normalized value:
name: ERROR name: ERROR
priority: 40 priority: 40
original states: original values:
- name: ERROR - name: ERROR
- normalized state: - normalized value:
name: UNRECOGNIZED name: UNRECOGNIZED
priority: 30 priority: 30
original states: original values:
- normalized state: - normalized value:
name: SUBOPTIMAL name: SUBOPTIMAL
priority: 20 priority: 20
original states: original values:
- name: SUBOPTIMAL - name: SUBOPTIMAL
- normalized state: - normalized value:
name: RUNNING name: RUNNING
priority: 10 priority: 10
original states: original values:
- name: available - name: available

View File

@ -1,26 +1,26 @@
category: RESOURCE category: RESOURCE
states: values:
- normalized state: - normalized value:
name: TERMINATED name: TERMINATED
priority: 50 priority: 50
original states: original values:
- name: DELETED - name: DELETED
- normalized state: - normalized value:
name: ERROR name: ERROR
priority: 40 priority: 40
original states: original values:
- name: ERROR - name: ERROR
- normalized state: - normalized value:
name: UNRECOGNIZED name: UNRECOGNIZED
priority: 30 priority: 30
original states: original values:
- normalized state: - normalized value:
name: SUBOPTIMAL name: SUBOPTIMAL
priority: 20 priority: 20
original states: original values:
- name: SUBOPTIMAL - name: SUBOPTIMAL
- normalized state: - normalized value:
name: RUNNING name: RUNNING
priority: 10 priority: 10
original states: original values:
- name: available - name: available

View File

@ -1,6 +1,6 @@
category: RESOURCE category: RESOURCE
states: values:
- normalized state: - normalized value:
name: UNRECOGNIZED name: UNRECOGNIZED
priority: 10 priority: 10
original states: original values:

View File

@ -1,26 +1,26 @@
category: RESOURCE category: RESOURCE
states: values:
- normalized state: - normalized value:
name: TERMINATED name: TERMINATED
priority: 50 priority: 50
original states: original values:
- name: DELETED - name: DELETED
- normalized state: - normalized value:
name: ERROR name: ERROR
priority: 40 priority: 40
original states: original values:
- name: ERROR - name: ERROR
- normalized state: - normalized value:
name: UNRECOGNIZED name: UNRECOGNIZED
priority: 30 priority: 30
original states: original values:
- normalized state: - normalized value:
name: SUBOPTIMAL name: SUBOPTIMAL
priority: 20 priority: 20
original states: original values:
- name: SUBOPTIMAL - name: SUBOPTIMAL
- normalized state: - normalized value:
name: RUNNING name: RUNNING
priority: 10 priority: 10
original states: original values:
- name: available - name: available

View File

@ -1,27 +1,27 @@
category: ALARM category: ALARM
states: values:
- normalized state: - normalized value:
name: CRITICAL name: CRITICAL
priority: 50 priority: 50
original states: original values:
- name: CRITICAL - name: CRITICAL
- normalized state: - normalized value:
name: SEVERE name: SEVERE
priority: 40 priority: 40
original states: original values:
- name: SEVERE - name: SEVERE
- normalized state: - normalized value:
name: WARNING name: WARNING
priority: 30 priority: 30
original states: original values:
- name: WARNING - name: WARNING
- normalized state: - normalized value:
name: UNKNOWN name: UNKNOWN
priority: 20 priority: 20
original states: original values:
- name: UNKNOWN - name: UNKNOWN
- normalized state: - normalized value:
name: DISABLED name: DISABLED
priority: 10 priority: 10
original states: original values:
- name: OK - name: OK

View File

@ -237,8 +237,8 @@
# From vitrage # From vitrage
# #
# A path for the configuration files of the data sources states (string value) # A path for the configuration files of the data sources values (string value)
#states_plugins_dir = /etc/vitrage/datasources_states #datasources_values_dir = /etc/vitrage/datasources_values
[evaluator] [evaluator]

View File

@ -17,9 +17,9 @@ from oslo_config import cfg
OPTS = [ OPTS = [
cfg.StrOpt('datasources_states_dir', cfg.StrOpt('datasources_values_dir',
default='/etc/vitrage/datasources_states', default='/etc/vitrage/datasources_values',
help='A path for the configuration files of the data sources' help='A path for the configuration files of the data sources'
' states' ' values'
), ),
] ]

View File

@ -29,7 +29,7 @@ LOG = log.getLogger(__name__)
class StateManager(object): class StateManager(object):
STATES = 'states' VALUES = 'values'
PRIORITIES = 'priorities' PRIORITIES = 'priorities'
def __init__(self, conf): def __init__(self, conf):
@ -46,8 +46,8 @@ class StateManager(object):
states_conf = self.datasources_state_confs[datasource_name] states_conf = self.datasources_state_confs[datasource_name]
return states_conf[self.STATES][upper_state] \ return states_conf[self.VALUES][upper_state] \
if upper_state in states_conf[self.STATES] \ if upper_state in states_conf[self.VALUES] \
else states_conf[important_states.unknown] else states_conf[important_states.unknown]
else: else:
return important_states.undefined return important_states.undefined
@ -115,16 +115,16 @@ class StateManager(object):
erroneous_datasources = [] erroneous_datasources = []
files = file_utils.load_files( files = file_utils.load_files(
self.conf.entity_graph.datasources_states_dir, '.yaml') self.conf.entity_graph.datasources_values_dir, '.yaml')
for file_name in files: for file_name in files:
try: try:
full_path = self.conf.entity_graph.datasources_states_dir \ full_path = self.conf.entity_graph.datasources_values_dir \
+ '/' + file_name + '/' + file_name
states, priorities = \ states, priorities = \
self._retrieve_states_and_priorities_from_file(full_path) self._retrieve_states_and_priorities_from_file(full_path)
ok_datasources[os.path.splitext(file_name)[0]] = { ok_datasources[os.path.splitext(file_name)[0]] = {
self.STATES: states, self.VALUES: states,
self.PRIORITIES: priorities self.PRIORITIES: priorities
} }
except Exception as e: except Exception as e:
@ -145,17 +145,17 @@ class StateManager(object):
config = file_utils.load_yaml_file(full_path, with_exception=True) config = file_utils.load_yaml_file(full_path, with_exception=True)
category = config['category'] category = config['category']
for item in config['states']: for item in config[self.VALUES]:
normalized_state = item['normalized state'] normalized_state = item['normalized value']
# original to normalized state # original to normalized value
normalized_state_name = normalized_state['name'] normalized_state_name = normalized_state['name']
for original_state in normalized_state['original states']: for original_state in normalized_state['original values']:
states[original_state['name'].upper()] = normalized_state_name states[original_state['name'].upper()] = normalized_state_name
self._add_default_states(states, priorities, category) self._add_default_states(states, priorities, category)
# normalized state priority # normalized value priority
priorities[normalized_state_name] = \ priorities[normalized_state_name] = \
int(normalized_state['priority']) int(normalized_state['priority'])
@ -164,8 +164,8 @@ class StateManager(object):
return states, priorities return states, priorities
def _add_default_states(self, states, priorities, category): def _add_default_states(self, states, priorities, category):
default_states = self.category_normalizator[category].default_states() default_values = self.category_normalizator[category].default_states()
for state, priority in default_states: for state, priority in default_values:
states[None] = state states[None] = state
priorities[NormalizedResourceState.UNDEFINED] = priority priorities[NormalizedResourceState.UNDEFINED] = priority
@ -176,14 +176,14 @@ class StateManager(object):
raise ValueError('%s state is not defined in %s', raise ValueError('%s state is not defined in %s',
important_states.unknown, full_path) important_states.unknown, full_path)
# check that all the normalized states exists # check that all the normalized values exists
state_class_instance = \ state_class_instance = \
self.category_normalizator[category].get_state_class_instance() self.category_normalizator[category].get_state_class_instance()
normalized_states = StateManager._get_all_local_variables_of_class( normalized_values = StateManager._get_all_local_variables_of_class(
state_class_instance) state_class_instance)
for key in priorities.keys(): for key in priorities.keys():
if key not in normalized_states: if key not in normalized_values:
raise ValueError('Normalized state %s for %s is not in %s', raise ValueError('normalized value %s for %s is not in %s',
key, full_path, key, full_path,
state_class_instance.__class__.__name__) state_class_instance.__class__.__name__)

View File

@ -1,28 +1,28 @@
category: ALARM category: ALARM
states: values:
- normalized state: - normalized value:
name: CRITICAL name: CRITICAL
priority: 50 priority: 50
original states: original values:
- name: CRITICAL - name: CRITICAL
- name: DOWN - name: DOWN
- normalized state: - normalized value:
name: SEVERE name: SEVERE
priority: 40 priority: 40
original states: original values:
- normalized state: - normalized value:
name: WARNING name: WARNING
priority: 30 priority: 30
original states: original values:
- name: WARNING - name: WARNING
- normalized state: - normalized value:
name: UNKNOWN name: UNKNOWN
priority: 20 priority: 20
original states: original values:
- name: UNKNOWN - name: UNKNOWN
- normalized state: - normalized value:
name: DISABLED name: DISABLED
priority: 10 priority: 10
original states: original values:
- name: OK - name: OK
- name: UP - name: UP

View File

@ -1,23 +1,23 @@
# erroneous yaml file - missing normalized UNRECOGNIZED state # erroneous yaml file - missing normalized UNRECOGNIZED value
category: RESOURCE category: RESOURCE
states: values:
- normalized state: - normalized value:
name: TERMINATED name: TERMINATED
priority: 50 priority: 50
original states: original values:
- name: DELETED - name: DELETED
- normalized state: - normalized value:
name: ERROR name: ERROR
priority: 40 priority: 40
original states: original values:
- name: ERROR - name: ERROR
- normalized state: - normalized value:
name: SUBOPTIMAL name: SUBOPTIMAL
priority: 20 priority: 20
original states: original values:
- name: SUBOPTIMAL - name: SUBOPTIMAL
- normalized state: - normalized value:
name: RUNNING name: RUNNING
priority: 10 priority: 10
original states: original values:
- name: available - name: available

View File

@ -1,56 +1,56 @@
# erroneous yaml file - parsing error in DELETED state # erroneous yaml file - parsing error in DELETED value
category: RESOURCE category: RESOURCE
states: values:
- normalized state: - normalized value:
name: TERMINATED name: TERMINATED
priority: 90 priority: 90
original states: original values:
- name: DELETED - name: DELETED
- name: HARD_DELETED - name: HARD_DELETED
- name: SHELVED_OFFLOADED - name: SHELVED_OFFLOADED
- name: SOFT_DELETED - name: SOFT_DELETED
- normalized state: - normalized value:
name: ERROR name: ERROR
priority: 80 priority: 80
original states: original values:
- name: ERROR - name: ERROR
- normalized state: - normalized value:
name: UNRECOGNIZED name: UNRECOGNIZED
priority: 70 priority: 70
original states: original values:
- name: UNRECOGNIZED - name: UNRECOGNIZED
- normalized state: - normalized value:
name: SUSPENDED name: SUSPENDED
priority: 60 priority: 60
original states: original values:
- name: SUSPENDED - name: SUSPENDED
- name: PAUSED - name: PAUSED
- name: STOPPED - name: STOPPED
- name: SHELVED - name: SHELVED
- normalized state: - normalized value:
name: RESCUED name: RESCUED
priority: 50 priority: 50
original states: original values:
- name: RESCUED - name: RESCUED
- normalized state: - normalized value:
name: RESIZED name: RESIZED
priority: 40 priority: 40
original states: original values:
- name: RESIZED - name: RESIZED
- normalized state: - normalized value:
name: TRANSIENT name: TRANSIENT
priority: 30 priority: 30
original states: original values:
- name: BUILDING - name: BUILDING
- name: INITIALIZED - name: INITIALIZED
- normalized state: - normalized value:
name: SUBOPTIMAL name: SUBOPTIMAL
priority: 20 priority: 20
original states: original values:
- name: SUBOPTIMAL - name: SUBOPTIMAL
- normalized state: - normalized value:
name: RUNNING name: RUNNING
priority: 10 priority: 10
original states: original values:
- name: ACTIVE - name: ACTIVE
- name: RESIZED - name: RESIZED

View File

@ -1,28 +1,28 @@
category: ALARM category: ALARM
states: values:
- normalized state: - normalized value:
name: CRITICAL name: CRITICAL
priority: 50 priority: 50
original states: original values:
- name: CRITICAL - name: CRITICAL
- name: DOWN - name: DOWN
- normalized state: - normalized value:
name: SEVERE name: SEVERE
priority: 40 priority: 40
original states: original values:
- normalized state: - normalized value:
name: WARNING name: WARNING
priority: 30 priority: 30
original states: original values:
- name: WARNING - name: WARNING
- normalized state: - normalized value:
name: UNKNOWN name: UNKNOWN
priority: 20 priority: 20
original states: original values:
- name: UNKNOWN - name: UNKNOWN
- normalized state: - normalized value:
name: DISABLED name: DISABLED
priority: 10 priority: 10
original states: original values:
- name: OK - name: OK
- name: UP - name: UP

View File

@ -1,26 +1,26 @@
category: RESOURCE category: RESOURCE
states: values:
- normalized state: - normalized value:
name: TERMINATED name: TERMINATED
priority: 50 priority: 50
original states: original values:
- name: DELETED - name: DELETED
- normalized state: - normalized value:
name: ERROR name: ERROR
priority: 40 priority: 40
original states: original values:
- name: ERROR - name: ERROR
- normalized state: - normalized value:
name: UNRECOGNIZED name: UNRECOGNIZED
priority: 30 priority: 30
original states: original values:
- normalized state: - normalized value:
name: SUBOPTIMAL name: SUBOPTIMAL
priority: 20 priority: 20
original states: original values:
- name: SUBOPTIMAL - name: SUBOPTIMAL
- normalized state: - normalized value:
name: RUNNING name: RUNNING
priority: 10 priority: 10
original states: original values:
- name: available - name: available

View File

@ -1,55 +1,55 @@
category: RESOURCE category: RESOURCE
states: values:
- normalized state: - normalized value:
name: TERMINATED name: TERMINATED
priority: 90 priority: 90
original states: original values:
- name: DELETED - name: DELETED
- name: HARD_DELETED - name: HARD_DELETED
- name: SHELVED_OFFLOADED - name: SHELVED_OFFLOADED
- name: SOFT_DELETED - name: SOFT_DELETED
- normalized state: - normalized value:
name: ERROR name: ERROR
priority: 80 priority: 80
original states: original values:
- name: ERROR - name: ERROR
- normalized state: - normalized value:
name: UNRECOGNIZED name: UNRECOGNIZED
priority: 70 priority: 70
original states: original values:
- name: UNRECOGNIZED - name: UNRECOGNIZED
- normalized state: - normalized value:
name: SUSPENDED name: SUSPENDED
priority: 60 priority: 60
original states: original values:
- name: SUSPENDED - name: SUSPENDED
- name: PAUSED - name: PAUSED
- name: STOPPED - name: STOPPED
- name: SHELVED - name: SHELVED
- normalized state: - normalized value:
name: RESCUED name: RESCUED
priority: 50 priority: 50
original states: original values:
- name: RESCUED - name: RESCUED
- normalized state: - normalized value:
name: RESIZED name: RESIZED
priority: 40 priority: 40
original states: original values:
- name: RESIZED - name: RESIZED
- normalized state: - normalized value:
name: TRANSIENT name: TRANSIENT
priority: 30 priority: 30
original states: original values:
- name: BUILDING - name: BUILDING
- name: INITIALIZED - name: INITIALIZED
- normalized state: - normalized value:
name: SUBOPTIMAL name: SUBOPTIMAL
priority: 20 priority: 20
original states: original values:
- name: SUBOPTIMAL - name: SUBOPTIMAL
- normalized state: - normalized value:
name: RUNNING name: RUNNING
priority: 10 priority: 10
original states: original values:
- name: ACTIVE - name: ACTIVE
- name: RESIZED - name: RESIZED

View File

@ -1,26 +1,26 @@
category: RESOURCE category: RESOURCE
states: values:
- normalized state: - normalized value:
name: TERMINATED name: TERMINATED
priority: 50 priority: 50
original states: original values:
- name: DELETED - name: DELETED
- normalized state: - normalized value:
name: ERROR name: ERROR
priority: 40 priority: 40
original states: original values:
- name: ERROR - name: ERROR
- normalized state: - normalized value:
name: UNRECOGNIZED name: UNRECOGNIZED
priority: 30 priority: 30
original states: original values:
- normalized state: - normalized value:
name: SUBOPTIMAL name: SUBOPTIMAL
priority: 20 priority: 20
original states: original values:
- name: SUBOPTIMAL - name: SUBOPTIMAL
- normalized state: - normalized value:
name: RUNNING name: RUNNING
priority: 10 priority: 10
original states: original values:
- name: available - name: available

View File

@ -1,29 +1,29 @@
category: ALARM category: ALARM
states: values:
- normalized state: - normalized value:
name: CRITICAL name: CRITICAL
priority: 50 priority: 50
original states: original values:
- name: CRITICAL - name: CRITICAL
- normalized state: - normalized value:
name: SEVERE name: SEVERE
priority: 40 priority: 40
original states: original values:
- name: SEVERE - name: SEVERE
- name: MAJOR - name: MAJOR
- normalized state: - normalized value:
name: WARNING name: WARNING
priority: 30 priority: 30
original states: original values:
- name: WARNING - name: WARNING
- name: MINOR - name: MINOR
- normalized state: - normalized value:
name: UNKNOWN name: UNKNOWN
priority: 20 priority: 20
original states: original values:
- name: UNKNOWN - name: UNKNOWN
- normalized state: - normalized value:
name: DISABLED name: DISABLED
priority: 10 priority: 10
original states: original values:
- name: OK - name: OK

View File

@ -34,8 +34,8 @@ from vitrage.tests.mocks import utils
class TestEntityGraphUnitBase(base.BaseTest): class TestEntityGraphUnitBase(base.BaseTest):
PROCESSOR_OPTS = [ PROCESSOR_OPTS = [
cfg.StrOpt('datasources_states_dir', cfg.StrOpt('datasources_values_dir',
default=utils.get_resources_dir() + '/datasources_states'), default=utils.get_resources_dir() + '/datasources_values'),
] ]
DATASOURCES_OPTS = [ DATASOURCES_OPTS = [

View File

@ -32,8 +32,8 @@ from vitrage.tests.mocks import utils
class TestStateManager(base.BaseTest): class TestStateManager(base.BaseTest):
ENTITY_GRAPH_OPTS = [ ENTITY_GRAPH_OPTS = [
cfg.StrOpt('datasources_states_dir', cfg.StrOpt('datasources_values_dir',
default=utils.get_resources_dir() + '/datasources_states'), default=utils.get_resources_dir() + '/datasources_values'),
] ]
DATASOURCES_OPTS = [ DATASOURCES_OPTS = [
@ -77,9 +77,9 @@ class TestStateManager(base.BaseTest):
def test_load_datasources_state_with_errors(self): def test_load_datasources_state_with_errors(self):
# setup # setup
entity_graph_opts = [ entity_graph_opts = [
cfg.StrOpt('datasources_states_dir', cfg.StrOpt('datasources_values_dir',
default=utils.get_resources_dir() + default=utils.get_resources_dir() +
'/datasources_states/erroneous_states'), '/datasources_values/erroneous_values'),
] ]
conf = cfg.ConfigOpts() conf = cfg.ConfigOpts()
conf.register_opts(entity_graph_opts, group='entity_graph') conf.register_opts(entity_graph_opts, group='entity_graph')
@ -91,9 +91,9 @@ class TestStateManager(base.BaseTest):
# test assertions # test assertions
missing_states = 1 missing_states = 1
erroneous_states = 2 erroneous_values = 2
num_valid_datasources = len(state_manager.datasources_state_confs) + \ num_valid_datasources = len(state_manager.datasources_state_confs) + \
missing_states + erroneous_states missing_states + erroneous_values
self.assertEqual(len(conf.datasources.types), self.assertEqual(len(conf.datasources.types),
num_valid_datasources) num_valid_datasources)

View File

@ -27,8 +27,8 @@ class BaseMock(testtools.TestCase):
"""Base test class for Vitrage API tests.""" """Base test class for Vitrage API tests."""
PROCESSOR_OPTS = [ PROCESSOR_OPTS = [
cfg.StrOpt('states_datasources_dir', cfg.StrOpt('datasources_values_dir',
default=utils.get_resources_dir() + '/datasources_states'), default=utils.get_resources_dir() + '/datasources_values'),
] ]
def create_processor_with_graph(self): def create_processor_with_graph(self):