aboutsummaryrefslogtreecommitdiffstats
path: root/keystone-moon/keystone/contrib/example
diff options
context:
space:
mode:
Diffstat (limited to 'keystone-moon/keystone/contrib/example')
-rw-r--r--keystone-moon/keystone/contrib/example/__init__.py0
-rw-r--r--keystone-moon/keystone/contrib/example/configuration.rst31
-rw-r--r--keystone-moon/keystone/contrib/example/controllers.py26
-rw-r--r--keystone-moon/keystone/contrib/example/core.py97
-rw-r--r--keystone-moon/keystone/contrib/example/migrate_repo/__init__.py0
-rw-r--r--keystone-moon/keystone/contrib/example/migrate_repo/migrate.cfg25
-rw-r--r--keystone-moon/keystone/contrib/example/migrate_repo/versions/001_example_table.py32
-rw-r--r--keystone-moon/keystone/contrib/example/migrate_repo/versions/__init__.py0
-rw-r--r--keystone-moon/keystone/contrib/example/routers.py38
9 files changed, 0 insertions, 249 deletions
diff --git a/keystone-moon/keystone/contrib/example/__init__.py b/keystone-moon/keystone/contrib/example/__init__.py
deleted file mode 100644
index e69de29b..00000000
--- a/keystone-moon/keystone/contrib/example/__init__.py
+++ /dev/null
diff --git a/keystone-moon/keystone/contrib/example/configuration.rst b/keystone-moon/keystone/contrib/example/configuration.rst
deleted file mode 100644
index 979d3457..00000000
--- a/keystone-moon/keystone/contrib/example/configuration.rst
+++ /dev/null
@@ -1,31 +0,0 @@
-..
- Copyright 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.
-
-=================
-Extension Example
-=================
-
-Please describe here in details how to enable your extension:
-
-1. Add the required fields and values in the ``[example]`` section
- in ``keystone.conf``.
-
-2. Optional: add the required ``filter`` to the ``pipeline`` in ``keystone-paste.ini``
-
-3. Optional: create the extension tables if using the provided sql backend. Example::
-
-
- ./bin/keystone-manage db_sync --extension example \ No newline at end of file
diff --git a/keystone-moon/keystone/contrib/example/controllers.py b/keystone-moon/keystone/contrib/example/controllers.py
deleted file mode 100644
index 95b3e82f..00000000
--- a/keystone-moon/keystone/contrib/example/controllers.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2013 OpenStack Foundation
-#
-# 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 keystone.common import controller
-from keystone.common import dependency
-
-
-@dependency.requires('example_api')
-class ExampleV3Controller(controller.V3Controller):
-
- @controller.protected()
- def example_get(self, context):
- """Description of the controller logic."""
- self.example_api.do_something(context)
diff --git a/keystone-moon/keystone/contrib/example/core.py b/keystone-moon/keystone/contrib/example/core.py
deleted file mode 100644
index e369dc4d..00000000
--- a/keystone-moon/keystone/contrib/example/core.py
+++ /dev/null
@@ -1,97 +0,0 @@
-# Copyright 2013 OpenStack Foundation
-#
-# 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.
-
-"""Main entry point into this Example service."""
-
-from oslo_log import log
-
-from keystone.common import dependency
-from keystone.common import manager
-from keystone import exception
-from keystone.i18n import _LI
-from keystone import notifications
-
-
-LOG = log.getLogger(__name__)
-
-
-@notifications.listener # NOTE(dstanek): only needed if using event_callbacks
-@dependency.provider('example_api')
-class ExampleManager(manager.Manager):
- """Default pivot point for this Example backend.
-
- See :mod:`keystone.common.manager.Manager` for more details on
- how this dynamically calls the backend.
-
- """
-
- driver_namespace = 'keystone.example'
-
- def __init__(self):
- # The following is an example of event callbacks. In this setup,
- # ExampleManager's data model is depended on project's data model.
- # It must create additional aggregates when a new project is created,
- # and it must cleanup data related to the project whenever a project
- # has been deleted.
- #
- # In this example, the project_deleted_callback will be invoked
- # whenever a project has been deleted. Similarly, the
- # project_created_callback will be invoked whenever a new project is
- # created.
-
- # This information is used when the @notifications.listener decorator
- # acts on the class.
- self.event_callbacks = {
- notifications.ACTIONS.deleted: {
- 'project': [self.project_deleted_callback],
- },
- notifications.ACTIONS.created: {
- 'project': [self.project_created_callback],
- },
- }
- super(ExampleManager, self).__init__(
- 'keystone.contrib.example.core.ExampleDriver')
-
- def project_deleted_callback(self, service, resource_type, operation,
- payload):
- # The code below is merely an example.
- msg = _LI('Received the following notification: service %(service)s, '
- 'resource_type: %(resource_type)s, operation %(operation)s '
- 'payload %(payload)s')
- LOG.info(msg, {'service': service, 'resource_type': resource_type,
- 'operation': operation, 'payload': payload})
-
- def project_created_callback(self, service, resource_type, operation,
- payload):
- # The code below is merely an example.
- msg = _LI('Received the following notification: service %(service)s, '
- 'resource_type: %(resource_type)s, operation %(operation)s '
- 'payload %(payload)s')
- LOG.info(msg, {'service': service, 'resource_type': resource_type,
- 'operation': operation, 'payload': payload})
-
-
-class ExampleDriver(object):
- """Interface description for Example driver."""
-
- def do_something(self, data):
- """Do something
-
- :param data: example data
- :type data: string
- :raises: keystone.exception,
- :returns: None.
-
- """
- raise exception.NotImplemented()
diff --git a/keystone-moon/keystone/contrib/example/migrate_repo/__init__.py b/keystone-moon/keystone/contrib/example/migrate_repo/__init__.py
deleted file mode 100644
index e69de29b..00000000
--- a/keystone-moon/keystone/contrib/example/migrate_repo/__init__.py
+++ /dev/null
diff --git a/keystone-moon/keystone/contrib/example/migrate_repo/migrate.cfg b/keystone-moon/keystone/contrib/example/migrate_repo/migrate.cfg
deleted file mode 100644
index 5b1b1c0a..00000000
--- a/keystone-moon/keystone/contrib/example/migrate_repo/migrate.cfg
+++ /dev/null
@@ -1,25 +0,0 @@
-[db_settings]
-# Used to identify which repository this database is versioned under.
-# You can use the name of your project.
-repository_id=example
-
-# The name of the database table used to track the schema version.
-# This name shouldn't already be used by your project.
-# If this is changed once a database is under version control, you'll need to
-# change the table name in each database too.
-version_table=migrate_version
-
-# When committing a change script, Migrate will attempt to generate the
-# sql for all supported databases; normally, if one of them fails - probably
-# because you don't have that database installed - it is ignored and the
-# commit continues, perhaps ending successfully.
-# Databases in this list MUST compile successfully during a commit, or the
-# entire commit will fail. List the databases your application will actually
-# be using to ensure your updates to that database work properly.
-# This must be a list; example: ['postgres','sqlite']
-required_dbs=[]
-
-# When creating new change scripts, Migrate will stamp the new script with
-# a version number. By default this is latest_version + 1. You can set this
-# to 'true' to tell Migrate to use the UTC timestamp instead.
-use_timestamp_numbering=False
diff --git a/keystone-moon/keystone/contrib/example/migrate_repo/versions/001_example_table.py b/keystone-moon/keystone/contrib/example/migrate_repo/versions/001_example_table.py
deleted file mode 100644
index 35061780..00000000
--- a/keystone-moon/keystone/contrib/example/migrate_repo/versions/001_example_table.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright 2012 OpenStack Foundation
-#
-# 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 sqlalchemy as sql
-
-
-def upgrade(migrate_engine):
- # Upgrade operations go here. Don't create your own engine; bind
- # migrate_engine to your metadata
- meta = sql.MetaData()
- meta.bind = migrate_engine
-
- # catalog
-
- service_table = sql.Table(
- 'example',
- meta,
- sql.Column('id', sql.String(64), primary_key=True),
- sql.Column('type', sql.String(255)),
- sql.Column('extra', sql.Text()))
- service_table.create(migrate_engine, checkfirst=True)
diff --git a/keystone-moon/keystone/contrib/example/migrate_repo/versions/__init__.py b/keystone-moon/keystone/contrib/example/migrate_repo/versions/__init__.py
deleted file mode 100644
index e69de29b..00000000
--- a/keystone-moon/keystone/contrib/example/migrate_repo/versions/__init__.py
+++ /dev/null
diff --git a/keystone-moon/keystone/contrib/example/routers.py b/keystone-moon/keystone/contrib/example/routers.py
deleted file mode 100644
index 30cffe1b..00000000
--- a/keystone-moon/keystone/contrib/example/routers.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 2013 OpenStack Foundation
-#
-# 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 functools
-
-from keystone.common import json_home
-from keystone.common import wsgi
-from keystone.contrib.example import controllers
-
-
-build_resource_relation = functools.partial(
- json_home.build_v3_extension_resource_relation,
- extension_name='OS-EXAMPLE', extension_version='1.0')
-
-
-class ExampleRouter(wsgi.V3ExtensionRouter):
-
- PATH_PREFIX = '/OS-EXAMPLE'
-
- def add_routes(self, mapper):
- example_controller = controllers.ExampleV3Controller()
-
- self._add_resource(
- mapper, example_controller,
- path=self.PATH_PREFIX + '/example',
- get_action='do_something',
- rel=build_resource_relation(resource_name='example'))