Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extensions register themselves with keystone/common/extension.py as either public, admin, or both, and they show up in the extensions collection on http://<hostname>:<port>/v2.0/extensions/ Bug 1177531 Change-Id: Ic0b5c84e28342e96c3197c1b46f8b1656e2d7050
- Loading branch information
Adam Young
committed
Jul 12, 2013
1 parent
9a5b0c3
commit c5900d0
Showing
8 changed files
with
182 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# vim: tabstop=4 shiftwidth=4 softtabstop=4 | ||
|
||
# Copyright 2013 OpenStack LLC | ||
# | ||
# 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. | ||
|
||
|
||
ADMIN_EXTENSIONS = {} | ||
PUBLIC_EXTENSIONS = {} | ||
|
||
|
||
def register_admin_extension(url_prefix, extension_data): | ||
"""Register extension with collection of admin extensions. | ||
Extensions register the information here that will show | ||
up in the /extensions page as a way to indicate that the extension is | ||
active. | ||
url_prefix: unique key for the extension that will appear in the | ||
urls generated by the extension. | ||
extension_data is a dictionary. The expected fields are: | ||
'name': short, human readable name of the extnsion | ||
'namespace': xml namespace | ||
'alias': identifier for the extension | ||
'updated': date the extension was last updated | ||
'description': text description of the extension | ||
'links': hyperlinks to documents describing the extension | ||
""" | ||
ADMIN_EXTENSIONS[url_prefix] = extension_data | ||
|
||
|
||
def register_public_extension(url_prefix, extension_data): | ||
"""Same as register_admin_extension but for public extensions.""" | ||
|
||
PUBLIC_EXTENSIONS[url_prefix] = extension_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters