designate-2.1.0/0000775000567000056710000000000013053224316014615 5ustar jenkinsjenkins00000000000000designate-2.1.0/contrib/0000775000567000056710000000000013053224316016255 5ustar jenkinsjenkins00000000000000designate-2.1.0/contrib/designate-ext-samplehandler/0000775000567000056710000000000013053224316023633 5ustar jenkinsjenkins00000000000000designate-2.1.0/contrib/designate-ext-samplehandler/setup.cfg0000664000567000056710000000260213053224060025450 0ustar jenkinsjenkins00000000000000[metadata] name = designate-ext-samplehandler version = 2013.2 summary = Sample Designate Handler Extension description-file = README.rst author = Kiall Mac Innes author-email = kiall@hp.com classifier = Environment :: OpenStack Intended Audience :: Information Technology Intended Audience :: System Administrators License :: OSI Approved :: Apache Software License Operating System :: POSIX :: Linux Programming Language :: Python Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 2.6 [global] setup-hooks = pbr.hooks.setup_hook [files] packages = designate_ext_samplehandler [entry_points] designate.notification_handler = sample = designate_ext_samplehandler.notification_handler.sample:SampleHandler [build_sphinx] all_files = 1 build-dir = doc/build source-dir = doc/source [egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 [compile_catalog] directory = designate-ext-samplehandler/locale domain = designate-ext-samplehandler [update_catalog] domain = designate-ext-samplehandler output_dir = designate-ext-samplehandler/locale input_file = designate-ext-samplehandler/locale/designate-ext-samplehandler.pot [extract_messages] keywords = _ gettext ngettext l_ lazy_gettext mapping_file = babel.cfg output_file = designate-ext-samplehandler/locale/designate-ext-samplehandler.pot designate-2.1.0/contrib/designate-ext-samplehandler/setup.py0000775000567000056710000000141513053224057025353 0ustar jenkinsjenkins00000000000000#!/usr/bin/env python # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # 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. # THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT import setuptools setuptools.setup( setup_requires=['pbr'], pbr=True) designate-2.1.0/contrib/designate-ext-samplehandler/MANIFEST.in0000664000567000056710000000031713053224057025374 0ustar jenkinsjenkins00000000000000include AUTHORS include ChangeLog include designate_ext_samplehandler/versioninfo include *.txt *.ini *.cfg *.rst *.md exclude .gitignore exclude .gitreview exclude *.sublime-project global-exclude *.pyc designate-2.1.0/contrib/designate-ext-samplehandler/test-requirements.txt0000664000567000056710000000010313053224057030070 0ustar jenkinsjenkins00000000000000flake8==2.0 hacking>=0.8.0,<0.9 pep8==1.4.5 pyflakes>=0.7.2,<0.7.4 designate-2.1.0/contrib/designate-ext-samplehandler/README.rst0000664000567000056710000000024713053224057025327 0ustar jenkinsjenkins00000000000000Sample Designate Notification Handler Extension =============================================== This repo provides a sample plugin for a custom notification handler. designate-2.1.0/contrib/designate-ext-samplehandler/.gitignore0000664000567000056710000000033413053224057025625 0ustar jenkinsjenkins00000000000000*.pyc *.dat TAGS *.egg *.egg-info build .coverage .tox cover venv .venv *.sublime-workspace *.sqlite var/* etc/*.conf etc/*.ini AUTHORS ChangeLog doc/source/api/* doc/build/* dist designate_ext_samplehandler/versioninfo designate-2.1.0/contrib/designate-ext-samplehandler/designate_ext_samplehandler/0000775000567000056710000000000013053224316031355 5ustar jenkinsjenkins00000000000000././@LongLink0000000000000000000000000000014600000000000011216 Lustar 00000000000000designate-2.1.0/contrib/designate-ext-samplehandler/designate_ext_samplehandler/notification_handler/designate-2.1.0/contrib/designate-ext-samplehandler/designate_ext_samplehandler/notification_handler0000775000567000056710000000000013053224316035461 5ustar jenkinsjenkins00000000000000././@LongLink0000000000000000000000000000016100000000000011213 Lustar 00000000000000designate-2.1.0/contrib/designate-ext-samplehandler/designate_ext_samplehandler/notification_handler/__init__.pydesignate-2.1.0/contrib/designate-ext-samplehandler/designate_ext_samplehandler/notification_handler0000664000567000056710000000000013053224057035453 0ustar jenkinsjenkins00000000000000././@LongLink0000000000000000000000000000015700000000000011220 Lustar 00000000000000designate-2.1.0/contrib/designate-ext-samplehandler/designate_ext_samplehandler/notification_handler/sample.pydesignate-2.1.0/contrib/designate-ext-samplehandler/designate_ext_samplehandler/notification_handler0000664000567000056710000000542013053224060035460 0ustar jenkinsjenkins00000000000000# Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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 oslo_config import cfg from oslo_log import log as logging from designate.objects import Record from designate.notification_handler.base import NotificationHandler LOG = logging.getLogger(__name__) # Setup a config group cfg.CONF.register_group(cfg.OptGroup( name='handler:sample', title="Configuration for Sample Notification Handler" )) # Setup the config options cfg.CONF.register_opts([ cfg.StrOpt('control-exchange', default='nova'), cfg.ListOpt('notification-topics', default=['designate']), cfg.StrOpt('domain-name', default='example.org.'), cfg.StrOpt('domain-id', default='12345'), ], group='handler:sample') class SampleHandler(NotificationHandler): """Sample Handler""" __plugin_name__ = 'sample' def get_exchange_topics(self): """ Return a tuple of (exchange, [topics]) this handler wants to receive events from. """ exchange = cfg.CONF['handler:sample'].control_exchange notification_topics = cfg.CONF['handler:sample'].notification_topics notification_topics = [t + ".info" for t in notification_topics] return (exchange, notification_topics) def get_event_types(self): return [ 'compute.instance.create.end' ] def process_notification(self, context, event_type, payload): # Do something with the notification.. e.g: domain_id = cfg.CONF['handler:sample'].domain_id domain_name = cfg.CONF['handler:sample'].domain_name hostname = '%s.%s' % (payload['instance_id'], domain_name) for fixed_ip in payload['fixed_ips']: if fixed_ip['version'] == 4: values = dict( type='A', name=hostname, data=fixed_ip['address'] ) self.central_api.create_record(domain_id, Record(**values)) elif fixed_ip['version'] == 6: values = dict( type='AAAA', name=hostname, data=fixed_ip['address'] ) self.central_api.create_record(domain_id, Record(**values)) designate-2.1.0/contrib/designate-ext-samplehandler/designate_ext_samplehandler/__init__.py0000664000567000056710000000000013053224057033456 0ustar jenkinsjenkins00000000000000designate-2.1.0/contrib/designate-ext-samplehandler/designate_ext_samplehandler/version.py0000664000567000056710000000134313053224057033417 0ustar jenkinsjenkins00000000000000# Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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. import pbr.version version_info = pbr.version.VersionInfo('designate-ext-samplehandler') designate-2.1.0/contrib/designate-ext-samplehandler/requirements.txt0000664000567000056710000000011613053224057027117 0ustar jenkinsjenkins00000000000000pbr>=0.6,<1.0 -e git+https://github.com/openstack/designate.git#egg=designate designate-2.1.0/contrib/records_mass_create.py0000664000567000056710000000346313053224060022640 0ustar jenkinsjenkins00000000000000#!/usr/bin/env python # Copyright 2015 Hewlett-Packard Development Company, L.P. # # Author: Endre Karlson # # 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. import os import sys import uuid from designateclient import v1 from oslo_config import cfg from oslo_log import log as logging cfg.CONF.register_cli_opts([ cfg.StrOpt("domain_id", help="ID of domain to use."), cfg.IntOpt("records", default=100, help="Records to create (name will be ..") ]) LOG = logging.getLogger(__name__) if __name__ == '__main__': logging.register_options(cfg.CONF) cfg.CONF(sys.argv[1:], project="designate") logging.setup(cfg.CONF, "designate") project_name = os.environ.get( 'OS_PROJECT_NAME', os.environ.get('OS_TENANT_NAME')) client = v1.Client( auth_url=os.environ.get('OS_AUTH_URL'), username=os.environ.get('OS_USERNAME'), password=os.environ.get('OS_PASSWORD'), project_name=project_name ) domain = client.domains.get(cfg.CONF.domain_id) msg = "Creating %s records", cfg.CONF.records LOG.info(msg) for i in range(0, cfg.CONF.records): name = '%s.%s' % (str(uuid.uuid4()), domain.name) record = {"name": name, "type": "A", "data": "10.0.0.1"} client.records.create(domain, record) designate-2.1.0/contrib/dns_dump_raw.py0000775000567000056710000000160513053224057021320 0ustar jenkinsjenkins00000000000000#!/usr/bin/env python # Copyright 2014 Hewlett-Packard Development Company, L.P. # # 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. import sys import binascii import dns import dns.message wire = sys.argv[1] # Prepare the Message message = dns.message.from_wire(binascii.a2b_hex(wire)) # Print the test representation of the message print(message.to_text()) designate-2.1.0/contrib/vagrant/0000775000567000056710000000000013053224316017717 5ustar jenkinsjenkins00000000000000designate-2.1.0/contrib/vagrant/Vagrantfile0000664000567000056710000001045313053224060022103 0ustar jenkinsjenkins00000000000000VAGRANTFILE_API_VERSION = "2" GITCONFIG = `cat $HOME/.gitconfig` Vagrant.require_version ">= 1.5" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.ssh.forward_agent = true config.vm.network "forwarded_port", guest: 5354, host: 5354, protocol: "tcp" config.vm.network "forwarded_port", guest: 5354, host: 5354, protocol: "udp" config.vm.provider "virtualbox" do |vb, override| vb.customize ["modifyvm", :id, "--memory", "2048"] if not RUBY_PLATFORM.downcase.include?("mswin") vb.customize ["modifyvm", :id, "--cpus", `awk "/^processor/ {++n} END {print n}" /proc/cpuinfo 2> /dev/null || sh -c 'sysctl hw.logicalcpu 2> /dev/null || echo ": 2"' | awk \'{print \$2}\' `.chomp ] end vb.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"] override.vm.synced_folder "../..", "/opt/stack/designate" if File.directory?("../../../python-designateclient") override.vm.synced_folder "../../../python-designateclient", "/opt/stack/python-designateclient" end if File.directory?("../../../designate-dashboard") override.vm.synced_folder "../../../designate-dashboard", "/opt/stack/designate-dashboard" end if File.directory?("../../../designate-tempest-plugin") override.vm.synced_folder "../../../designate-tempest-plugin", "/opt/stack/designate-tempest-plugin" end if File.directory?("../../../../openstack/rally") override.vm.synced_folder "../../../../openstack/rally", "/opt/stack/rally" end end config.vm.provider :libvirt do |lv, override| lv.graphics_ip = '0.0.0.0' lv.nested = true lv.memory = 8192 if not RUBY_PLATFORM.downcase.include?("mswin") lv.cpus = `awk "/^processor/ {++n} END {print n}" /proc/cpuinfo 2> /dev/null || sh -c 'sysctl hw.logicalcpu 2> /dev/null || echo ": 2"' | awk \'{print \$2}\' `.chomp end override.vm.synced_folder ".", "/vagrant", type: "nfs" override.vm.synced_folder "../..", "/opt/stack/designate", type: "nfs" if File.directory?("../../../python-designateclient") override.vm.synced_folder "../../../python-designateclient", "/opt/stack/python-designateclient", type: "nfs" end if File.directory?("../../../designate-dashboard") override.vm.synced_folder "../../../designate-dashboard", "/opt/stack/designate-dashboard", type: "nfs" end if File.directory?("../../../designate-tempest-plugin") override.vm.synced_folder "../../../designate-tempest-plugin", "/opt/stack/designate-tempest-plugin", type: "nfs" end if File.directory?("../../../../openstack/rally") override.vm.synced_folder "../../../../openstack/rally", "/opt/stack/rally", type: "nfs" end end $script = <