summaryrefslogtreecommitdiff
path: root/nova/conf/notifications.py
blob: c415eca3758fa367cd19b9ee8d1f12880a09b45b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# Copyright (c) 2016 Intel, Inc.
# Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
#    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.

from oslo_config import cfg

notifications_group = cfg.OptGroup(
    name='notifications',
    title='Notifications options',
    help="""
Most of the actions in Nova which manipulate the system state generate
notifications which are posted to the messaging component (e.g. RabbitMQ) and
can be consumed by any service outside the OpenStack. More technical details
at https://docs.openstack.org/nova/latest/reference/notifications.html
""")

ALL_OPTS = [
    cfg.StrOpt(
        'notify_on_state_change',
        choices=(None, 'vm_state', 'vm_and_task_state'),
        deprecated_group='DEFAULT',
        help="""
If set, send compute.instance.update notifications on
instance state changes.

Please refer to
https://docs.openstack.org/nova/latest/reference/notifications.html for
additional information on notifications.

Possible values:

* None - no notifications
* "vm_state" - notifications are sent with VM state transition information in
  the ``old_state`` and ``state`` fields. The ``old_task_state`` and
  ``new_task_state`` fields will be set to the current task_state of the
  instance.
* "vm_and_task_state" - notifications are sent with VM and task state
  transition information.
"""),

    cfg.StrOpt(
        'default_level',
        default='INFO',
        choices=('DEBUG', 'INFO', 'WARN', 'ERROR', 'CRITICAL'),
        deprecated_group='DEFAULT',
        deprecated_name='default_notification_level',
        help="Default notification level for outgoing notifications."),

    cfg.StrOpt(
        'default_publisher_id',
        default='$host',
        deprecated_group='DEFAULT',
        deprecated_for_removal=True,
        deprecated_since='17.0.0',
        deprecated_reason="""
This option is only used when ``monkey_patch=True`` and
``monkey_patch_modules`` is configured to specify the legacy notify_decorator.
Since the monkey_patch and monkey_patch_modules options are deprecated, this
option is also deprecated.
""",
        help="""
Default publisher_id for outgoing notifications. If you consider routing
notifications using different publisher, change this value accordingly.

Possible values:

* Defaults to the current hostname of this host, but it can be any valid
  oslo.messaging publisher_id

Related options:

*  host - Hostname, FQDN or IP address of this host.
"""),
    cfg.StrOpt(
        'notification_format',
        choices=['unversioned', 'versioned', 'both'],
        default='both',
        deprecated_group='DEFAULT',
        help="""
Specifies which notification format shall be used by nova.

The default value is fine for most deployments and rarely needs to be changed.
This value can be set to 'versioned' once the infrastructure moves closer to
consuming the newer format of notifications. After this occurs, this option
will be removed (possibly in the "P" release).

Possible values:
* unversioned: Only the legacy unversioned notifications are emitted.
* versioned: Only the new versioned notifications are emitted.
* both: Both the legacy unversioned and the new versioned notifications are
  emitted. (Default)

The list of versioned notifications is visible in
https://docs.openstack.org/nova/latest/reference/notifications.html
"""),
    cfg.ListOpt(
        'versioned_notifications_topics',
        default=['versioned_notifications'],
        help="""
Specifies the topics for the versioned notifications issued by nova.

The default value is fine for most deployments and rarely needs to be changed.
However, if you have a third-party service that consumes versioned
notifications, it might be worth getting a topic for that service.
Nova will send a message containing a versioned notification payload to each
topic queue in this list.

The list of versioned notifications is visible in
https://docs.openstack.org/nova/latest/reference/notifications.html
"""),
    cfg.BoolOpt(
        'bdms_in_notifications',
        default=False,
        help="""
If enabled, include block device information in the versioned notification
payload. Sending block device information is disabled by default as providing
that information can incur some overhead on the system since the information
may need to be loaded from the database.
""")
]


def register_opts(conf):
    conf.register_group(notifications_group)
    conf.register_opts(ALL_OPTS, group=notifications_group)


def list_opts():
    return {notifications_group: ALL_OPTS}