summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorgong yong sheng <gong.yongsheng@99cloud.net>2015-08-20 14:55:39 +0800
committergong yong sheng <gong.yongsheng@99cloud.net>2015-08-25 09:26:00 +0800
commita174215491ffe26fdceca3675e1a0adb91e629f1 (patch)
tree3174ecf99d925a59c3bdc410d84168ecb80e6c5b /doc
parent54e7b94012c54c9c33c5ed0e4043d0e5ee4f3005 (diff)
downloadpython-neutronclient-a174215491ffe26fdceca3675e1a0adb91e629f1.tar.gz
Clear the extension requirement
Change-Id: If0725e009dfb98fe949b9e00349108c88cf4424a Closes-bug: #1486845
Diffstat (limited to 'doc')
-rw-r--r--doc/source/devref/client_command_extensions.rst50
1 files changed, 39 insertions, 11 deletions
diff --git a/doc/source/devref/client_command_extensions.rst b/doc/source/devref/client_command_extensions.rst
index 10d39d8..b89078e 100644
--- a/doc/source/devref/client_command_extensions.rst
+++ b/doc/source/devref/client_command_extensions.rst
@@ -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.
- Example: neutronclient.neutron.v2_0.contrib._fox_sockets.FoxInSocket
+* NeutronClientExtension subclasses must have a shell_command class variable
+ if the command is to be available to the CLI (shell.py)
-* Will have at least one class that subclasses from the ClientExtension
- classes to provide the new functionality to the client
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)
+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
+
+* 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
+* 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 \ No newline at end of file
+setup.cfg under neutronclient.extension. For example::
+ [entry_points]
+ neutronclient.extension =
+ fox_sockets = neutronclient.neutron.v2_0.contrib._fox_sockets