# 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): exchange = cfg.CONF[self.name].control_exchange topics = [
help='Size of RPC thread pool'), cfg.IntOpt('rpc_conn_pool_size', default=30, help='Size of RPC connection pool'), cfg.IntOpt('rpc_response_timeout', default=60, help='Seconds to wait for a response from call or multicall'), cfg.IntOpt('rpc_cast_timeout', default=30, help='Seconds to wait before a cast expires (TTL). ' 'Only supported by impl_zmq.'), cfg.ListOpt('allowed_rpc_exception_modules', default=[ 'moniker.openstack.common.exception', 'nova.exception', 'cinder.exception', 'exceptions', ], help='Modules of exceptions that are permitted to be recreated' 'upon receiving exception data from an rpc call.'), cfg.BoolOpt('fake_rabbit', default=False, help='If passed, use a fake RabbitMQ provider'), cfg.StrOpt('control_exchange', default='openstack', help='AMQP exchange to connect to if using RabbitMQ or Qpid'), ] cfg.CONF.register_opts(rpc_opts)
help='SSL key file (valid only if SSL enabled)'), cfg.StrOpt('kombu_ssl_certfile', default='', help='SSL cert file (valid only if SSL enabled)'), cfg.StrOpt('kombu_ssl_ca_certs', default='', help=('SSL certification authority file ' '(valid only if SSL enabled)')), cfg.StrOpt('rabbit_host', default='localhost', help='The RabbitMQ broker address where a single node is used'), cfg.IntOpt('rabbit_port', default=5672, help='The RabbitMQ broker port where a single node is used'), cfg.ListOpt('rabbit_hosts', default=['$rabbit_host:$rabbit_port'], help='RabbitMQ HA cluster host:port pairs'), cfg.BoolOpt('rabbit_use_ssl', default=False, help='connect over SSL for RabbitMQ'), cfg.StrOpt('rabbit_userid', default='guest', help='the RabbitMQ userid'), cfg.StrOpt('rabbit_password', default='guest', help='the RabbitMQ password'), cfg.StrOpt('rabbit_virtual_host', default='/', help='the RabbitMQ virtual host'), cfg.IntOpt('rabbit_retry_interval', default=1, help='how frequently to retry connecting with RabbitMQ'), cfg.IntOpt('rabbit_retry_backoff',
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', default=[ '\\.arpa\\.$', '\\.novalocal\\.$', '\\.localhost\\.$', '\\.localdomain\\.$', '\\.local\\.$' ], help='DNS domain name blacklist'), cfg.ListOpt('accepted-tld-list', default=IANA_TLDS, help='Accepted TLDs'), cfg.IntOpt( 'max_domain_name_len', default=255, help="Maximum domain name length"), cfg.IntOpt( 'max_record_name_len', default=255, help="Maximum record name length"), ], group='service:central')
'%(user_id)s %(project_id)s] %(instance)s' '%(message)s', help='format string to use for log messages with context'), cfg.StrOpt('logging_default_format_string', default='%(asctime)s %(process)d %(levelname)s %(name)s [-]' ' %(instance)s%(message)s', help='format string to use for log messages without context'), cfg.StrOpt('logging_debug_format_suffix', default='%(funcName)s %(pathname)s:%(lineno)d', help='data to append to log format when level is DEBUG'), cfg.StrOpt('logging_exception_prefix', default='%(asctime)s %(process)d TRACE %(name)s %(instance)s', help='prefix each line of exception output with this format'), cfg.ListOpt('default_log_levels', default=[ 'amqplib=WARN', 'sqlalchemy=WARN', 'boto=WARN', 'suds=INFO', 'keystone=INFO', 'eventlet.wsgi.server=WARN' ], help='list of logger=LEVEL pairs'), cfg.BoolOpt('publish_errors', default=False, help='publish error events'), # NOTE(mikal): there are two options here because sometimes we are handed # a full instance (and could include more information), and other times we # are just handed a UUID for the instance. cfg.StrOpt('instance_format', default='[instance: %(uuid)s] ', help='If an instance is passed with the log message, format ' 'it like this'), cfg.StrOpt('instance_uuid_format', default='[instance: %(uuid)s] ', help='If an instance UUID is passed with the log message, ' 'format it like this'),
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. '''messaging based notification driver, with message envelopes''' 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()
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): super(PowerDNSBackend, self).start() self.session = get_session(self.name) # TSIG Key Methods def create_tsigkey(self, context, tsigkey):
import flask import webob.dec from stevedore import extension from stevedore import named from werkzeug import exceptions as wexceptions from moniker.openstack.common import cfg from moniker.openstack.common import jsonutils as json from moniker.openstack.common import log as logging from moniker.openstack.common.rpc import common as rpc_common from moniker import exceptions from moniker import wsgi LOG = logging.getLogger(__name__) cfg.CONF.register_opts([ cfg.ListOpt('enabled-extensions-v1', default=[], help='Enabled API Extensions'), ], group='service:api') def factory(global_config, **local_conf): app = flask.Flask('moniker.api.v1') app.config.update( PROPAGATE_EXCEPTIONS=True ) # Ensure all error responses are JSON def _json_error(ex): code = ex.code if isinstance(ex, wexceptions.HTTPException) else 500 response = { 'code': code
from moniker.openstack.common.rpc import common as rpc_common qpid_messaging = importutils.try_import("qpid.messaging") qpid_exceptions = importutils.try_import("qpid.messaging.exceptions") LOG = logging.getLogger(__name__) qpid_opts = [ cfg.StrOpt('qpid_hostname', default='localhost', help='Qpid broker hostname'), cfg.StrOpt('qpid_port', default='5672', help='Qpid broker port'), cfg.ListOpt('qpid_hosts', default=['$qpid_hostname:$qpid_port'], help='Qpid HA cluster host:port pairs'), cfg.StrOpt('qpid_username', default='', help='Username for qpid connection'), cfg.StrOpt('qpid_password', default='', help='Password for qpid connection'), cfg.StrOpt('qpid_sasl_mechanisms', default='', help='Space separated list of SASL mechanisms to use for auth'), cfg.IntOpt('qpid_heartbeat', default=60, help='Seconds between connection keepalive heartbeats'), cfg.StrOpt('qpid_protocol', default='tcp',
# 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')