You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2013/08/04 02:19:52 UTC

git commit: docs: Modify generate script to also generate supported methods table for the block storage part of the compute API.

Updated Branches:
  refs/heads/trunk a3f2304c0 -> 3e8d0107b


docs: Modify generate script to also generate supported methods table for the
block storage part of the compute API.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/3e8d0107
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/3e8d0107
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/3e8d0107

Branch: refs/heads/trunk
Commit: 3e8d0107b10f8a39ad113b78950add94f2553371
Parents: a3f2304
Author: Tomaz Muraus <to...@apache.org>
Authored: Sun Aug 4 02:18:58 2013 +0200
Committer: Tomaz Muraus <to...@apache.org>
Committed: Sun Aug 4 02:18:58 2013 +0200

----------------------------------------------------------------------
 .../generate_provider_feature_matrix_table.py   | 42 ++++++++++++++++----
 docs/compute/supported_providers.rst            | 11 +++--
 2 files changed, 43 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/3e8d0107/contrib/generate_provider_feature_matrix_table.py
----------------------------------------------------------------------
diff --git a/contrib/generate_provider_feature_matrix_table.py b/contrib/generate_provider_feature_matrix_table.py
index 47b6a1a..d4ac4d4 100755
--- a/contrib/generate_provider_feature_matrix_table.py
+++ b/contrib/generate_provider_feature_matrix_table.py
@@ -39,8 +39,13 @@ from libcloud.dns.providers import DRIVERS as DNS_DRIVERS
 from libcloud.dns.types import Provider as DNSProvider
 
 BASE_API_METHODS = {
-    'compute': ['list_nodes', 'create_node', 'reboot_node', 'destroy_node',
-                'list_images', 'list_sizes'],
+    'compute_main': ['list_nodes', 'create_node', 'reboot_node',
+                     'destroy_node', 'list_images', 'list_sizes'],
+    'compute_block_storage': ['list_volumes', 'create_volume',
+                              'destroy_volume',
+                              'attach_volume', 'detach_volume',
+                              'list_volume_snapshots',
+                              'create_volume_snapshot'],
     'loadbalancer': ['create_balancer', 'list_balancers',
                      'balancer_list_members', 'balancer_attach_member',
                      'balancer_detach_member', 'balancer_attach_compute_node'],
@@ -54,7 +59,7 @@ BASE_API_METHODS = {
 }
 
 FRIENDLY_METHODS_NAMES = {
-    'compute': {
+    'compute_main': {
         'list_nodes': 'list nodes',
         'create_node': 'create node',
         'reboot_node': 'reboot node',
@@ -62,6 +67,15 @@ FRIENDLY_METHODS_NAMES = {
         'list_images': 'list images',
         'list_sizes': 'list sizes'
     },
+    'compute_block_storage': {
+        'list_volumes': 'list volumes',
+        'create_volume': 'create volume',
+        'destroy_volume': 'destroy volume',
+        'attach_volume': 'attach volume',
+        'detach_volume': 'detach volume',
+        'list_volume_snapshots': 'list snapshots',
+        'create_volume_snapshot': 'create snapshop'
+    },
     'loadbalancer': {
         'create_balancer': 'create balancer',
         'list_balancers': 'list balancers',
@@ -103,7 +117,7 @@ def get_provider_api_names(Provider):
 def generate_providers_table(api):
     result = {}
 
-    if api == 'compute':
+    if api in ['compute_main', 'compute_block_storage']:
         driver = NodeDriver
         drivers = COMPUTE_DRIVERS
         provider = ComputeProvider
@@ -219,11 +233,25 @@ def generate_tables():
         supported_providers = generate_supported_providers_table(result)
         supported_methods = generate_supported_methods_table(api, result)
 
+        docs_dir = api
+
+        if api.startswith('compute'):
+            docs_dir = 'compute'
+
         current_path = os.path.dirname(__file__)
         target_dir = os.path.abspath(pjoin(current_path,
-                                           '../docs/%s/' % (api)))
-        supported_providers_path = pjoin(target_dir, '_supported_providers.rst')
-        supported_methods_path = pjoin(target_dir, '_supported_methods.rst')
+                                           '../docs/%s/' % (docs_dir)))
+
+        file_name_1 = '_supported_providers.rst'
+        file_name_2 = '_supported_methods.rst'
+
+        if api == 'compute_main':
+            file_name_2 = '_supported_methods_main.rst'
+        elif api == 'compute_block_storage':
+            file_name_2 = '_supported_methods_block_storage.rst'
+
+        supported_providers_path = pjoin(target_dir, file_name_1)
+        supported_methods_path = pjoin(target_dir, file_name_2)
 
         with open(supported_providers_path, 'w') as fp:
             fp.write(supported_providers)

http://git-wip-us.apache.org/repos/asf/libcloud/blob/3e8d0107/docs/compute/supported_providers.rst
----------------------------------------------------------------------
diff --git a/docs/compute/supported_providers.rst b/docs/compute/supported_providers.rst
index b04c521..121e609 100644
--- a/docs/compute/supported_providers.rst
+++ b/docs/compute/supported_providers.rst
@@ -6,7 +6,12 @@ Provider Matrix
 
 .. include:: _supported_providers.rst
 
-Supported Methods
------------------
+Supported Methods (compute)
+---------------------------
 
-.. include:: _supported_methods.rst
+.. include:: _supported_methods_main.rst
+
+Supported Methods (block storage)
+---------------------------------
+
+.. include:: _supported_methods_block_storage.rst