libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject svn commit: r1052522 - in /incubator/libcloud/trunk: CHANGES libcloud/drivers/rackspace.py libcloud/providers.py libcloud/types.py
Date Fri, 24 Dec 2010 15:22:53 GMT
Author: jerry
Date: Fri Dec 24 15:22:53 2010
New Revision: 1052522

URL: http://svn.apache.org/viewvc?rev=1052522&view=rev
Log:
Rackspace UK support; LIBCLOUD-66

Modified:
    incubator/libcloud/trunk/CHANGES
    incubator/libcloud/trunk/libcloud/drivers/rackspace.py
    incubator/libcloud/trunk/libcloud/providers.py
    incubator/libcloud/trunk/libcloud/types.py

Modified: incubator/libcloud/trunk/CHANGES
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/CHANGES?rev=1052522&r1=1052521&r2=1052522&view=diff
==============================================================================
--- incubator/libcloud/trunk/CHANGES (original)
+++ incubator/libcloud/trunk/CHANGES Fri Dec 24 15:22:53 2010
@@ -2,6 +2,9 @@
 
 Changes with Apache Libcloud 0.4.1 [In Development]
 
+    *) Added Rackspace UK (London) support
+       [Chmouel Boudjnah]
+
     *) GoGrid driver: add support for locations, i.e. listing
        of locations and creation of a node in specified
        location

Modified: incubator/libcloud/trunk/libcloud/drivers/rackspace.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/drivers/rackspace.py?rev=1052522&r1=1052521&r2=1052522&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/drivers/rackspace.py (original)
+++ incubator/libcloud/trunk/libcloud/drivers/rackspace.py Fri Dec 24 15:22:53 2010
@@ -27,6 +27,9 @@ import urlparse
 from xml.etree import ElementTree as ET
 from xml.parsers.expat import ExpatError
 
+RACKSPACE_US_AUTH_HOST='auth.api.rackspacecloud.com'
+RACKSPACE_UK_AUTH_HOST='lon.auth.api.rackspacecloud.com'
+
 NAMESPACE = 'http://docs.rackspacecloud.com/servers/api/v1.0'
 
 #
@@ -80,7 +83,7 @@ class RackspaceConnection(ConnectionUser
     """
 
     api_version = 'v1.0'
-    auth_host = 'auth.api.rackspacecloud.com'
+    auth_host = RACKSPACE_US_AUTH_HOST
     responseCls = RackspaceResponse
 
     def __init__(self, user_id, key, secure=True):
@@ -395,3 +398,19 @@ class RackspaceNodeDriver(NodeDriver):
         return self._to_image(self.connection.request("/images",
                     method="POST",
                     data=ET.tostring(image_elm)).object)
+
+class RackspaceUKConnection(RackspaceConnection):
+    """
+    Connection class for the Rackspace UK driver
+    """
+    auth_host = RACKSPACE_UK_AUTH_HOST
+
+class RackspaceUKNodeDriver(RackspaceNodeDriver):
+    """Driver for Rackspace in the UK (London)
+    """
+
+    name = 'Rackspace (UK)'
+    connectionCls = RackspaceUKConnection
+
+    def list_locations(self):
+        return [NodeLocation(0, 'Rackspace UK London', 'UK', self)]

Modified: incubator/libcloud/trunk/libcloud/providers.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/providers.py?rev=1052522&r1=1052521&r2=1052522&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/providers.py (original)
+++ incubator/libcloud/trunk/libcloud/providers.py Fri Dec 24 15:22:53 2010
@@ -41,6 +41,8 @@ DRIVERS = {
         ('libcloud.drivers.gogrid', 'GoGridNodeDriver'),
     Provider.RACKSPACE:
         ('libcloud.drivers.rackspace', 'RackspaceNodeDriver'),
+    Provider.RACKSPACE_UK:
+        ('libcloud.drivers.rackspace', 'RackspaceUKNodeDriver'),
     Provider.SLICEHOST:
         ('libcloud.drivers.slicehost', 'SlicehostNodeDriver'),
     Provider.VPSNET:

Modified: incubator/libcloud/trunk/libcloud/types.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/types.py?rev=1052522&r1=1052521&r2=1052522&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/types.py (original)
+++ incubator/libcloud/trunk/libcloud/types.py Fri Dec 24 15:22:53 2010
@@ -25,6 +25,7 @@ class Provider(object):
     @cvar EC2_US_WEST: Amazon AWS US N. California
     @cvar EC2_EU_WEST: Amazon AWS EU Ireland
     @cvar RACKSPACE: Rackspace Cloud Servers
+    @cvar RACKSPACE_UK: Rackspace UK Cloud Servers
     @cvar SLICEHOST: Slicehost.com
     @cvar GOGRID: GoGrid
     @cvar VPSNET: VPS.net
@@ -61,6 +62,7 @@ class Provider(object):
     ELASTICHOSTS_UK2 = 20
     ELASTICHOSTS_US1 = 21
     EC2_AP_SOUTHEAST = 22
+    RACKSPACE_UK = 23
 
 class NodeState(object):
     """



Mime
View raw message