Clear the extension requirement

Change-Id: If0725e009dfb98fe949b9e00349108c88cf4424a
Closes-bug: #1486845
This commit is contained in:
gong yong sheng 2015-08-20 14:55:39 +08:00
parent 54e7b94012
commit a174215491
1 changed files with 39 additions and 11 deletions

View File

@ -12,18 +12,45 @@ neutronclient/neutron/v2_0/contrib/_fox_sockets.py
Minimum requirements from an extension
--------------------------------------
* Will have a class that subclasses NeutronClientExtension to provide the
requisite version support, paths, and variable names for the client.
* NeutronClientExtension subclasses must have a shell_command class variable
if the command is to be available to the CLI (shell.py)
Example: neutronclient.neutron.v2_0.contrib._fox_sockets.FoxInSocketsList
Minimum requirements to use canonical neutron CRUD commands framework
----------------------------------------------------------------------
Neutron commands are cliff commands, commands in extension can use their
own way to finish their tasks. But if they want to make use of the canonical
neutron CRUD commands framework, the extension should:
* have a class that subclasses NeutronClientExtension to provide the
requisite resource name, version support, and resource collection and
object paths for a resource the commands will process.
Example: neutronclient.neutron.v2_0.contrib._fox_sockets.FoxInSocket
* Will have at least one class that subclasses from the ClientExtension
classes to provide the new functionality to the client
* have a class that subclasses from the ClientExtensionList to provide
resource object list function. This is because most commands
need the list function to get object ID via
neutronclient.neutron.v2_0.__init__.find_resource_by_id.
Example: neutronclient.neutron.v2_0.contrib._fox_sockets.FoxInSocketsList
* ClientExtension subclasses must have a shell_command class variable if the
command is to be available to the CLI (shell.py)
Example: neutronclient.neutron.v2_0.contrib._fox_sockets.FoxInSocketsList
* if needed, subclass ClientExtensionUpdate to implement update of the resource
object.
Example: neutronclient.neutron.v2_0.contrib._fox_sockets.FoxInSocketsUpdate
* if needed, subclass ClientExtensionDelete to implement deletion of the resource
object.
Example: neutronclient.neutron.v2_0.contrib._fox_sockets.FoxInSocketsDelete
* if needed, subclass ClientExtensionShow to get the detail of the resource
object.
Example: neutronclient.neutron.v2_0.contrib._fox_sockets.FoxInSocketsShow
Precedence of command loading
------------------------------
@ -40,8 +67,9 @@ Parent/child relationships may be added if desired.
neutronclient.extension entry_point
-----------------------------------
To activate the commands in a specific extension module, add an entry in
setup.cfg under neutronclient.extension. For example:
[entry_points]
neutronclient.extension =
fox_sockets = neutronclient.neutron.v2_0.contrib._fox_sockets
setup.cfg under neutronclient.extension. For example::
[entry_points]
neutronclient.extension =
fox_sockets = neutronclient.neutron.v2_0.contrib._fox_sockets