Преглед изворни кода

Merge branch 'master' of https://github.com/gvlproject/cloudbridge

nuwan_ag пре 10 година
родитељ
комит
a1bbdbeaa6
2 измењених фајлова са 18 додато и 5 уклоњено
  1. 1 1
      cloudbridge/cloud/base.py
  2. 17 4
      cloudbridge/cloud/interfaces/resources.py

+ 1 - 1
cloudbridge/cloud/base.py

@@ -246,7 +246,7 @@ class BaseLaunchConfig(LaunchConfig):
             is_volume=True, source=source, is_root=is_root, size=size,
             delete_on_terminate=delete_on_terminate)
 
-    def add_net_id(self, net_id):
+    def add_network_interface(self, net_id):
         self.net_ids.append(net_id)
 
 

+ 17 - 4
cloudbridge/cloud/interfaces/resources.py

@@ -391,16 +391,29 @@ class LaunchConfig(object):
         pass
 
     @abstractmethod
-    def add_net_id(self, net_id):
+    def add_network_interface(self, net_id):
         """
-        Add a private netword ID to the launch configuration.
+        Add a private network info to the launch configuration.
+
+        Examples:
+        ```
+        lc = provider.compute.instances.create_launch_config()
+
+        # 1. Add a VPC subnet for use with AWS
+        lc.add_network_interface('subnet-c24aeaff')
+
+        # 2. Add a network ID for use with OpenStack
+        lc.add_network_interface('5820c766-75fe-4fc6-96ef-798f67623238')
+        ```
 
         :type net_id: str
         :param net_id: Network ID to launch an instance into. This is a
                        preliminary implementation (pending full private cloud
-                       support within cloudbridge) so native netowrk IDs need
+                       support within cloudbridge) so native network IDs need
                        to be supplied. For OpenStack, this is the Neutron
-                       network ID. For AWS, this is a subnet ID.
+                       network ID. For AWS, this is a VPC subnet ID. For the
+                       time being, only a single network interface can be
+                       supplied.
         """
         pass