You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by an...@apache.org on 2016/10/24 12:38:37 UTC
[1/3] libcloud git commit: changes for #919
Repository: libcloud
Updated Branches:
refs/heads/trunk 90a8673e8 -> 5ef94eb3a
changes for #919
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/3a1928ac
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/3a1928ac
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/3a1928ac
Branch: refs/heads/trunk
Commit: 3a1928aca0ec1909910050192829abc1b979d830
Parents: 90a8673
Author: Anthony Shaw <an...@apache.org>
Authored: Mon Oct 24 13:36:58 2016 +0100
Committer: Anthony Shaw <an...@apache.org>
Committed: Mon Oct 24 13:36:58 2016 +0100
----------------------------------------------------------------------
CHANGES.rst | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/3a1928ac/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index bfb38a1..91fb33b 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -8,6 +8,10 @@ Changes in current version of Apache Libcloud
Compute
~~~~~~~
+- [openstack] add ex_start_node for the openstack driver
+ (GITHUB-919)
+ [Rick van de Loo]
+
- [vultr] Extra Attributes for Node Creation on Vultr
(GITHUB-917)
[Fahri Cihan Demirci]
[2/3] libcloud git commit: add ex_hard_reboot in DigitalOcean_v2
driver
Posted by an...@apache.org.
add ex_hard_reboot in DigitalOcean_v2 driver
implement power_cycle
Closes #920
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/da5f6804
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/da5f6804
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/da5f6804
Branch: refs/heads/trunk
Commit: da5f68045147a036d189fc606fb4720951bd03e0
Parents: 3a1928a
Author: Rick van de Loo <ri...@gmail.com>
Authored: Fri Oct 21 14:17:42 2016 +0200
Committer: Anthony Shaw <an...@apache.org>
Committed: Mon Oct 24 13:37:43 2016 +0100
----------------------------------------------------------------------
libcloud/compute/drivers/digitalocean.py | 6 ++++++
.../compute/fixtures/digitalocean/ex_hard_reboot.json | 12 ++++++++++++
.../fixtures/digitalocean_v2/ex_hard_reboot.json | 12 ++++++++++++
libcloud/test/compute/test_digitalocean_v2.py | 12 ++++++++++++
4 files changed, 42 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/da5f6804/libcloud/compute/drivers/digitalocean.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/digitalocean.py b/libcloud/compute/drivers/digitalocean.py
index 7a676b6..335e065 100644
--- a/libcloud/compute/drivers/digitalocean.py
+++ b/libcloud/compute/drivers/digitalocean.py
@@ -256,6 +256,12 @@ class DigitalOcean_v2_NodeDriver(DigitalOcean_v2_BaseDriver,
data=json.dumps(attr), method='POST')
return res.status == httplib.CREATED
+ def ex_hard_reboot(self, node):
+ attr = {'type': 'power_cycle'}
+ res = self.connection.request('/v2/droplets/%s/actions' % (node.id),
+ data=json.dumps(attr), method='POST')
+ return res.status == httplib.CREATED
+
def ex_power_on_node(self, node):
attr = {'type': 'power_on'}
res = self.connection.request('/v2/droplets/%s/actions' % (node.id),
http://git-wip-us.apache.org/repos/asf/libcloud/blob/da5f6804/libcloud/test/compute/fixtures/digitalocean/ex_hard_reboot.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/digitalocean/ex_hard_reboot.json b/libcloud/test/compute/fixtures/digitalocean/ex_hard_reboot.json
new file mode 100644
index 0000000..891b32e
--- /dev/null
+++ b/libcloud/test/compute/fixtures/digitalocean/ex_hard_reboot.json
@@ -0,0 +1,12 @@
+{
+ "action": {
+ "id": 36077294,
+ "status": "in-progress",
+ "type": "power_cycle",
+ "started_at": "2014-11-04T17:08:03Z",
+ "completed_at": null,
+ "resource_id": 3067651,
+ "resource_type": "droplet",
+ "region": "ams3"
+ }
+}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/da5f6804/libcloud/test/compute/fixtures/digitalocean_v2/ex_hard_reboot.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/ex_hard_reboot.json b/libcloud/test/compute/fixtures/digitalocean_v2/ex_hard_reboot.json
new file mode 100644
index 0000000..891b32e
--- /dev/null
+++ b/libcloud/test/compute/fixtures/digitalocean_v2/ex_hard_reboot.json
@@ -0,0 +1,12 @@
+{
+ "action": {
+ "id": 36077294,
+ "status": "in-progress",
+ "type": "power_cycle",
+ "started_at": "2014-11-04T17:08:03Z",
+ "completed_at": null,
+ "resource_id": 3067651,
+ "resource_type": "droplet",
+ "region": "ams3"
+ }
+}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/da5f6804/libcloud/test/compute/test_digitalocean_v2.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_digitalocean_v2.py b/libcloud/test/compute/test_digitalocean_v2.py
index c7a916d..2ba7e90 100644
--- a/libcloud/test/compute/test_digitalocean_v2.py
+++ b/libcloud/test/compute/test_digitalocean_v2.py
@@ -148,6 +148,12 @@ class DigitalOcean_v2_Tests(LibcloudTestCase):
result = self.driver.ex_shutdown_node(node)
self.assertTrue(result)
+ def test_ex_hard_reboot_success(self):
+ node = self.driver.list_nodes()[0]
+ DigitalOceanMockHttp.type = 'POWERCYCLE'
+ result = self.driver.ex_hard_reboot(node)
+ self.assertTrue(result)
+
def test_destroy_node_success(self):
node = self.driver.list_nodes()[0]
DigitalOceanMockHttp.type = 'DESTROY'
@@ -327,6 +333,12 @@ class DigitalOceanMockHttp(MockHttpTestCase):
body = self.fixtures.load('ex_shutdown_node.json')
return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED])
+ def _v2_droplets_3164444_actions_POWERCYCLE(self, method, url,
+ body, headers):
+ # ex_hard_reboot
+ body = self.fixtures.load('ex_hard_reboot.json')
+ return (httplib.CREATED, body, {}, httplib.responses[httplib.OK])
+
def _v2_account_keys(self, method, url, body, headers):
body = self.fixtures.load('list_key_pairs.json')
return (httplib.OK, body, {}, httplib.responses[httplib.OK])
[3/3] libcloud git commit: changes for #920
Posted by an...@apache.org.
changes for #920
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/5ef94eb3
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/5ef94eb3
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/5ef94eb3
Branch: refs/heads/trunk
Commit: 5ef94eb3ab775077d397466e289c5aa3e32477d0
Parents: da5f680
Author: Anthony Shaw <an...@apache.org>
Authored: Mon Oct 24 13:38:28 2016 +0100
Committer: Anthony Shaw <an...@apache.org>
Committed: Mon Oct 24 13:38:28 2016 +0100
----------------------------------------------------------------------
CHANGES.rst | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/5ef94eb3/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index 91fb33b..243416a 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -8,6 +8,10 @@ Changes in current version of Apache Libcloud
Compute
~~~~~~~
+- [digital ocean] add ex_hard_reboot in DigitalOcean_v2 driver
+ (GITHUB-920)
+ [Rick van de Loo]
+
- [openstack] add ex_start_node for the openstack driver
(GITHUB-919)
[Rick van de Loo]