Ver código fonte

Fixed up documentation and links to match latest

Nuwan Goonasekera 8 anos atrás
pai
commit
050b5f0292

+ 15 - 0
docs/api_docs/cloud/exceptions.rst

@@ -17,3 +17,18 @@ InvalidConfigurationException
 -----------------------------
 -----------------------------
 .. autoclass:: cloudbridge.cloud.interfaces.exceptions.InvalidConfigurationException
 .. autoclass:: cloudbridge.cloud.interfaces.exceptions.InvalidConfigurationException
     :members:
     :members:
+
+ProviderConnectionException
+-----------------------------
+.. autoclass:: cloudbridge.cloud.interfaces.exceptions.ProviderConnectionException
+    :members:
+
+InvalidNameException
+-----------------------------
+.. autoclass:: cloudbridge.cloud.interfaces.exceptions.InvalidNameException
+    :members:
+
+InvalidValueException
+-----------------------------
+.. autoclass:: cloudbridge.cloud.interfaces.exceptions.InvalidValueException
+    :members:

+ 61 - 6
docs/api_docs/cloud/resources.rst

@@ -8,11 +8,26 @@ CloudServiceType
 .. autoclass:: cloudbridge.cloud.interfaces.resources.CloudServiceType
 .. autoclass:: cloudbridge.cloud.interfaces.resources.CloudServiceType
     :members:
     :members:
 
 
+CloudResource
+-------------
+.. autoclass:: cloudbridge.cloud.interfaces.resources.CloudResource
+    :members:
+
+Configuration
+-------------
+.. autoclass:: cloudbridge.cloud.interfaces.resources.Configuration
+    :members:
+
 ObjectLifeCycleMixin
 ObjectLifeCycleMixin
 --------------------
 --------------------
 .. autoclass:: cloudbridge.cloud.interfaces.resources.ObjectLifeCycleMixin
 .. autoclass:: cloudbridge.cloud.interfaces.resources.ObjectLifeCycleMixin
     :members:
     :members:
 
 
+PageableObjectMixin
+--------------------
+.. autoclass:: cloudbridge.cloud.interfaces.resources.PageableObjectMixin
+    :members:
+
 ResultList
 ResultList
 ----------
 ----------
 .. autoclass:: cloudbridge.cloud.interfaces.resources.ResultList
 .. autoclass:: cloudbridge.cloud.interfaces.resources.ResultList
@@ -43,16 +58,51 @@ MachineImage
 .. autoclass:: cloudbridge.cloud.interfaces.resources.MachineImage
 .. autoclass:: cloudbridge.cloud.interfaces.resources.MachineImage
     :members:
     :members:
 
 
+NetworkState
+------------
+.. autoclass:: cloudbridge.cloud.interfaces.resources.NetworkState
+    :members:
+
 Network
 Network
 -------
 -------
 .. autoclass:: cloudbridge.cloud.interfaces.resources.Network
 .. autoclass:: cloudbridge.cloud.interfaces.resources.Network
     :members:
     :members:
 
 
+SubnetState
+------------
+.. autoclass:: cloudbridge.cloud.interfaces.resources.SubnetState
+    :members:
+
 Subnet
 Subnet
 ------
 ------
 .. autoclass:: cloudbridge.cloud.interfaces.resources.Subnet
 .. autoclass:: cloudbridge.cloud.interfaces.resources.Subnet
     :members:
     :members:
 
 
+FloatingIP
+----------
+.. autoclass:: cloudbridge.cloud.interfaces.resources.FloatingIP
+    :members:
+
+RouterState
+------------
+.. autoclass:: cloudbridge.cloud.interfaces.resources.RouterState
+    :members:
+
+Router
+------
+.. autoclass:: cloudbridge.cloud.interfaces.resources.Router
+    :members:
+
+Gateway
+--------
+.. autoclass:: cloudbridge.cloud.interfaces.resources.Gateway
+    :members:
+
+InternetGateway
+---------------
+.. autoclass:: cloudbridge.cloud.interfaces.resources.InternetGateway
+    :members:
+
 VolumeState
 VolumeState
 -----------
 -----------
 .. autoclass:: cloudbridge.cloud.interfaces.resources.VolumeState
 .. autoclass:: cloudbridge.cloud.interfaces.resources.VolumeState
@@ -88,19 +138,24 @@ PlacementZone
 .. autoclass:: cloudbridge.cloud.interfaces.resources.PlacementZone
 .. autoclass:: cloudbridge.cloud.interfaces.resources.PlacementZone
     :members:
     :members:
 
 
-InstanceType
+VMType
 ------------
 ------------
-.. autoclass:: cloudbridge.cloud.interfaces.resources.InstanceType
+.. autoclass:: cloudbridge.cloud.interfaces.resources.VMType
     :members:
     :members:
 
 
-SecurityGroup
+VMFirewall
 -------------
 -------------
-.. autoclass:: cloudbridge.cloud.interfaces.resources.SecurityGroup
+.. autoclass:: cloudbridge.cloud.interfaces.resources.VMFirewall
+    :members:
+
+VMFirewallRule
+-----------------
+.. autoclass:: cloudbridge.cloud.interfaces.resources.VMFirewallRule
     :members:
     :members:
 
 
-SecurityGroupRule
+TrafficDirection
 -----------------
 -----------------
-.. autoclass:: cloudbridge.cloud.interfaces.resources.SecurityGroupRule
+.. autoclass:: cloudbridge.cloud.interfaces.resources.TrafficDirection
     :members:
     :members:
 
 
 BucketObject
 BucketObject

+ 29 - 4
docs/api_docs/cloud/services.rst

@@ -48,6 +48,31 @@ NetworkService
 .. autoclass:: cloudbridge.cloud.interfaces.services.NetworkService
 .. autoclass:: cloudbridge.cloud.interfaces.services.NetworkService
     :members:
     :members:
 
 
+SubnetService
+-----------------
+.. autoclass:: cloudbridge.cloud.interfaces.services.SubnetService
+    :members:
+
+FloatingIPService
+-----------------
+.. autoclass:: cloudbridge.cloud.interfaces.services.FloatingIPService
+    :members:
+
+RouterService
+-----------------
+.. autoclass:: cloudbridge.cloud.interfaces.services.RouterService
+    :members:
+
+GatewayService
+-----------------
+.. autoclass:: cloudbridge.cloud.interfaces.services.GatewayService
+    :members:
+
+BucketService
+---------------
+.. autoclass:: cloudbridge.cloud.interfaces.services.BucketService
+    :members:
+
 SecurityService
 SecurityService
 ---------------
 ---------------
 .. autoclass:: cloudbridge.cloud.interfaces.services.SecurityService
 .. autoclass:: cloudbridge.cloud.interfaces.services.SecurityService
@@ -58,14 +83,14 @@ KeyPairService
 .. autoclass:: cloudbridge.cloud.interfaces.services.KeyPairService
 .. autoclass:: cloudbridge.cloud.interfaces.services.KeyPairService
     :members:
     :members:
 
 
-SecurityGroupService
+VMFirewallService
 --------------------
 --------------------
-.. autoclass:: cloudbridge.cloud.interfaces.services.SecurityGroupService
+.. autoclass:: cloudbridge.cloud.interfaces.services.VMFirewallService
     :members:
     :members:
 
 
-InstanceTypesService
+VMTypesService
 --------------------
 --------------------
-.. autoclass:: cloudbridge.cloud.interfaces.services.InstanceTypesService
+.. autoclass:: cloudbridge.cloud.interfaces.services.VMTypesService
     :members:
     :members:
 
 
 RegionService
 RegionService

+ 14 - 14
docs/extras/_images/object_relationships_detailed.svg

@@ -266,7 +266,7 @@
        font-size="12.6452"
        font-size="12.6452"
        style="font-size:12.64519978px;line-height:0%;font-family:ArialMT">security</text>
        style="font-size:12.64519978px;line-height:0%;font-family:ArialMT">security</text>
 </a><a
 </a><a
-     xlink:href="../api_docs/cloud/services.html#blockstoreservice"
+     xlink:href="../api_docs/cloud/services.html#storageservice"
      id="svg_18"
      id="svg_18"
      transform="translate(-4.35911,-74.104872)"><path
      transform="translate(-4.35911,-74.104872)"><path
        id="svg_13"
        id="svg_13"
@@ -291,7 +291,7 @@
        font-size="11.2402"
        font-size="11.2402"
        style="font-size:11.24020004px;line-height:0%;font-family:ArialMT">images</text>
        style="font-size:11.24020004px;line-height:0%;font-family:ArialMT">images</text>
 </a><a
 </a><a
-     xlink:href="../api_docs/cloud/services.html#instancetypesservice"
+     xlink:href="../api_docs/cloud/services.html#vmtypesservice"
      id="svg_23"
      id="svg_23"
      transform="translate(-4.35911,-74.104872)"><path
      transform="translate(-4.35911,-74.104872)"><path
        id="svg_34"
        id="svg_34"
@@ -340,7 +340,7 @@
        font-size="11.2402"
        font-size="11.2402"
        style="font-size:11.24020004px;line-height:0%;font-family:ArialMT">keypairs</text>
        style="font-size:11.24020004px;line-height:0%;font-family:ArialMT">keypairs</text>
 </a><a
 </a><a
-     xlink:href="../api_docs/cloud/services.html#securitygroupservice"
+     xlink:href="../api_docs/cloud/services.html#vmfirewallservice"
      id="svg_29"
      id="svg_29"
      transform="translate(-4.35911,-74.104872)"><path
      transform="translate(-4.35911,-74.104872)"><path
        id="svg_43"
        id="svg_43"
@@ -401,7 +401,7 @@
        font-size="11.2402"
        font-size="11.2402"
        style="font-size:11.24020004px;line-height:0%;font-family:ArialMT">BucketObject</text>
        style="font-size:11.24020004px;line-height:0%;font-family:ArialMT">BucketObject</text>
 </a><a
 </a><a
-     xlink:href="../api_docs/cloud/resources.html#securitygrouprule"
+     xlink:href="../api_docs/cloud/resources.html#vmfirewallrule"
      id="svg_35"
      id="svg_35"
      transform="translate(-4.35911,-74.104872)"><path
      transform="translate(-4.35911,-74.104872)"><path
        id="svg_12"
        id="svg_12"
@@ -414,7 +414,7 @@
        x="487.66019"
        x="487.66019"
        y="394.80569">VMFirewallRule</text>
        y="394.80569">VMFirewallRule</text>
 </a><a
 </a><a
-     xlink:href="../api_docs/cloud/resources.html#securitygroup"
+     xlink:href="../api_docs/cloud/resources.html#vmfirewall"
      id="svg_36"
      id="svg_36"
      transform="translate(-4.35911,-74.104872)"><path
      transform="translate(-4.35911,-74.104872)"><path
        id="svg_61"
        id="svg_61"
@@ -499,7 +499,7 @@
        font-size="11.2402"
        font-size="11.2402"
        style="font-size:11.24020004px;line-height:0%;font-family:ArialMT">Instance</text>
        style="font-size:11.24020004px;line-height:0%;font-family:ArialMT">Instance</text>
 </a><a
 </a><a
-     xlink:href="../api_docs/cloud/resources.html#instancetype"
+     xlink:href="../api_docs/cloud/resources.html#vmtype"
      id="svg_47"
      id="svg_47"
      transform="translate(-4.35911,-74.104872)"><path
      transform="translate(-4.35911,-74.104872)"><path
        id="e24_46"
        id="e24_46"
@@ -625,7 +625,7 @@
        font-size="12.6452"
        font-size="12.6452"
        style="font-size:12.64519978px;line-height:0%;font-family:ArialMT">networking</text>
        style="font-size:12.64519978px;line-height:0%;font-family:ArialMT">networking</text>
 </a><a
 </a><a
-     xlink:href="../api_docs/cloud/services.html#cloudbridge.cloud.interfaces.services.NetworkingService.subnets"
+     xlink:href="../api_docs/cloud/services.html#subnetservice"
      id="svg_38-3"
      id="svg_38-3"
      transform="translate(-142.15911,136.27478)"><path
      transform="translate(-142.15911,136.27478)"><path
        id="svg_58-7"
        id="svg_58-7"
@@ -709,7 +709,7 @@
      inkscape:connector-curvature="0"
      inkscape:connector-curvature="0"
      d="m 171.04089,565.29513 -0.7,0.7 1.9,-0.7 -1.9,-0.7 z"
      d="m 171.04089,565.29513 -0.7,0.7 1.9,-0.7 -1.9,-0.7 z"
      style="stroke:#000000" /><a
      style="stroke:#000000" /><a
-     xlink:href="../api_docs/cloud/services.html#cloudbridge.cloud.interfaces.services.NetworkingService.subnets"
+     xlink:href="../api_docs/cloud/services.html#routerservice"
      id="svg_38-3_1_"
      id="svg_38-3_1_"
      transform="translate(-142.15911,136.27478)"><path
      transform="translate(-142.15911,136.27478)"><path
        id="svg_58-7_1_"
        id="svg_58-7_1_"
@@ -721,7 +721,7 @@
        font-size="11.2402"
        font-size="11.2402"
        style="font-size:11.24020004px;line-height:0%;font-family:ArialMT">routers</text>
        style="font-size:11.24020004px;line-height:0%;font-family:ArialMT">routers</text>
 </a><a
 </a><a
-     xlink:href="../api_docs/cloud/resources.html#subnet"
+     xlink:href="../api_docs/cloud/resources.html#router"
      id="a3500_2_"
      id="a3500_2_"
      transform="translate(124.27193,135.68572)"><path
      transform="translate(124.27193,135.68572)"><path
        id="path3502_3_"
        id="path3502_3_"
@@ -770,7 +770,7 @@
      style="stroke:#000000" /><a
      style="stroke:#000000" /><a
      transform="translate(-141.94556,163.20862)"
      transform="translate(-141.94556,163.20862)"
      id="svg_38-3_1_-4"
      id="svg_38-3_1_-4"
-     xlink:href="/Applications/Inkscape.app/../api_docs/cloud/services.html#cloudbridge.cloud.interfaces.services.NetworkingService.subnets"><path
+     xlink:href="/Applications/Inkscape.app/../api_docs/cloud/services.html#floatingipservice"><path
        id="svg_58-7_1_-8"
        id="svg_58-7_1_-8"
        inkscape:connector-curvature="0"
        inkscape:connector-curvature="0"
        d="m 313.5,422.3 v 0 c 0,-1.9 1.6,-3.5 3.5,-3.5 h 96.1 c 0.9,0 1.8,0.3 2.4,1 0.6,0.6 1,1.5 1,2.4 V 436 c 0,1.9 -1.6,3.5 -3.5,3.5 h -96 v 0 c -1.9,0 -3.5,-1.6 -3.5,-3.5 z"
        d="m 313.5,422.3 v 0 c 0,-1.9 1.6,-3.5 3.5,-3.5 h 96.1 c 0.9,0 1.8,0.3 2.4,1 0.6,0.6 1,1.5 1,2.4 V 436 c 0,1.9 -1.6,3.5 -3.5,3.5 h -96 v 0 c -1.9,0 -3.5,-1.6 -3.5,-3.5 z"
@@ -783,7 +783,7 @@
 </a><a
 </a><a
      transform="translate(124.48548,162.61956)"
      transform="translate(124.48548,162.61956)"
      id="a3500_2_-9"
      id="a3500_2_-9"
-     xlink:href="/Applications/Inkscape.app/../api_docs/cloud/resources.html#subnet"><path
+     xlink:href="/Applications/Inkscape.app/../api_docs/cloud/resources.html#floatingip"><path
        id="path3502_3_-0"
        id="path3502_3_-0"
        inkscape:connector-curvature="0"
        inkscape:connector-curvature="0"
        d="m 211.1,422.5 v 0 c 0,-1.9 1.6,-3.5 3.5,-3.5 h 96.1 c 0.9,0 1.8,0.3 2.4,1 0.6,0.6 1,1.5 1,2.4 v 13.8 c 0,1.9 -1.6,3.5 -3.5,3.5 h -96.2 v 0 c -1.9,0 -3.5,-1.6 -3.5,-3.5 z"
        d="m 211.1,422.5 v 0 c 0,-1.9 1.6,-3.5 3.5,-3.5 h 96.1 c 0.9,0 1.8,0.3 2.4,1 0.6,0.6 1,1.5 1,2.4 v 13.8 c 0,1.9 -1.6,3.5 -3.5,3.5 h -96.2 v 0 c -1.9,0 -3.5,-1.6 -3.5,-3.5 z"
@@ -816,7 +816,7 @@
      style="stroke:#000000" /><a
      style="stroke:#000000" /><a
      transform="translate(-141.94556,191.20862)"
      transform="translate(-141.94556,191.20862)"
      id="svg_38-3_1_-4-0"
      id="svg_38-3_1_-4-0"
-     xlink:href="/Applications/Inkscape.app/../api_docs/cloud/services.html#cloudbridge.cloud.interfaces.services.NetworkingService.subnets"><path
+     xlink:href="/Applications/Inkscape.app/../api_docs/cloud/services.html#gatewayservice"><path
        id="svg_58-7_1_-8-2"
        id="svg_58-7_1_-8-2"
        inkscape:connector-curvature="0"
        inkscape:connector-curvature="0"
        d="m 313.5,422.3 v 0 c 0,-1.9 1.6,-3.5 3.5,-3.5 h 96.1 c 0.9,0 1.8,0.3 2.4,1 0.6,0.6 1,1.5 1,2.4 V 436 c 0,1.9 -1.6,3.5 -3.5,3.5 h -96 v 0 c -1.9,0 -3.5,-1.6 -3.5,-3.5 z"
        d="m 313.5,422.3 v 0 c 0,-1.9 1.6,-3.5 3.5,-3.5 h 96.1 c 0.9,0 1.8,0.3 2.4,1 0.6,0.6 1,1.5 1,2.4 V 436 c 0,1.9 -1.6,3.5 -3.5,3.5 h -96 v 0 c -1.9,0 -3.5,-1.6 -3.5,-3.5 z"
@@ -829,7 +829,7 @@
 </a><a
 </a><a
      transform="translate(124.48548,190.61956)"
      transform="translate(124.48548,190.61956)"
      id="a3500_2_-9-9"
      id="a3500_2_-9-9"
-     xlink:href="/Applications/Inkscape.app/../api_docs/cloud/resources.html#subnet"><path
+     xlink:href="/Applications/Inkscape.app/../api_docs/cloud/resources.html#internetgateway"><path
        id="path3502_3_-0-9"
        id="path3502_3_-0-9"
        inkscape:connector-curvature="0"
        inkscape:connector-curvature="0"
        d="m 211.1,422.5 v 0 c 0,-1.9 1.6,-3.5 3.5,-3.5 h 96.1 c 0.9,0 1.8,0.3 2.4,1 0.6,0.6 1,1.5 1,2.4 v 13.8 c 0,1.9 -1.6,3.5 -3.5,3.5 h -96.2 v 0 c -1.9,0 -3.5,-1.6 -3.5,-3.5 z"
        d="m 211.1,422.5 v 0 c 0,-1.9 1.6,-3.5 3.5,-3.5 h 96.1 c 0.9,0 1.8,0.3 2.4,1 0.6,0.6 1,1.5 1,2.4 v 13.8 c 0,1.9 -1.6,3.5 -3.5,3.5 h -96.2 v 0 c -1.9,0 -3.5,-1.6 -3.5,-3.5 z"
@@ -855,7 +855,7 @@
      style="fill:none;stroke:#000000;stroke-width:0.73930001" /><a
      style="fill:none;stroke:#000000;stroke-width:0.73930001" /><a
      transform="translate(-4.88461,-47.98267)"
      transform="translate(-4.88461,-47.98267)"
      id="svg_32-7"
      id="svg_32-7"
-     xlink:href="/Applications/Inkscape.app/../api_docs/cloud/services.html#snapshotservice"><path
+     xlink:href="/Applications/Inkscape.app/../api_docs/cloud/services.html#bucketservice"><path
        id="svg_22-9"
        id="svg_22-9"
        inkscape:connector-curvature="0"
        inkscape:connector-curvature="0"
        d="m 175.3,483.7 v 0 c 0,-1.9 1.6,-3.5 3.5,-3.5 h 96.1 c 0.9,0 1.8,0.3 2.4,1 0.6,0.6 1,1.5 1,2.4 v 13.8 c 0,1.9 -1.6,3.5 -3.5,3.5 h -96.2 v 0 c -1.9,0 -3.5,-1.6 -3.5,-3.5 z"
        d="m 175.3,483.7 v 0 c 0,-1.9 1.6,-3.5 3.5,-3.5 h 96.1 c 0.9,0 1.8,0.3 2.4,1 0.6,0.6 1,1.5 1,2.4 v 13.8 c 0,1.9 -1.6,3.5 -3.5,3.5 h -96.2 v 0 c -1.9,0 -3.5,-1.6 -3.5,-3.5 z"

+ 20 - 16
docs/getting_started.rst

@@ -11,6 +11,9 @@ CloudBridge is available on PyPI so to install the latest available version,
 run::
 run::
 
 
     pip install --upgrade cloudbridge
     pip install --upgrade cloudbridge
+    
+For common issues during setup, check the following section:
+`Common Setup Issues <topics/troubleshooting.html>`
 
 
 Create a provider
 Create a provider
 -----------------
 -----------------
@@ -108,17 +111,18 @@ attaching an internet gateway to the subnet via a router.
     router.attach_gateway(gateway)
     router.attach_gateway(gateway)
 
 
 
 
-Create a security group
+Create a VM firewall
 -----------------------
 -----------------------
-Next, we need to create a security group and add a rule to allow ssh access.
-A security group needs to be associated with a private network.
+Next, we need to create a VM firewall (also commonly known as a security group)
+and add a rule to allow ssh access. A VM firewall needs to be associated with
+a private network.
 
 
 .. code-block:: python
 .. code-block:: python
 
 
     net = provider.networking.networks.get('desired network ID')
     net = provider.networking.networks.get('desired network ID')
-    sg = provider.security.security_groups.create(
-        'cloudbridge_intro', 'A security group used by CloudBridge', net.id)
-    sg.add_rule('tcp', 22, 22, '0.0.0.0/0')
+    fw = provider.security.vm_firewalls.create(
+        'cloudbridge_intro', 'A VM firewall used by CloudBridge', net.id)
+    fw.rules.create(TrafficDirection.INBOUND, 'tcp', 22, 22, '0.0.0.0/0')
 
 
 Launch an instance
 Launch an instance
 ------------------
 ------------------
@@ -129,12 +133,12 @@ also add the network interface as a launch argument.
 .. code-block:: python
 .. code-block:: python
 
 
     img = provider.compute.images.get(image_id)
     img = provider.compute.images.get(image_id)
-    inst_type = sorted([t for t in provider.compute.instance_types
-                        if t.vcpus >= 2 and t.ram >= 4],
-                       key=lambda x: x.vcpus*x.ram)[0]
+    vm_type = sorted([t for t in provider.compute.vm_types
+                      if t.vcpus >= 2 and t.ram >= 4],
+                      key=lambda x: x.vcpus*x.ram)[0]
     inst = provider.compute.instances.create(
     inst = provider.compute.instances.create(
-        name='CloudBridge-intro', image=img, instance_type=inst_type,
-        subnet=subnet, key_pair=kp, security_groups=[sg])
+        name='CloudBridge-intro', image=img, vm_type=vm_type,
+        subnet=subnet, key_pair=kp, vm_firewalls=[fw])
     # Wait until ready
     # Wait until ready
     inst.wait_till_ready()  # This is a blocking call
     inst.wait_till_ready()  # This is a blocking call
     # Show instance state
     # Show instance state
@@ -143,8 +147,8 @@ also add the network interface as a launch argument.
 
 
 .. note ::
 .. note ::
 
 
-   Note that we iterated through provider.compute.instance_types directly
-   instead of calling provider.compute.instance_types.list(). This is
+   Note that we iterated through provider.compute.vm_types directly
+   instead of calling provider.compute.vm_types.list(). This is
    because we need to iterate through all records in this case. The list()
    because we need to iterate through all records in this case. The list()
    method may not always return all records, depending on the global limit
    method may not always return all records, depending on the global limit
    for records, necessitating that additional records be paged in. See
    for records, necessitating that additional records be paged in. See
@@ -158,8 +162,8 @@ and then associate it with the instance.
 
 
 .. code-block:: python
 .. code-block:: python
 
 
-    fip = provider.networking.networks.create_floating_ip()
-    inst.add_floating_ip(fip.public_ip)
+    fip = provider.networking.floating_ips.create()
+    inst.add_floating_ip(fip)
     inst.refresh()
     inst.refresh()
     inst.public_ips
     inst.public_ips
     # [u'54.166.125.219']
     # [u'54.166.125.219']
@@ -178,7 +182,7 @@ To wrap things up, let's clean up all the resources we have created
     inst.wait_for([InstanceState.TERMINATED, InstanceState.UNKNOWN],
     inst.wait_for([InstanceState.TERMINATED, InstanceState.UNKNOWN],
                    terminal_states=[InstanceState.ERROR])  # Blocking call
                    terminal_states=[InstanceState.ERROR])  # Blocking call
     fip.delete()
     fip.delete()
-    sg.delete()
+    fw.delete()
     kp.delete()
     kp.delete()
     os.remove('cloudbridge_intro.pem')
     os.remove('cloudbridge_intro.pem')
     router.detach_gateway(gateway)
     router.detach_gateway(gateway)

+ 17 - 17
docs/topics/launch.rst

@@ -15,9 +15,9 @@ and 4 GB RAM.
 .. code-block:: python
 .. code-block:: python
 
 
     img = provider.compute.images.get('ami-f4cc1de2')  # Ubuntu 16.04 on AWS
     img = provider.compute.images.get('ami-f4cc1de2')  # Ubuntu 16.04 on AWS
-    inst_type = sorted([t for t in provider.compute.instance_types
-                        if t.vcpus >= 2 and t.ram >= 4],
-                       key=lambda x: x.vcpus*x.ram)[0]
+    vm_type = sorted([t for t in provider.compute.vm_types
+                      if t.vcpus >= 2 and t.ram >= 4],
+                      key=lambda x: x.vcpus*x.ram)[0]
 
 
 In addition, CloudBridge instances must be launched into a private subnet.
 In addition, CloudBridge instances must be launched into a private subnet.
 While it is possible to create complex network configurations as shown in the
 While it is possible to create complex network configurations as shown in the
@@ -30,16 +30,16 @@ obtain a default subnet for use.
     subnet = provider.networking.subnets.get_or_create_default()
     subnet = provider.networking.subnets.get_or_create_default()
 
 
 When launching an instance, you can also specify several optional arguments
 When launching an instance, you can also specify several optional arguments
-such as the security group, a key pair, or instance user data. To allow you to
-connect to the launched instances, we will also supply those parameters (note
-that we're making an assumption here these resources exist; if you don't have
-those resources under your account, take a look at the
+such as the firewall (a.k.a security group), a key pair, or instance user data.
+To allow you to connect to the launched instances, we will also supply those
+parameters (note that we're making an assumption here these resources exist;
+if you don't have those resources under your account, take a look at the
 `Getting Started <../getting_started.html>`_ guide).
 `Getting Started <../getting_started.html>`_ guide).
 
 
 .. code-block:: python
 .. code-block:: python
 
 
     kp = provider.security.key_pairs.find(name='cloudbridge_intro')[0]
     kp = provider.security.key_pairs.find(name='cloudbridge_intro')[0]
-    sg = provider.security.security_groups.list()[0]
+    fw = provider.security.vm_firewalls.list()[0]
 
 
 Launch an instance
 Launch an instance
 ------------------
 ------------------
@@ -48,8 +48,8 @@ Once we have all the desired pieces, we'll use them to launch an instance:
 .. code-block:: python
 .. code-block:: python
 
 
     inst = provider.compute.instances.create(
     inst = provider.compute.instances.create(
-        name='CloudBridge-VPC', image=img, instance_type=inst_type,
-        subnet=subnet, key_pair=kp, security_groups=[sg])
+        name='CloudBridge-VPC', image=img, vm_type=vm_type,
+        subnet=subnet, key_pair=kp, vm_firewalls=[fw])
 
 
 Private networking
 Private networking
 ~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~
@@ -71,8 +71,8 @@ that subnet.
     router.attach_gateway(gateway)
     router.attach_gateway(gateway)
 
 
     inst = provider.compute.instances.create(
     inst = provider.compute.instances.create(
-        name='CloudBridge-VPC', image=img, instance_type=inst_type,
-        subnet=sn, key_pair=kp, security_groups=[sg])
+        name='CloudBridge-VPC', image=img, vm_type=vm_type,
+        subnet=sn, key_pair=kp, vm_firewalls=[fw])
 
 
 For more information on how to create and setup a private network, take a look
 For more information on how to create and setup a private network, take a look
 at `Networking <./networking.html>`_.
 at `Networking <./networking.html>`_.
@@ -93,8 +93,8 @@ refer to :class:`.LaunchConfig`.
     lc = provider.compute.instances.create_launch_config()
     lc = provider.compute.instances.create_launch_config()
     lc.add_volume_device(source=img, size=11, is_root=True)
     lc.add_volume_device(source=img, size=11, is_root=True)
     inst = provider.compute.instances.create(
     inst = provider.compute.instances.create(
-        name='CloudBridge-BDM', image=img,  instance_type=inst_type,
-        launch_config=lc, key_pair=kp, security_groups=[sg])
+        name='CloudBridge-BDM', image=img,  vm_type=vm_type,
+        launch_config=lc, key_pair=kp, vm_firewalls=[fw])
 
 
 where ``img`` is the :class:`.Image` object to use for the root volume.
 where ``img`` is the :class:`.Image` object to use for the root volume.
 
 
@@ -114,10 +114,10 @@ assign a floating IP address to your instance. This can be done as follows:
 
 
 .. code-block:: python
 .. code-block:: python
 
 
-    # List all the IP addresses and find the desired one
-    provider.networking.networks.floating_ips()
+    # Create a new floating IP address
+    fip = provider.networking.floating_ips.create()
     # Assign the desired IP to the instance
     # Assign the desired IP to the instance
-    inst.add_floating_ip('149.165.168.143')
+    inst.add_floating_ip(fip)
     inst.refresh()
     inst.refresh()
     inst.public_ips
     inst.public_ips
     # [u'149.165.168.143']
     # [u'149.165.168.143']