You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by or...@apache.org on 2010/04/24 18:11:35 UTC

svn commit: r937638 - /incubator/libcloud/trunk/libcloud/drivers/softlayer.py

Author: oremj
Date: Sat Apr 24 16:11:35 2010
New Revision: 937638

URL: http://svn.apache.org/viewvc?rev=937638&view=rev
Log:
Fix sl2 template.

Modified:
    incubator/libcloud/trunk/libcloud/drivers/softlayer.py

Modified: incubator/libcloud/trunk/libcloud/drivers/softlayer.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/drivers/softlayer.py?rev=937638&r1=937637&r2=937638&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/drivers/softlayer.py (original)
+++ incubator/libcloud/trunk/libcloud/drivers/softlayer.py Sat Apr 24 16:11:35 2010
@@ -71,6 +71,19 @@ SL_IMAGES = [
     {'id': 1863, 'name': 'Windows Server 2008 R2 Datacenter Edition (64bit)'},
 ]
 
+"""
+The following code snippet will print out all available "prices"
+    mask = { 'items': '' }
+    res = self.connection.request(
+        "SoftLayer_Product_Package",
+        "getObject",
+        res,
+        id=46,
+        object_mask=mask
+    )
+
+    from pprint import pprint; pprint(res)
+"""
 SL_TEMPLATES = {
     'sl1': {
         'imagedata': {
@@ -96,13 +109,14 @@ SL_TEMPLATES = {
     },
     'sl2': {
         'imagedata': {
-            'name': '2 x 2.0 GHz, 4GB ram, 250GB',
+            'name': '2 x 2.0 GHz, 4GB ram, 350GB',
             'ram': 4096,
-            'disk': 250,
+            'disk': 350,
             'bandwidth': None
         },
         'prices': [
             {'id': 1646}, # 4 GB
+            {'id': 1639}, # 100 GB (SAN) - This is the only available "First Disk"
             {'id': 1638}, # 250 GB (SAN)
             {'id': 1963}, # Private 2 x 2.0 GHz Cores
             {'id': 21}, # 1 IP Address
@@ -234,8 +248,8 @@ class SoftLayerNodeDriver(NodeDriver):
                 host['powerState']['keyName'],
                 NodeState.UNKNOWN
             ),
-            public_ip=[host['primaryIpAddress']],
-            private_ip=[host['primaryBackendIpAddress']],
+            public_ip=[host.get('primaryIpAddress')],
+            private_ip=[host.get('primaryBackendIpAddress')],
             driver=self,
             extra={
                 'password': password