Exemple #1
0
#
#      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 moniker.openstack.common import cfg
from moniker.openstack.common import log as logging
from moniker.notification_handler.base import BaseAddressHandler

LOG = logging.getLogger(__name__)

cfg.CONF.register_group(
    cfg.OptGroup(name='handler:quantum_floatingip',
                 title="Configuration for Quantum Notification Handler"))

cfg.CONF.register_opts([
    cfg.ListOpt('notification-topics', default=['monitor']),
    cfg.StrOpt('control-exchange', default='quantum'),
    cfg.StrOpt('domain-id', default=None),
    cfg.StrOpt('format', default=None)
],
                       group='handler:quantum_floatingip')


class QuantumFloatingHandler(BaseAddressHandler):
    """ Handler for Quantum's notifications """
    __plugin_name__ = 'quantum_floatingip'

    def get_exchange_topics(self):
Exemple #2
0
# Copyright 2012 Hewlett-Packard Development Company, L.P. All Rights Reserved.
#
# Author: Kiall Mac Innes <*****@*****.**>
#
# 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 moniker.openstack.common import cfg

cfg.CONF.register_group(
    cfg.OptGroup(name='service:agent',
                 title="Configuration for Agent Service"))

cfg.CONF.register_opts([
    cfg.IntOpt(
        'workers', default=None, help='Number of worker processes to spawn'),
    cfg.StrOpt(
        'backend-driver', default='bind9', help='The backend driver to use'),
],
                       group='service:agent')
Exemple #3
0
    'vn', 'vu', 'wf', 'ws', 'xn--0zwm56d', 'xn--11b5bs3a9aj6g', 'xn--3e0b707e',
    'xn--45brj9c', 'xn--80akhbyknj4f', 'xn--80ao21a', 'xn--90a3ac',
    'xn--9t4b11yi5a', 'xn--clchc0ea0b2g2a9gcd', 'xn--deba0ad', 'xn--fiqs8s',
    'xn--fiqz9s', 'xn--fpcrj9c3d', 'xn--fzc2c9e2c', 'xn--g6w251d',
    'xn--gecrj9c', 'xn--h2brj9c', 'xn--hgbk6aj7f53bba', 'xn--hlcj6aya9esc7a',
    'xn--j6w193g', 'xn--jxalpdlp', 'xn--kgbechtv', 'xn--kprw13d',
    'xn--kpry57d', 'xn--lgbbat1ad8j', 'xn--mgb9awbf', 'xn--mgbaam7a8h',
    'xn--mgbayh7gpa', 'xn--mgbbh1a71e', 'xn--mgbc0a9azcg', 'xn--mgberp4a5d4ar',
    'xn--mgbx4cd0ab', 'xn--o3cw4h', 'xn--ogbpf8fl', 'xn--p1ai', 'xn--pgbs0dh',
    'xn--s9brj9c', 'xn--wgbh1c', 'xn--wgbl6a', 'xn--xkc2al3hye2a',
    'xn--xkc2dl3a5ee0h', 'xn--yfro4i67o', 'xn--ygbi2ammx', 'xn--zckzah', 'xxx',
    'ye', 'yt', 'za', 'zm', 'zw'
]

cfg.CONF.register_group(
    cfg.OptGroup(name='service:central',
                 title="Configuration for Central Service"))

cfg.CONF.register_opts([
    cfg.IntOpt(
        'workers', default=None, help='Number of worker processes to spawn'),
    cfg.StrOpt(
        'backend-driver', default='fake', help='The backend driver to use'),
    cfg.StrOpt('storage-driver',
               default='sqlalchemy',
               help='The storage driver to use'),
    cfg.StrOpt(
        'quota-driver', default='storage', help='The quota driver to use'),
    cfg.ListOpt('enabled-notification-handlers',
                default=[],
                help='Enabled Notification Handlers'),
    cfg.ListOpt('domain-name-blacklist',
Exemple #4
0
#
#      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 moniker.openstack.common import cfg
from moniker.openstack.common import log as logging
from moniker.notification_handler.base import BaseAddressHandler

LOG = logging.getLogger(__name__)

cfg.CONF.register_group(
    cfg.OptGroup(name='handler:nova_fixed',
                 title="Configuration for Nova Notification Handler"))

cfg.CONF.register_opts([
    cfg.ListOpt('notification-topics', default=['monitor']),
    cfg.StrOpt('control-exchange', default='nova'),
    cfg.StrOpt('domain-id', default=None),
    cfg.StrOpt('format', default=None)
],
                       group='handler:nova_fixed')


class NovaFixedHandler(BaseAddressHandler):
    """ Handler for Nova's notifications """
    __plugin_name__ = 'nova_fixed'

    def get_exchange_topics(self):
Exemple #5
0
from moniker.openstack.common import cfg
from moniker.openstack.common import context as req_context
from moniker.openstack.common.gettextutils import _
from moniker.openstack.common import log as logging
from moniker.openstack.common import rpc

LOG = logging.getLogger(__name__)

notification_topic_opt = cfg.ListOpt(
    'topics',
    default=[
        'notifications',
    ],
    help='AMQP topic(s) used for openstack notifications')

opt_group = cfg.OptGroup(name='rpc_notifier2',
                         title='Options for rpc_notifier2')

CONF = cfg.CONF
CONF.register_group(opt_group)
CONF.register_opt(notification_topic_opt, opt_group)


def notify(context, message):
    """Sends a notification via RPC"""
    if not context:
        context = req_context.get_admin_context()
    priority = message.get('priority', CONF.default_notification_level)
    priority = priority.lower()
    for topic in CONF.rpc_notifier2.topics:
        topic = '%s.%s' % (topic, priority)
        try:
Exemple #6
0
# License for the specific language governing permissions and limitations
# under the License.
import time
from sqlalchemy.orm import exc
from sqlalchemy import distinct, func
from moniker.openstack.common import cfg
from moniker.openstack.common import log as logging
from moniker import exceptions
from moniker.storage import base
from moniker.storage.impl_sqlalchemy import models
from moniker.sqlalchemy.session import get_session, get_engine, SQLOPTS

LOG = logging.getLogger(__name__)

cfg.CONF.register_group(
    cfg.OptGroup(name='storage:sqlalchemy',
                 title="Configuration for SQLAlchemy Storage"))

cfg.CONF.register_opts(SQLOPTS, group='storage:sqlalchemy')


class SQLAlchemyStorage(base.Storage):
    """ SQLAlchemy connection """
    __plugin_name__ = 'sqlalchemy'

    def __init__(self):
        super(SQLAlchemyStorage, self).__init__()

        self.engine = get_engine(self.name)
        self.session = get_session(self.name)

    def setup_schema(self):
Exemple #7
0
from sqlalchemy.sql import select
from sqlalchemy.sql.expression import null
from sqlalchemy.orm import exc as sqlalchemy_exceptions
from moniker.openstack.common import cfg
from moniker.openstack.common import log as logging
from moniker import exceptions
from moniker.backend import base
from moniker.backend.impl_powerdns import models
from moniker.sqlalchemy.session import get_session, SQLOPTS
from moniker.sqlalchemy.expressions import InsertFromSelect

LOG = logging.getLogger(__name__)
TSIG_SUPPORTED_ALGORITHMS = ['hmac-md5']

cfg.CONF.register_group(
    cfg.OptGroup(name='backend:powerdns',
                 title="Configuration for Powerdns Backend"))

cfg.CONF.register_opts([
    cfg.StrOpt('domain-type', default='NATIVE', help='PowerDNS Domain Type'),
    cfg.ListOpt('also-notify',
                default=[],
                help='List of additional IPs to '
                'send NOTIFYs to'),
] + SQLOPTS,
                       group='backend:powerdns')


class PowerDNSBackend(base.Backend):
    __plugin_name__ = 'powerdns'

    def start(self):
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import os
from moniker.openstack.common import cfg
from moniker.openstack.common import log as logging
from moniker import utils
from moniker.backend import base
from sqlalchemy.ext.sqlsoup import SqlSoup
from sqlalchemy.engine.url import _parse_rfc1738_args
from moniker.sqlalchemy.session import get_engine, SQLOPTS

LOG = logging.getLogger(__name__)

cfg.CONF.register_group(cfg.OptGroup(
    name='backend:mysqlbind9', title="Configuration for BIND9+MySQL Backend"
))

cfg.CONF.register_opts([
    cfg.StrOpt('rndc-host', default='127.0.0.1', help='RNDC Host'),
    cfg.IntOpt('rndc-port', default=953, help='RNDC Port'),
    cfg.StrOpt('rndc-config-file',
               default=None, help='RNDC Config File'),
    cfg.StrOpt('rndc-key-file', default=None, help='RNDC Key File'),
    cfg.StrOpt('dns-server-type', default='master',
               help='slave or master DNS server?'),
    cfg.BoolOpt('write-database', default=True,
                help='Write to the DNS mysqlbind database?'),
    cfg.StrOpt('database-dns-table',
               default='dns_domains',
               help='DNS schema'),
Exemple #9
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.
import os
from moniker.openstack.common import cfg
from moniker.openstack.common import log as logging
from moniker import utils
from moniker.backend import base

LOG = logging.getLogger(__name__)

cfg.CONF.register_group(
    cfg.OptGroup(name='backend:bind9',
                 title="Configuration for BIND9 Backend"))

cfg.CONF.register_opts([
    cfg.StrOpt('rndc-host', default='127.0.0.1', help='RNDC Host'),
    cfg.IntOpt('rndc-port', default=953, help='RNDC Port'),
    cfg.StrOpt('rndc-config-file', default=None, help='RNDC Config File'),
    cfg.StrOpt('rndc-key-file', default=None, help='RNDC Key File'),
],
                       group='backend:bind9')


class Bind9Backend(base.Backend):
    __plugin_name__ = 'bind9'

    def start(self):
        super(Bind9Backend, self).start()
Exemple #10
0
# Copyright 2012 Hewlett-Packard Development Company, L.P. All Rights Reserved.
#
# Author: Kiall Mac Innes <*****@*****.**>
#
# 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 moniker.openstack.common import cfg

cfg.CONF.register_group(cfg.OptGroup(
    name='service:sink', title="Configuration for Sink Service"
))

cfg.CONF.register_opts([
    cfg.IntOpt('workers', default=None,
               help='Number of worker processes to spawn'),
    cfg.ListOpt('enabled-notification-handlers', default=[],
                help='Enabled Notification Handlers'),
], group='service:sink')
Exemple #11
0
# 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.
import flask
from moniker.openstack.common import cfg
from moniker.openstack.common import jsonutils as json

cfg.CONF.register_group(
    cfg.OptGroup(name='service:api', title="Configuration for API Service"))

cfg.CONF.register_opts([
    cfg.IntOpt(
        'workers', default=None, help='Number of worker processes to spawn'),
    cfg.StrOpt('api_host', default='0.0.0.0', help='API Host'),
    cfg.IntOpt('api_port', default=9001, help='API Port Number'),
    cfg.StrOpt('api_paste_config',
               default='api-paste.ini',
               help='File name for the paste.deploy config for moniker-api'),
    cfg.StrOpt('auth_strategy',
               default='noauth',
               help='The strategy to use for auth. Supports noauth or '
               'keystone'),
],
                       group='service:api')