blob: 7eb1f851b4cf9efa3932271db8909ad9685d2a9d [file] [log] [blame]
Oleksiy Petrenko5013e682018-11-16 14:26:36 +02001try:
2 import os_client_config # noqa
3 from keystoneauth1 import exceptions as ka_exceptions # noqa
4 REQUIREMENTS_MET = True
5except ImportError:
6 REQUIREMENTS_MET = False
7
8from aodhv2 import lists
9from aodhv2 import alarms
10
11alarm_list = lists.alarm_list
12alarm_create = alarms.alarm_create
13alarm_get_details = alarms.alarm_get_details
14alarm_update = alarms.alarm_update
15alarm_delete = alarms.alarm_delete
16alarm_history_get = alarms.alarm_history_get
17alarm_state_set = alarms.alarm_state_set
18alarm_state_get = alarms.alarm_state_get
19
20
21__all__ = ('alarm_list', 'alarm_create', 'alarm_delete', 'alarm_get_details',
22 'alarm_history_get', 'alarm_state_get', 'alarm_state_set',
23 'alarm_update')
24
25
26def __virtual__():
27 """Only load aodhv2 if requirements are available."""
28 if REQUIREMENTS_MET:
29 return 'aodhv2'
30 else:
31 return False, ("The aodhv2 execution module cannot be loaded: "
32 "os_client_config or keystoneauth are unavailable.")