libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1209253 - in /libcloud/trunk: CHANGES libcloud/compute/drivers/cloudsigma.py libcloud/compute/providers.py libcloud/compute/types.py libcloud/data/pricing.json
Date Thu, 01 Dec 2011 21:28:53 GMT
Author: tomaz
Date: Thu Dec  1 21:28:50 2011
New Revision: 1209253

URL: http://svn.apache.org/viewvc?rev=1209253&view=rev
Log:
1. Update CloudSigma Zurich API endpoint address
2. Add new Las Vegas endpoint and driver
3. Allow user to specify drive type when creating a node

Modified:
    libcloud/trunk/CHANGES
    libcloud/trunk/libcloud/compute/drivers/cloudsigma.py
    libcloud/trunk/libcloud/compute/providers.py
    libcloud/trunk/libcloud/compute/types.py
    libcloud/trunk/libcloud/data/pricing.json

Modified: libcloud/trunk/CHANGES
URL: http://svn.apache.org/viewvc/libcloud/trunk/CHANGES?rev=1209253&r1=1209252&r2=1209253&view=diff
==============================================================================
--- libcloud/trunk/CHANGES (original)
+++ libcloud/trunk/CHANGES Thu Dec  1 21:28:50 2011
@@ -3,6 +3,18 @@
 Changes with Apache Libcloud in development:
   *) Compute:
 
+     - Update CloudSigma Zurich API endpoint address.
+       [Tomaz Muraus]
+
+     - Add new US Las Vegas endpoint to CloudSigma driver (types.CLOUDSIGMA_US)
+       [Tomaz Muraus]
+
+     - Allow user to specify drive type (hdd, ssd) when creating a
+       CloudSigma server.
+
+       Note 'ssd' drive_type doesn't work with the API yet.
+       [Tomaz Muraus]
+
      - Update OpenStack 1.1 driver to comply with the API specs. Need to make
        another call to retrieve node name and ip addresses when creating a node,
        because the first call only returns an id an the password. ; GITHUB-40

Modified: libcloud/trunk/libcloud/compute/drivers/cloudsigma.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/drivers/cloudsigma.py?rev=1209253&r1=1209252&r2=1209253&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/drivers/cloudsigma.py (original)
+++ libcloud/trunk/libcloud/compute/drivers/cloudsigma.py Thu Dec  1 21:28:50 2011
@@ -32,8 +32,14 @@ API_ENDPOINTS = {
     'zrh': {
         'name': 'Zurich',
         'country': 'Switzerland',
-        'host': 'api.cloudsigma.com'
+        'host': 'api.zrh.cloudsigma.com'
     },
+
+   'lvs': {
+        'name': 'Las Vegas',
+        'country': 'United States',
+        'host': 'api.lvs.cloudsigma.com'
+    }
 }
 
 # Default API end-point for the base connection clase.
@@ -49,7 +55,7 @@ INSTANCE_TYPES = {
         'name': 'Micro/Regular instance',
         'cpu': 1100,
         'memory': 640,
-        'disk': 50,
+        'disk': 10,
         'bandwidth': None,
     },
     'micro-high-cpu': {
@@ -293,18 +299,28 @@ class CloudSigmaBaseNodeDriver(NodeDrive
 
         @keyword    vnc_password: If not set, VNC access is disabled.
         @type       vnc_password: C{bool}
+
+        @keyword    drive_type: Drive type (ssd|hdd). Defaults to hdd.
+        @type       drive_type: C{str}
         """
         size = kwargs['size']
         image = kwargs['image']
         smp = kwargs.get('smp', 'auto')
         nic_model = kwargs.get('nic_model', 'e1000')
         vnc_password = kwargs.get('vnc_password', None)
+        drive_type = kwargs.get('drive_type', 'hdd')
 
         if nic_model not in ['e1000', 'rtl8139', 'virtio']:
             raise CloudSigmaException('Invalid NIC model specified')
 
+        if drive_type not in ['hdd', 'ssd']:
+            raise CloudSigmaException('Invalid drive type "%s". Valid types'
+                                      ' are: hdd, ssd' % (drive_type))
+
         drive_data = {}
-        drive_data.update({'name': kwargs['name'], 'size': '%sG' % (kwargs['size'].disk)})
+        drive_data.update({'name': kwargs['name'],
+                           'size': '%sG' % (kwargs['size'].disk),
+                           'driveType': drive_type})
 
         response = self.connection.request(action = '/drives/%s/clone' % image.id, data =
dict2str(drive_data),
                                            method = 'POST').object
@@ -551,3 +567,16 @@ class CloudSigmaZrhNodeDriver(CloudSigma
     """
     connectionCls = CloudSigmaZrhConnection
     api_name = 'cloudsigma_zrh'
+
+class CloudSigmaLvsConnection(CloudSigmaBaseConnection):
+    """
+    Connection class for the CloudSigma driver for the Las Vegas end-point
+    """
+    host = API_ENDPOINTS['lvs']['host']
+
+class CloudSigmaLvsNodeDriver(CloudSigmaBaseNodeDriver):
+    """
+    CloudSigma node driver for the Las Vegas end-point
+    """
+    connectionCls = CloudSigmaZrhConnection
+    api_name = 'cloudsigma_lvs'

Modified: libcloud/trunk/libcloud/compute/providers.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/providers.py?rev=1209253&r1=1209252&r2=1209253&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/providers.py (original)
+++ libcloud/trunk/libcloud/compute/providers.py Thu Dec  1 21:28:50 2011
@@ -53,6 +53,8 @@ DRIVERS = {
         ('libcloud.compute.drivers.serverlove', 'ServerLoveNodeDriver'),
     Provider.CLOUDSIGMA:
         ('libcloud.compute.drivers.cloudsigma', 'CloudSigmaZrhNodeDriver'),
+    Provider.CLOUDSIGMA_US:
+        ('libcloud.compute.drivers.cloudsigma', 'CloudSigmaLvsNodeDriver'),
     Provider.GOGRID:
         ('libcloud.compute.drivers.gogrid', 'GoGridNodeDriver'),
     Provider.RACKSPACE:

Modified: libcloud/trunk/libcloud/compute/types.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/types.py?rev=1209253&r1=1209252&r2=1209253&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/types.py (original)
+++ libcloud/trunk/libcloud/compute/types.py Thu Dec  1 21:28:50 2011
@@ -58,6 +58,7 @@ class Provider(object):
     @cvar TERREMARK: Terremark
     @cvar: EC2_US_WEST_OREGON: Amazon AWS US West 2 (Oregon)
     @cvar CLOUDSTACK: CloudStack
+    @cvar CLOUDSIGMA_US: CloudSigma US Las Vegas
     """
     DUMMY = 0
     EC2 = 1  # deprecated name
@@ -99,6 +100,7 @@ class Provider(object):
     TERREMARK = 35
     EC2_US_WEST_OREGON = 36
     CLOUDSTACK = 37
+    CLOUDSIGMA_US = 38
 
 class NodeState(object):
     """

Modified: libcloud/trunk/libcloud/data/pricing.json
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/data/pricing.json?rev=1209253&r1=1209252&r2=1209253&view=diff
==============================================================================
--- libcloud/trunk/libcloud/data/pricing.json (original)
+++ libcloud/trunk/libcloud/data/pricing.json Thu Dec  1 21:28:50 2011
@@ -118,6 +118,18 @@
             "high-cpu-extra-large": 0.780
         },
 
+        "cloudsigma_lvs": {
+            "micro-regular": 0.0,
+            "micro-high-cpu": 0.0,
+            "standard-small": 0.0,
+            "standard-large": 0.0,
+            "standard-extra-large": 0.0,
+            "high-memory-extra-large": 0.0,
+            "high-memory-double-extra-large": 0.0,
+            "high-cpu-medium": 0.0,
+            "high-cpu-extra-large": 0.0
+        },
+
         "elastichosts": {
            "small": 0.100,
            "medium": 0.223,



Mime
View raw message