You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2013/04/21 20:17:58 UTC
svn commit: r1470329 - in /libcloud/trunk: CHANGES
libcloud/compute/drivers/joyent.py libcloud/test/compute/test_joyent.py
Author: tomaz
Date: Sun Apr 21 18:17:58 2013
New Revision: 1470329
URL: http://svn.apache.org/r1470329
Log:
Add ex_start_node method to the Joyent driver.
Contributed by rszabo50, part of LIBCLOUD-319.
Modified:
libcloud/trunk/CHANGES
libcloud/trunk/libcloud/compute/drivers/joyent.py
libcloud/trunk/libcloud/test/compute/test_joyent.py
Modified: libcloud/trunk/CHANGES
URL: http://svn.apache.org/viewvc/libcloud/trunk/CHANGES?rev=1470329&r1=1470328&r2=1470329&view=diff
==============================================================================
--- libcloud/trunk/CHANGES (original)
+++ libcloud/trunk/CHANGES Sun Apr 21 18:17:58 2013
@@ -7,6 +7,9 @@ Changes with Apache Libcloud in deveplom
- Fix destroy_node method in the experimental libvirt driver.
[Aymen Fitati]
+ - Add ex_start_node method to the Joyent driver. (LIBCLOUD-319)
+ [rszabo50]
+
Changes with Apache Libcloud 0.12.4:
*) Compute
Modified: libcloud/trunk/libcloud/compute/drivers/joyent.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/drivers/joyent.py?rev=1470329&r1=1470328&r2=1470329&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/drivers/joyent.py (original)
+++ libcloud/trunk/libcloud/compute/drivers/joyent.py Sun Apr 21 18:17:58 2013
@@ -186,6 +186,20 @@ class JoyentNodeDriver(NodeDriver):
data=data, method='POST')
return result.status == httplib.ACCEPTED
+ def ex_start_node(self, node):
+ """
+ Start node
+
+ @param node: The node to be stopped
+ @type node: L{Node}
+
+ @rtype: C{bool}
+ """
+ data = json.dumps({'action': 'start'})
+ result = self.connection.request('/my/machines/%s' % (node.id),
+ data=data, method='POST')
+ return result.status == httplib.ACCEPTED
+
def _to_node(self, data):
state = NODE_STATE_MAP[data['state']]
public_ips = []
Modified: libcloud/trunk/libcloud/test/compute/test_joyent.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/test/compute/test_joyent.py?rev=1470329&r1=1470328&r2=1470329&view=diff
==============================================================================
--- libcloud/trunk/libcloud/test/compute/test_joyent.py (original)
+++ libcloud/trunk/libcloud/test/compute/test_joyent.py Sun Apr 21 18:17:58 2013
@@ -76,6 +76,10 @@ class JoyentTestCase(unittest.TestCase):
node = self.driver.list_nodes()[0]
self.assertTrue(self.driver.ex_stop_node(node))
+ def test_ex_start_node(self):
+ node = self.driver.list_nodes()[0]
+ self.assertTrue(self.driver.ex_start_node(node))
+
class JoyentHttp(MockHttp):
fixtures = ComputeFileFixtures('joyent')