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

svn commit: r938721 - in /incubator/libcloud/trunk: libcloud/ libcloud/drivers/ test/ test/fixtures/ibm/

Author: pquerna
Date: Tue Apr 27 23:32:35 2010
New Revision: 938721

URL: http://svn.apache.org/viewvc?rev=938721&view=rev
Log:
Add IBM Developer Cloud support.

Fixes LIBCLOUD-15.

Submitted by: Eric Woods <woodstae gmail.com>

Added:
    incubator/libcloud/trunk/libcloud/drivers/ibm.py   (with props)
    incubator/libcloud/trunk/test/fixtures/ibm/
    incubator/libcloud/trunk/test/fixtures/ibm/create.xml   (with props)
    incubator/libcloud/trunk/test/fixtures/ibm/delete.xml   (with props)
    incubator/libcloud/trunk/test/fixtures/ibm/images.xml   (with props)
    incubator/libcloud/trunk/test/fixtures/ibm/instances.xml   (with props)
    incubator/libcloud/trunk/test/fixtures/ibm/instances_deleted.xml   (with props)
    incubator/libcloud/trunk/test/fixtures/ibm/locations.xml   (with props)
    incubator/libcloud/trunk/test/fixtures/ibm/reboot_active.xml   (with props)
    incubator/libcloud/trunk/test/fixtures/ibm/sizes.xml   (with props)
    incubator/libcloud/trunk/test/test_ibm.py   (with props)
Modified:
    incubator/libcloud/trunk/libcloud/providers.py
    incubator/libcloud/trunk/libcloud/types.py
    incubator/libcloud/trunk/test/secrets.py-dist

Added: incubator/libcloud/trunk/libcloud/drivers/ibm.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/drivers/ibm.py?rev=938721&view=auto
==============================================================================
--- incubator/libcloud/trunk/libcloud/drivers/ibm.py (added)
+++ incubator/libcloud/trunk/libcloud/drivers/ibm.py Tue Apr 27 23:32:35 2010
@@ -0,0 +1,180 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# libcloud.org licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# Copyright 2009 RedRata Ltd
+"""
+Driver for the IBM Developer Cloud.
+"""
+from libcloud.types import NodeState, InvalidCredsException, Provider
+from libcloud.base import Response, ConnectionUserAndKey, NodeDriver, Node, NodeImage, NodeSize, NodeLocation, NodeAuthSSHKey
+import base64, urllib
+
+from xml.etree import ElementTree as ET
+
+HOST = 'www-180.ibm.com'
+REST_BASE = '/cloud/enterprise/beta/api/rest/20090403/'
+
+class IBMResponse(Response):
+    def success(self):
+        return int(self.status) == 200
+    
+    def parse_body(self):
+        if not self.body:
+            return None
+        return ET.XML(self.body)
+    
+    def parse_error(self):
+        if int(self.status) == 401:
+            if not self.body:
+                raise InvalidCredsException(str(self.status) + ': ' + self.error)
+            else:
+                raise InvalidCredsException(self.body)
+        return self.body
+
+class IBMConnection(ConnectionUserAndKey):
+    """
+    Handles the connection to the IBM Developer Cloud.
+    """
+    host = HOST
+    responseCls = IBMResponse
+    
+    def add_default_headers(self, headers):
+        headers['Accept'] = 'text/xml'
+        headers['Authorization'] = ('Basic %s' % (base64.b64encode('%s:%s' % (self.user_id, self.key))))
+        if not 'Content-Type' in headers:
+            headers['Content-Type'] = 'text/xml'
+        return headers
+    
+    def encode_data(self, data):
+        return urllib.urlencode(data)
+    
+class IBMNodeDriver(NodeDriver):    
+    """
+    IBM Developer Cloud node driver.
+    """
+    connectionCls = IBMConnection
+    type = Provider.IBM
+    name = "IBM Developer Cloud"
+    
+    NODE_STATE_MAP = { 0: NodeState.PENDING,
+                       1: NodeState.PENDING,
+                       2: NodeState.TERMINATED,
+                       3: NodeState.TERMINATED,
+                       4: NodeState.TERMINATED,
+                       5: NodeState.RUNNING,
+                       6: NodeState.UNKNOWN,
+                       7: NodeState.PENDING,
+                       8: NodeState.REBOOTING,
+                       9: NodeState.PENDING,
+                       10: NodeState.PENDING,
+                       11: NodeState.TERMINATED }
+    
+    def create_node(self, **kwargs):
+        """
+        Creates a node in the IBM Developer Cloud.
+        
+        See L{NodeDriver.create_node} for more keyword args.
+
+        @keyword    configurationData: Image-specific configuration parameters.
+                                       Configuration parameters are defined in
+                                       the parameters.xml file.  The URL to
+                                       this file is defined in the NodeImage
+                                       at extra[parametersURL].
+        @type       configurationData: C{dict}
+        """
+
+        # Compose headers for message body
+        data = {}
+        data.update({'name': kwargs['name']})
+        data.update({'imageID': kwargs['image'].id})
+        data.update({'instanceType': kwargs['size'].id})
+        if 'location' in kwargs:
+            data.update({'location': kwargs['location'].id})
+        else:
+            data.update({'location': '1'})
+        if 'auth' in kwargs and isinstance(kwargs['auth'], NodeAuthSSHKey):
+            data.update({'publicKey': kwargs['auth'].pubkey})
+        if 'configurationData' in kwargs:
+            configurationData = kwargs['configurationData']
+            for key in configurationData.keys():
+                data.update({key: configurationData.get(key)})
+        
+        # Send request!
+        resp = self.connection.request(action = REST_BASE + 'instances',
+                                       headers = {'Content-Type': 'application/x-www-form-urlencoded'},
+                                       method = 'POST',
+                                       data = data).object
+        return self._to_nodes(resp)[0]
+    
+    def destroy_node(self, node):
+        url = REST_BASE + 'instances/%s' % (node.id)
+        status = int(self.connection.request(action = url, method='DELETE').status)
+        return status == 200
+    
+    def reboot_node(self, node):
+        url = REST_BASE + 'instances/%s' % (node.id)
+        headers = {'Content-Type': 'application/x-www-form-urlencoded'}
+        data = {'state': 'restart'}
+        
+        resp = self.connection.request(action = url,
+                                       method = 'PUT',
+                                       headers = headers,
+                                       data = data)
+        return int(resp.status) == 200
+    
+    def list_nodes(self):
+        return self._to_nodes(self.connection.request(REST_BASE + 'instances').object)
+    
+    def list_images(self, location = None):
+        return self._to_images(self.connection.request(REST_BASE + 'images').object)
+    
+    def list_sizes(self, location = None):
+        # IBM Developer Cloud instances currently support SMALL, MEDIUM, and
+        # LARGE.  Storage also supports SMALL, MEDIUM, and LARGE.
+        return [ NodeSize('SMALL', 'SMALL', None, None, None, None, self.connection.driver),
+                 NodeSize('MEDIUM', 'MEDIUM', None, None, None, None, self.connection.driver),
+                 NodeSize('LARGE', 'LARGE', None, None, None, None, self.connection.driver) ]
+    
+    def list_locations(self):
+        return self._to_locations(self.connection.request(REST_BASE + 'locations').object)
+    
+    def _to_nodes(self, object):
+        return [ self._to_node(instance) for instance in object.findall('Instance') ]
+            
+    def _to_node(self, instance):
+        return Node(id = instance.findtext('ID'),
+                    name = instance.findtext('Name'),
+                    state = self.NODE_STATE_MAP[int(instance.findtext('Status'))],
+                    public_ip = instance.findtext('IP'),
+                    private_ip = None,
+                    driver = self.connection.driver)
+        
+    def _to_images(self, object):
+        return [ self._to_image(image) for image in object.findall('Image') ]
+    
+    def _to_image(self, image):
+        return NodeImage(id = image.findtext('ID'),
+                         name = image.findtext('Name'),
+                         driver = self.connection.driver,
+                         extra = {'parametersURL': image.findtext('Manifest')})
+        
+    def _to_locations(self, object):
+        return [ self._to_location(location) for location in object.findall('Location') ]
+    
+    def _to_location(self, location):
+        # NOTE: country currently hardcoded
+        return NodeLocation(id = location.findtext('ID'),
+                            name = location.findtext('Name'),
+                            country = 'US',
+                            driver = self.connection.driver)

Propchange: incubator/libcloud/trunk/libcloud/drivers/ibm.py
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/libcloud/trunk/libcloud/drivers/ibm.py
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/libcloud/trunk/libcloud/drivers/ibm.py
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/libcloud/trunk/libcloud/providers.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/providers.py?rev=938721&r1=938720&r2=938721&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/providers.py (original)
+++ incubator/libcloud/trunk/libcloud/providers.py Tue Apr 27 23:32:35 2010
@@ -47,6 +47,8 @@ DRIVERS = {
         ('libcloud.drivers.softlayer', 'SoftLayerNodeDriver'),
     Provider.EUCALYPTUS:
         ('libcloud.drivers.ec2', 'EucNodeDriver'),
+    Provider.IBM:
+        ('libcloud.drivers.ibm', 'IBMNodeDriver'),
 }
 
 def get_driver(provider):

Modified: incubator/libcloud/trunk/libcloud/types.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/libcloud/types.py?rev=938721&r1=938720&r2=938721&view=diff
==============================================================================
--- incubator/libcloud/trunk/libcloud/types.py (original)
+++ incubator/libcloud/trunk/libcloud/types.py Tue Apr 27 23:32:35 2010
@@ -50,6 +50,7 @@ class Provider(object):
     SOFTLAYER = 12
     EUCALYPTUS = 13
     ECP = 14
+    IBM = 15
 
 class NodeState(object):
     """

Added: incubator/libcloud/trunk/test/fixtures/ibm/create.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/fixtures/ibm/create.xml?rev=938721&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/fixtures/ibm/create.xml (added)
+++ incubator/libcloud/trunk/test/fixtures/ibm/create.xml Tue Apr 27 23:32:35 2010
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:CreateInstanceResponse xmlns:ns2="http://www.ibm.com/xmlns/b2b/cloud/api/2009-04-03"><Instance><ID>28558</ID><Location>1</Location><RequestID name="RationalInsight4">28558</RequestID><Name>RationalInsight4</Name><Owner>woodser@us.ibm.com</Owner><ImageID>11</ImageID><InstanceType>LARGE</InstanceType><KeyName>MyPublicKey</KeyName><IP></IP><Status>0</Status><LaunchTime>2010-04-19T10:03:34.327-04:00</LaunchTime><ExpirationTime>2010-04-26T10:03:43.610-04:00</ExpirationTime><ProductCodes/><Software><Application><Name>SUSE Linux Enterprise</Name><Version>10 SP2</Version><Type>OS</Type></Application></Software></Instance></ns2:CreateInstanceResponse>

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/create.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/create.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/create.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/libcloud/trunk/test/fixtures/ibm/delete.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/fixtures/ibm/delete.xml?rev=938721&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/fixtures/ibm/delete.xml (added)
+++ incubator/libcloud/trunk/test/fixtures/ibm/delete.xml Tue Apr 27 23:32:35 2010
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:DeleteInstanceResponse xmlns:ns2="http://www.ibm.com/xmlns/b2b/cloud/api/2009-04-03"/>

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/delete.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/delete.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/delete.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/libcloud/trunk/test/fixtures/ibm/images.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/fixtures/ibm/images.xml?rev=938721&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/fixtures/ibm/images.xml (added)
+++ incubator/libcloud/trunk/test/fixtures/ibm/images.xml Tue Apr 27 23:32:35 2010
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:DescribeImagesResponse xmlns:ns2="http://www.ibm.com/xmlns/b2b/cloud/api/2009-04-03"><Image><ID>2</ID><ProductCodes><ProductCode>fd2d0478b132490897526b9b4433a334</ProductCode></ProductCodes><Name>Rational Build Forge Agent</Name><Location>1</Location><State>1</State><Owner>SYSTEM</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>SUSE Linux Enterprise/10 SP2</Platform><Description>Rational Build Forge provides an adaptive process execution framework that automates, orchestrates, manages, and tracks all the processes between each handoff within the assembly line of software development, creating an automated software factory.</Description><Manifest>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{A233F5A0-05A5-F21D-3E92-3793B722DFBD}/1.0/parameters.xml</Manifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{A233F5A0-05A5-F21D-3E92-3793B722DFBD}/1.0/GettingStarted.html</Documen
 tation><SupportedInstanceTypes><InstanceType>SMALL</InstanceType><InstanceType>MEDIUM</InstanceType><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2009-04-25T00:00:00.000-04:00</CreatedTime></Image><Image><ID>3</ID><ProductCodes><ProductCode>84e900960c3d4b648fa6d4670aed2cd1</ProductCode></ProductCodes><Name>SUSE 10 SP2</Name><Location>1</Location><State>1</State><Owner>SYSTEM</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>SUSE Linux Enterprise/10 SP2</Platform><Description>SuSE v10.2 Base OS Image</Description><Manifest>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{07F112A1-84A7-72BF-B8FD-B36011E0E433}/1.0/parameters.xml</Manifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{07F112A1-84A7-72BF-B8FD-B36011E0E433}/1.0/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>SMALL</InstanceType><InstanceType>MEDIUM</InstanceType><Insta
 nceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2009-04-25T00:00:00.000-04:00</CreatedTime></Image><Image><ID>15</ID><ProductCodes><ProductCode>a72d3e7bb1cb4942ab0da2968e2e77bb</ProductCode></ProductCodes><Name>WebSphere Application Server and Rational Agent Controller</Name><Location>1</Location><State>1</State><Owner>SYSTEM</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>SUSE Linux Enterprise/10 SP2</Platform><Description>WebSphere Application Server and Rational Agent Controller enables a performance based foundation to build, reuse, run, integrate and manage Service Oriented Architecture (SOA) applications and services.</Description><Manifest>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{86E8E71D-29A3-86DE-8A26-792C5E839D92}/1.0/parameters.xml</Manifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{86E8E71D-29A3-86DE-8A26-792C5E839D92}/1.0/GettingStarte
 d.html</Documentation><SupportedInstanceTypes><InstanceType>SMALL</InstanceType><InstanceType>MEDIUM</InstanceType><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2009-04-25T00:00:00.000-04:00</CreatedTime></Image><Image><ID>11</ID><ProductCodes><ProductCode>7da905ba0fdf4d8b8f94e7f4ef43c1be</ProductCode></ProductCodes><Name>Rational Insight</Name><Location>1</Location><State>1</State><Owner>SYSTEM</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>SUSE Linux Enterprise/10 SP2</Platform><Description>Rational Insight helps organizations reduce time to market, improve quality, and take greater control of software and systems development and delivery. It provides objective dashboards and best practice metrics to identify risks, status, and trends.</Description><Manifest>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{4F774DCF-1469-EAAB-FBC3-64AE241CF8E8}/1.0/parameters.xml</Manifest><Documentation>htt
 ps://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{4F774DCF-1469-EAAB-FBC3-64AE241CF8E8}/1.0/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2009-04-25T00:00:00.000-04:00</CreatedTime></Image><Image><ID>18</ID><ProductCodes><ProductCode>edf7ad43f75943b1b0c0f915dba8d86c</ProductCode></ProductCodes><Name>DB2 Express-C</Name><Location>1</Location><State>1</State><Owner>SYSTEM</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>SUSE Linux Enterprise/10 SP2</Platform><Description>DB2 Express-C is an entry-level edition of the DB2 database server for the developer community. It has standard relational functionality and includes pureXML, and other features of DB2 for Linux, Unix, and Windows (LUW).</Description><Manifest>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{E69488DE-FB79-63CD-E51E-79505A1309BD}/2.0/parameters.xml</Man
 ifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{E69488DE-FB79-63CD-E51E-79505A1309BD}/2.0/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>SMALL</InstanceType><InstanceType>MEDIUM</InstanceType><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2009-04-25T00:00:00.000-04:00</CreatedTime></Image><Image><ID>21</ID><ProductCodes><ProductCode>c03be6800bf043c0b44c584545e04099</ProductCode></ProductCodes><Name>Informix Dynamic Server Developer Edition</Name><Location>1</Location><State>1</State><Owner>SYSTEM</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>SUSE Linux Enterprise/10 SP2</Platform><Description>Informix Dynamic Server (IDS) Developer Edition is a development version of the IDS Enterprise Edition. IDS is designed to meet the database server needs of small-size to large-size enterprise businesses.</Description><Manifest>https://www-180.ibm.com/cloud
 /enterprise/beta/ram.ws/RAMSecure/artifact/{9B0C8F66-9639-CA0A-0A94-7928D7DAD6CB}/1.0/parameters.xml</Manifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{9B0C8F66-9639-CA0A-0A94-7928D7DAD6CB}/1.0/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>SMALL</InstanceType><InstanceType>MEDIUM</InstanceType><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2009-04-25T00:00:00.000-04:00</CreatedTime></Image><Image><ID>22</ID><ProductCodes><ProductCode>9b2b6482ba374a6ab4bb3585414a910a</ProductCode></ProductCodes><Name>WebSphere sMash with AppBuilder</Name><Location>1</Location><State>1</State><Owner>SYSTEM</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>SUSE Linux Enterprise/10 SP2</Platform><Description>WebSphere sMash® provides a web platform that includes support for dynamic scripting in PHP and Groovy.</Description><Manifest>https://www-180.ibm.com/cloud/en
 terprise/beta/ram.ws/RAMSecure/artifact/{88E74AC6-9CCB-2710-7E9B-936DA2CE496C}/1.0/parameters.xml</Manifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{88E74AC6-9CCB-2710-7E9B-936DA2CE496C}/1.0/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>SMALL</InstanceType><InstanceType>MEDIUM</InstanceType><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2009-04-25T00:00:00.000-04:00</CreatedTime></Image><Image><ID>10001504</ID><ProductCodes><ProductCode>16662e71fae44bdba4d7bb502a09c5e7</ProductCode></ProductCodes><Name>DB2 Enterprise V9.7 (32-bit, 90-day trial)</Name><Location>1</Location><State>1</State><Owner>leonsp@ca.ibm.com</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>SuSE v10.2</Platform><Description>DB2 Enterprise V9.7 (32-bit, 90-day trial)</Description><Manifest>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{38F2AB86-9F03-E4
 63-024D-A9ABC3AE3831}/2.0/parameters.xml</Manifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{38F2AB86-9F03-E463-024D-A9ABC3AE3831}/2.0/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>SMALL</InstanceType><InstanceType>MEDIUM</InstanceType><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2009-11-09T17:01:28.000-05:00</CreatedTime></Image><Image><ID>10002063</ID><ProductCodes><ProductCode>9da8863714964624b8b13631642c785b</ProductCode></ProductCodes><Name>RHEL 5.4 Base OS</Name><Location>1</Location><State>1</State><Owner>youngdj@us.ibm.com</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>Redhat Enterprise Linux (32-bit)/5.4</Platform><Description>Red Hat Enterprise Linux 5.4 Base OS</Description><Manifest>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{34904879-E794-A2D8-2D7C-2E8D6AD6AE77}/1.0/parameters.xml</Manifest><Documentat
 ion>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{34904879-E794-A2D8-2D7C-2E8D6AD6AE77}/1.0/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>SMALL</InstanceType><InstanceType>MEDIUM</InstanceType><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2009-11-18T13:51:12.000-05:00</CreatedTime></Image><Image><ID>10002573</ID><ProductCodes><ProductCode>e5f09a64667e4faeaf3ac661600ec6ca</ProductCode></ProductCodes><Name>Rational Build Forge</Name><Location>1</Location><State>1</State><Owner>leighw@us.ibm.com</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>SUSE Linux Enterprise/10 SP2</Platform><Description>Rational Build Forge provides an adaptive process execution framework that automates, orchestrates, manages, and tracks all the processes between each handoff within the assembly line of software development, creating an automated software factory.</Description><Manifest>https:
 //www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{22E039C6-108E-B626-ECC9-E2C9B62479FF}/1.0/parameters.xml</Manifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{22E039C6-108E-B626-ECC9-E2C9B62479FF}/1.0/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>MEDIUM</InstanceType><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2009-12-08T16:34:37.000-05:00</CreatedTime></Image><Image><ID>10003056</ID><ProductCodes><ProductCode>3e276d758ed842caafe77770d60dedea</ProductCode></ProductCodes><Name>Rational Asset Manager 7.2.0.1</Name><Location>1</Location><State>1</State><Owner>gmendel@us.ibm.com</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>Redhat Enterprise Linux (32-bit)/5.4</Platform><Description>Rational Asset Manager helps to create, modify, govern, find and reuse development assets, including SOA and systems development assets. It facilita
 tes the reuse of all types of software development related assets, potentially saving development time.</Description><Manifest>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{296C6DDF-B87B-327B-3E5A-F2C50C353A69}/1.0/parameters.xml</Manifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{296C6DDF-B87B-327B-3E5A-F2C50C353A69}/1.0/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>MEDIUM</InstanceType><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2009-12-14T14:30:57.000-05:00</CreatedTime></Image><Image><ID>10003854</ID><ProductCodes><ProductCode>e3067f999edf4914932295cfb5f79d59</ProductCode></ProductCodes><Name>WebSphere Portal/WCM 6.1.5</Name><Location>1</Location><State>1</State><Owner>mlamb@us.ibm.com</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>SUSE Linux Enterprise/10 SP2</Platform><Description>IBM® WebSphere® Portal 
 Server enables you to quickly consolidate applications and content into role-based applications, complete with search, personalization, and security capabilities.</Description><Manifest>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{279F3E12-A7EF-0768-135B-F08B66DF8F71}/1.0/parameters.xml</Manifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{279F3E12-A7EF-0768-135B-F08B66DF8F71}/1.0/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>SMALL</InstanceType><InstanceType>MEDIUM</InstanceType><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2010-01-12T18:06:29.000-05:00</CreatedTime></Image><Image><ID>10003864</ID><ProductCodes><ProductCode>0112efd8f1e144998f2a70a165d00bd3</ProductCode></ProductCodes><Name>Rational Quality Manager</Name><Location>1</Location><State>1</State><Owner>brownms@gmail.com</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture
 ><Platform>Redhat Enterprise Linux (32-bit)/5.4</Platform><Description>Rational Quality Manager provides a collaborative application lifecycle management (ALM) environment for test planning, construction, and execution.</Description><Manifest>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{9DA927BA-2CEF-1686-71B0-2BAC468B7445}/1.0/parameters.xml</Manifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{9DA927BA-2CEF-1686-71B0-2BAC468B7445}/1.0/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>SMALL</InstanceType><InstanceType>MEDIUM</InstanceType><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2010-01-15T09:40:12.000-05:00</CreatedTime></Image><Image><ID>10003865</ID><ProductCodes><ProductCode>3fbf6936e5cb42b5959ad9837add054f</ProductCode></ProductCodes><Name>IBM Mashup Center with IBM Lotus Widget Factory</Name><Location>1</Location><State>1</State><Owner>mgilmore
 @us.ibm.com</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>SUSE Linux Enterprise/10 SP2</Platform><Description>IBM Mashup Center is an end-to-end enterprise mashup platform, supporting rapid assembly of dynamic web applications with the management, security, and governance capabilities.</Description><Manifest>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{0F867D03-588B-BA51-4E18-4CE9D11AECFC}/1.0/parameters.xml</Manifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{0F867D03-588B-BA51-4E18-4CE9D11AECFC}/1.0/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>SMALL</InstanceType><InstanceType>MEDIUM</InstanceType><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2010-01-15T10:44:24.000-05:00</CreatedTime></Image><Image><ID>10003780</ID><ProductCodes><ProductCode>425e2dfef95647498561f98c4de356ab</ProductCode></ProductCodes><Name>Ratio
 nal Team Concert</Name><Location>1</Location><State>1</State><Owner>sonia_dimitrov@ca.ibm.com</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>Redhat Enterprise Linux (32-bit)/5.4</Platform><Description>Rational Team Concert is a collaborative software delivery environment that empowers project teams to simplify, automate and govern software delivery.</Description><Manifest>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{679CA6F5-1E8E-267B-0C84-F7B0B41DF1DC}/1.0/parameters.xml</Manifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{679CA6F5-1E8E-267B-0C84-F7B0B41DF1DC}/1.0/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>MEDIUM</InstanceType><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2010-01-19T14:13:58.000-05:00</CreatedTime></Image><Image><ID>10003785</ID><ProductCodes><ProductCode>c4867b72f2fc43fe982e76c76c32efaa</ProductC
 ode></ProductCodes><Name>Lotus Forms Turbo 3.5.1</Name><Location>1</Location><State>1</State><Owner>rlintern@ca.ibm.com</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>SUSE Linux Enterprise/10 SP2</Platform><Description>Lotus Forms Turbo requires no training and is designed to help customers address basic form software requirements such as surveys, applications, feedback, orders, request for submission, and more - without involvement from the IT department.</Description><Manifest>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{846AD7D3-9A0F-E02C-89D2-BE250CAE2318}/1.0/parameters.xml</Manifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{846AD7D3-9A0F-E02C-89D2-BE250CAE2318}/1.0/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2010-01-22T13:27:08.000-05:00</CreatedTime></Image><Image><ID>10005598
 </ID><ProductCodes><ProductCode/></ProductCodes><Name>Rational Requirements Composer</Name><Location>1</Location><State>1</State><Owner>mutdosch@us.ibm.com</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>Redhat Enterprise Linux (32-bit)/5.4</Platform><Description>Rational Requirements Composer helps teams define and use requirements effectively across the project lifecycle.</Description><Manifest>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{28C7B870-2C0A-003F-F886-B89F5B413B77}/1.0/parameters.xml</Manifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{28C7B870-2C0A-003F-F886-B89F5B413B77}/1.0/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>MEDIUM</InstanceType><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2010-02-08T11:43:18.000-05:00</CreatedTime></Image><Image><ID>10007509</ID><ProductCodes><ProductCode/></ProductCodes><N
 ame>Rational Software Architecture</Name><Location>1</Location><State>1</State><Owner>danberg@us.ibm.com</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>SUSE Linux Enterprise/10 SP2</Platform><Description>Rational Software Architect for WebSphere with the Cloud Client plug-ins created on 2/22/10 8:06 PM</Description><Manifest>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{2C6FB6D2-CB87-C4A0-CDE0-5AAF03E214B2}/1.1/parameters.xml</Manifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{2C6FB6D2-CB87-C4A0-CDE0-5AAF03E214B2}/1.1/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2010-02-22T20:03:18.000-05:00</CreatedTime></Image><Image><ID>10008319</ID><ProductCodes><ProductCode/></ProductCodes><Name>WebSphere Feature Pack for OSGi Apps and JPA 2.0</Name><Location>1</Location><State>1</State><Owner>rad
 avenp@us.ibm.com</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>SUSE Linux Enterprise/10 SP2</Platform><Description>IBM WebSphere Application Server V7.0 Fix Pack 7, Feature Pack for OSGi Applications and Java Persistence API 2.0 Open Beta, and Feature Pack for Service Component Architecture (SCA) V1.0.1 Fix Pack V1.0.1.1</Description><Manifest>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{A397B7CD-A1C7-1956-7AEF-6AB495E37958}/1.0/parameters.xml</Manifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{A397B7CD-A1C7-1956-7AEF-6AB495E37958}/1.0/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>SMALL</InstanceType><InstanceType>MEDIUM</InstanceType><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2010-03-14T21:06:38.000-04:00</CreatedTime></Image><Image><ID>10008273</ID><ProductCodes><ProductCode/></ProductCodes><Name>Rational Softw
 are Architect for WebSphere</Name><Location>1</Location><State>1</State><Owner>danberg@us.ibm.com</Owner><Visibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>SUSE Linux Enterprise/10 SP2</Platform><Description>Rational Software Architect for WebSphere with the Cloud Client plug-ins created on 3/15/10 12:21 PM</Description><Manifest>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{839D92BB-DEA5-9820-8E2E-AE5D0A6DEAE3}/1.1/parameters.xml</Manifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{839D92BB-DEA5-9820-8E2E-AE5D0A6DEAE3}/1.1/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2010-03-15T12:17:26.000-04:00</CreatedTime></Image><Image><ID>10008404</ID><ProductCodes><ProductCode/></ProductCodes><Name>Rational Application Developer</Name><Location>1</Location><State>1</State><Owner>khiamt@ca.ibm.com</Owner><V
 isibility>PUBLIC</Visibility><Architecture>i386</Architecture><Platform>SUSE Linux Enterprise/10 SP2</Platform><Description>An Eclipse-based IDE with visual development features that helps Java developers rapidly design, develop, assemble, test, profile and deploy high quality Java/J2EE, Portal, Web/Web 2.0, Web services and SOA applications. (03/16/2010)</Description><Manifest>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{6A957586-A17A-4927-7C71-0FDE280DB66B}/1.0/parameters.xml</Manifest><Documentation>https://www-180.ibm.com/cloud/enterprise/beta/ram.ws/RAMSecure/artifact/{6A957586-A17A-4927-7C71-0FDE280DB66B}/1.0/GettingStarted.html</Documentation><SupportedInstanceTypes><InstanceType>MEDIUM</InstanceType><InstanceType>LARGE</InstanceType></SupportedInstanceTypes><CreatedTime>2010-03-16T00:10:30.000-04:00</CreatedTime></Image></ns2:DescribeImagesResponse>
\ No newline at end of file

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/images.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/images.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/images.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/libcloud/trunk/test/fixtures/ibm/instances.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/fixtures/ibm/instances.xml?rev=938721&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/fixtures/ibm/instances.xml (added)
+++ incubator/libcloud/trunk/test/fixtures/ibm/instances.xml Tue Apr 27 23:32:35 2010
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:DescribeInstancesResponse xmlns:ns2="http://www.ibm.com/xmlns/b2b/cloud/api/2009-04-03"><Instance><ID>26557</ID><Location>1</Location><RequestID name="Insight Instance">26557</RequestID><Name>Insight Instance</Name><Owner>woodser@us.ibm.com</Owner><ImageID>11</ImageID><InstanceType>LARGE</InstanceType><KeyName>Public key</KeyName><Hostname>vm519.developer.ihost.com</Hostname><IP>129.33.196.128</IP><Status>5</Status><LaunchTime>2010-04-06T15:40:24.745-04:00</LaunchTime><ExpirationTime>2010-04-19T04:00:00.000-04:00</ExpirationTime><ProductCodes/><Software><Application><Name>SUSE Linux Enterprise</Name><Version>10 SP2</Version><Type>OS</Type></Application></Software></Instance><Instance><ID>28193</ID><Location>1</Location><RequestID name="RAD instance">28193</RequestID><Name>RAD instance</Name><Owner>woodser@us.ibm.com</Owner><ImageID>10008404</ImageID><InstanceType>MEDIUM</InstanceType><KeyName>asdff</KeyName><Status>
 2</Status><LaunchTime>2010-04-15T15:20:10.317-04:00</LaunchTime><ExpirationTime>2010-04-22T15:20:19.564-04:00</ExpirationTime><ProductCodes/><Software><Application><Name>SUSE Linux Enterprise</Name><Version>10 SP2</Version><Type>OS</Type></Application></Software></Instance><Instance><ID>28194</ID><Location>1</Location><RequestID name="RSA">28194</RequestID><Name>RSA</Name><Owner>woodser@us.ibm.com</Owner><ImageID>10007509</ImageID><InstanceType>LARGE</InstanceType><KeyName>asdff</KeyName><Status>2</Status><LaunchTime>2010-04-15T15:23:04.753-04:00</LaunchTime><ExpirationTime>2010-04-22T15:23:13.658-04:00</ExpirationTime><ProductCodes/><Software><Application><Name>SUSE Linux Enterprise</Name><Version>10 SP2</Version><Type>OS</Type></Application></Software></Instance></ns2:DescribeInstancesResponse>
\ No newline at end of file

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/instances.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/instances.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/instances.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/libcloud/trunk/test/fixtures/ibm/instances_deleted.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/fixtures/ibm/instances_deleted.xml?rev=938721&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/fixtures/ibm/instances_deleted.xml (added)
+++ incubator/libcloud/trunk/test/fixtures/ibm/instances_deleted.xml Tue Apr 27 23:32:35 2010
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:DescribeInstancesResponse xmlns:ns2="http://www.ibm.com/xmlns/b2b/cloud/api/2009-04-03"><Instance><ID>26557</ID><Location>1</Location><RequestID name="Insight Instance">26557</RequestID><Name>Insight Instance</Name><Owner>woodser@us.ibm.com</Owner><ImageID>11</ImageID><InstanceType>LARGE</InstanceType><KeyName>Public key</KeyName><Hostname>vm519.developer.ihost.com</Hostname><IP>129.33.196.128</IP><Status>5</Status><LaunchTime>2010-04-06T15:40:24.745-04:00</LaunchTime><ExpirationTime>2010-04-19T04:00:00.000-04:00</ExpirationTime><ProductCodes/><Software><Application><Name>SUSE Linux Enterprise</Name><Version>10 SP2</Version><Type>OS</Type></Application></Software></Instance><Instance><ID>28194</ID><Location>1</Location><RequestID name="RSA">28194</RequestID><Name>RSA</Name><Owner>woodser@us.ibm.com</Owner><ImageID>10007509</ImageID><InstanceType>LARGE</InstanceType><KeyName>asdff</KeyName><Status>2</Status><LaunchTi
 me>2010-04-15T15:23:04.753-04:00</LaunchTime><ExpirationTime>2010-04-22T15:23:13.658-04:00</ExpirationTime><ProductCodes/><Software><Application><Name>SUSE Linux Enterprise</Name><Version>10 SP2</Version><Type>OS</Type></Application></Software></Instance></ns2:DescribeInstancesResponse>
\ No newline at end of file

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/instances_deleted.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/instances_deleted.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/instances_deleted.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/libcloud/trunk/test/fixtures/ibm/locations.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/fixtures/ibm/locations.xml?rev=938721&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/fixtures/ibm/locations.xml (added)
+++ incubator/libcloud/trunk/test/fixtures/ibm/locations.xml Tue Apr 27 23:32:35 2010
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:DescribeLocationsResponse xmlns:ns2="http://www.ibm.com/xmlns/b2b/cloud/api/2009-04-03"><Location><ID>1</ID><Name>US North East: Poughkeepsie, NY</Name><Description></Description><Location>POK</Location><Capabilities><Capability id="oss.storage.capacity"><Entry key="SMALL"><Value>50</Value></Entry><Entry key="MEDIUM"><Value>100</Value></Entry><Entry key="LARGE"><Value>200</Value></Entry></Capability><Capability id="oss.storage.format"><Entry key="EXT3"><Value>ext3</Value></Entry></Capability><Capability id="oss.instance.spec.i386"><Entry key="SMALL"><Value>SMALL</Value></Entry><Entry key="MEDIUM"><Value>MEDIUM</Value></Entry><Entry key="LARGE"><Value>LARGE</Value></Entry></Capability><Capability id="oss.instance.spec.x86_64"/></Capabilities></Location></ns2:DescribeLocationsResponse>
\ No newline at end of file

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/locations.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/locations.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/locations.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/libcloud/trunk/test/fixtures/ibm/reboot_active.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/fixtures/ibm/reboot_active.xml?rev=938721&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/fixtures/ibm/reboot_active.xml (added)
+++ incubator/libcloud/trunk/test/fixtures/ibm/reboot_active.xml Tue Apr 27 23:32:35 2010
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:RestartInstanceResponse xmlns:ns2="http://www.ibm.com/xmlns/b2b/cloud/api/2009-04-03"/>

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/reboot_active.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/reboot_active.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/reboot_active.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/libcloud/trunk/test/fixtures/ibm/sizes.xml
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/fixtures/ibm/sizes.xml?rev=938721&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/fixtures/ibm/sizes.xml (added)
+++ incubator/libcloud/trunk/test/fixtures/ibm/sizes.xml Tue Apr 27 23:32:35 2010
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:RestartInstanceResponse xmlns:ns2="http://www.ibm.com/xmlns/b2b/cloud/api/2009-04-03"/>

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/sizes.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/sizes.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/libcloud/trunk/test/fixtures/ibm/sizes.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/libcloud/trunk/test/secrets.py-dist
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/secrets.py-dist?rev=938721&r1=938720&r2=938721&view=diff
==============================================================================
--- incubator/libcloud/trunk/test/secrets.py-dist (original)
+++ incubator/libcloud/trunk/test/secrets.py-dist Tue Apr 27 23:32:35 2010
@@ -46,4 +46,7 @@ VOXEL_KEY=''
 VOXEL_SECRET=''
 
 ECP_USER_NAME=''
-ECP_PASSWORD=''
\ No newline at end of file
+ECP_PASSWORD=''
+
+IBM_USER=''
+IBM_SECRET=''

Added: incubator/libcloud/trunk/test/test_ibm.py
URL: http://svn.apache.org/viewvc/incubator/libcloud/trunk/test/test_ibm.py?rev=938721&view=auto
==============================================================================
--- incubator/libcloud/trunk/test/test_ibm.py (added)
+++ incubator/libcloud/trunk/test/test_ibm.py Tue Apr 27 23:32:35 2010
@@ -0,0 +1,204 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# libcloud.org licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+import unittest
+import httplib
+
+from test.file_fixtures import FileFixtures
+from libcloud.types import InvalidCredsException
+from libcloud.drivers.ibm import IBMNodeDriver as IBM
+from libcloud.base import Node, NodeImage, NodeSize
+from test import MockHttp, TestCaseMixin
+from secrets import IBM_USER, IBM_SECRET
+from libcloud.base import NodeImage, NodeSize, NodeLocation
+
+class IBMTests(unittest.TestCase, TestCaseMixin):
+    """
+    Tests the IBM Developer Cloud driver.
+    """
+    
+    def setUp(self):
+        IBM.connectionCls.conn_classes = (None, IBMMockHttp)
+        IBMMockHttp.type = None
+        self.driver = IBM(IBM_USER, IBM_SECRET)
+    
+    def test_auth(self):
+        IBMMockHttp.type = 'UNAUTHORIZED'
+        
+        try:
+            self.driver.list_nodes()
+        except InvalidCredsException, e:
+            self.assertTrue(isinstance(e, InvalidCredsException))
+            self.assertEquals(e.value, '401: Unauthorized')
+        else:  
+            self.fail('test should have thrown')
+                
+    def test_list_nodes(self):
+        ret = self.driver.list_nodes()
+        self.assertEquals(len(ret), 3)
+        self.assertEquals(ret[0].id, '26557')
+        self.assertEquals(ret[0].name, 'Insight Instance')
+        self.assertEquals(ret[0].public_ip, '129.33.196.128')
+        self.assertEquals(ret[0].private_ip, None)  # Private IPs not supported
+        self.assertEquals(ret[1].public_ip, None)   # Node is non-active (no IP)
+        self.assertEquals(ret[1].private_ip, None)
+        self.assertEquals(ret[1].id, '28193')
+        
+    def test_list_sizes(self):
+        ret = self.driver.list_sizes()
+        self.assertEquals(len(ret), 3) # 3 instance configurations supported
+        self.assertEquals(ret[0].id, 'SMALL')
+        self.assertEquals(ret[1].id, 'MEDIUM')
+        self.assertEquals(ret[2].id, 'LARGE')
+        self.assertEquals(ret[0].name, 'SMALL')
+        self.assertEquals(ret[0].disk, None)
+        
+    def test_list_images(self):
+        ret = self.driver.list_images()
+        self.assertEqual(len(ret), 21)
+        self.assertEqual(ret[10].name, "Rational Asset Manager 7.2.0.1")
+        self.assertEqual(ret[9].id, '10002573')
+        
+    def test_list_locations(self):
+        ret = self.driver.list_locations()
+        self.assertEquals(len(ret), 1)
+        self.assertEquals(ret[0].id, '1')
+        self.assertEquals(ret[0].name, 'US North East: Poughkeepsie, NY')
+        self.assertEquals(ret[0].country, 'US')
+        
+    def test_create_node(self):
+        # Test creation of node
+        IBMMockHttp.type = 'CREATE'
+        image = NodeImage(id=11, name='Rational Insight', driver=self.driver)
+        size = NodeSize('LARGE', 'LARGE', None, None, None, None, self.driver)
+        location = NodeLocation('1', 'POK', 'US', driver=self.driver)
+        ret = self.driver.create_node(name='RationalInsight4',
+                                      image=image,
+                                      size=size,
+                                      location=location,
+                                      publicKey='MyPublicKey',
+                                      configurationData = {
+                                           'insight_admin_password': 'myPassword1',
+                                           'db2_admin_password': 'myPassword2',
+                                           'report_user_password': 'myPassword3'})
+        self.assertTrue(isinstance(ret, Node))
+        self.assertEquals(ret.name, 'RationalInsight4')
+        
+        # Test creation attempt with invalid location
+        IBMMockHttp.type = 'CREATE_INVALID'
+        location = NodeLocation('3', 'DOESNOTEXIST', 'US', driver=self.driver)
+        try:
+            ret = self.driver.create_node(name='RationalInsight5',
+                                          image=image,
+                                          size=size,
+                                          location=location,
+                                          publicKey='MyPublicKey',
+                                          configurationData = {
+                                               'insight_admin_password': 'myPassword1',
+                                               'db2_admin_password': 'myPassword2',
+                                               'report_user_password': 'myPassword3'})
+        except Exception, e:
+            self.assertEquals(e.args[0], 'Error 412: No DataCenter with id: 3')
+        else:
+            self.fail('test should have thrown')
+        
+    def test_destroy_node(self):        
+        # Delete existant node
+        nodes = self.driver.list_nodes()            # retrieves 3 nodes
+        self.assertEquals(len(nodes), 3)
+        IBMMockHttp.type = 'DELETE'
+        toDelete = nodes[1]
+        ret = self.driver.destroy_node(toDelete)
+        self.assertTrue(ret)
+        
+        # Delete non-existant node
+        IBMMockHttp.type = 'DELETED'
+        nodes = self.driver.list_nodes()            # retrieves 2 nodes
+        self.assertEquals(len(nodes), 2)
+        try:
+            self.driver.destroy_node(toDelete)      # delete non-existent node
+        except Exception, e:
+            self.assertEquals(e.args[0], 'Error 404: Invalid Instance ID 28193')
+        else:
+            self.fail('test should have thrown')
+            
+    def test_reboot_node(self):
+        nodes = self.driver.list_nodes()
+        IBMMockHttp.type = 'REBOOT'
+        
+        # Reboot active node
+        self.assertEquals(len(nodes), 3)
+        ret = self.driver.reboot_node(nodes[0])
+        self.assertTrue(ret)
+        
+        # Reboot inactive node
+        try:
+            ret = self.driver.reboot_node(nodes[1])
+        except Exception, e:
+            self.assertEquals(e.args[0], 'Error 412: Instance must be in the Active state')
+        else:
+            self.fail('test should have thrown')
+        
+class IBMMockHttp(MockHttp):
+    fixtures = FileFixtures('ibm')
+    
+    def _cloud_enterprise_beta_api_rest_20090403_instances(self, method, url, body, headers):
+        body = self.fixtures.load('instances.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+    
+    def _cloud_enterprise_beta_api_rest_20090403_instances_DELETED(self, method, url, body, headers):
+        body = self.fixtures.load('instances_deleted.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+    
+    def _cloud_enterprise_beta_api_rest_20090403_instances_UNAUTHORIZED(self, method, url, body, headers):
+        return (httplib.UNAUTHORIZED, body, {}, httplib.responses[httplib.UNAUTHORIZED])
+        
+    def _cloud_enterprise_beta_api_rest_20090403_images(self, method, url, body, headers):
+        body = self.fixtures.load('images.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+        
+    def _cloud_enterprise_beta_api_rest_20090403_locations(self, method, url, body, headers):
+        body = self.fixtures.load('locations.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+        
+    def _cloud_enterprise_beta_api_rest_20090403_instances_26557_REBOOT(self, method, url, body, headers):
+        body = self.fixtures.load('reboot_active.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+        
+    def _cloud_enterprise_beta_api_rest_20090403_instances_28193_REBOOT(self, method, url, body, headers):
+        return (412, 'Error 412: Instance must be in the Active state', {}, 'Precondition Failed')
+    
+    def _cloud_enterprise_beta_api_rest_20090403_instances_28193_DELETE(self, method, url, body, headers):
+        body = self.fixtures.load('delete.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+    
+    def _cloud_enterprise_beta_api_rest_20090403_instances_28193_DELETED(self, method, url, body, headers):
+        return (404, 'Error 404: Invalid Instance ID 28193', {}, 'Precondition Failed')
+    
+    def _cloud_enterprise_beta_api_rest_20090403_instances_CREATE(self, method, url, body, headers):
+        body = self.fixtures.load('create.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+    
+    def _cloud_enterprise_beta_api_rest_20090403_instances_CREATE_INVALID(self, method, url, body, headers):
+        return (412, 'Error 412: No DataCenter with id: 3', {}, 'Precondition Failed')
+    
+    # This is only to accomodate the response tests built into test\__init__.py
+    def _cloud_enterprise_beta_api_rest_20090403_instances_26557(self, method, url, body, headers):
+        if method == 'DELETE':
+            body = self.fixtures.load('delete.xml')
+        else:
+            body = self.fixtures.load('reboot_active.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+        
+if __name__ == '__main__':
+    sys.exit(unittest.main())
\ No newline at end of file

Propchange: incubator/libcloud/trunk/test/test_ibm.py
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/libcloud/trunk/test/test_ibm.py
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/libcloud/trunk/test/test_ibm.py
------------------------------------------------------------------------------
    svn:mime-type = text/plain