You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by qu...@apache.org on 2017/10/16 07:47:38 UTC
[1/2] libcloud git commit: add ex_enable_ipv6 in DigitalOcean_v2
driver
Repository: libcloud
Updated Branches:
refs/heads/trunk ef35d3467 -> 29c8eab97
add ex_enable_ipv6 in DigitalOcean_v2 driver
> To enable IPv6 networking on an existing Droplet
> (within a region that has IPv6 available), send
> a POST request to /v2/droplets/$DROPLET_ID/actions.
> Set the "type" attribute to enable_ipv6.
https://developers.digitalocean.com/documentation/v2/
Signed-off-by: Quentin Pradet <qu...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/dd98507d
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/dd98507d
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/dd98507d
Branch: refs/heads/trunk
Commit: dd98507d783d8a4d3a33a3d2c970377b0b73f34a
Parents: ef35d34
Author: Rick van de Loo <ri...@gmail.com>
Authored: Sun Oct 15 15:01:02 2017 +0200
Committer: Quentin Pradet <qu...@apache.org>
Committed: Mon Oct 16 11:44:45 2017 +0400
----------------------------------------------------------------------
libcloud/compute/drivers/digitalocean.py | 6 ++++++
.../fixtures/digitalocean_v2/ex_enable_ipv6.json | 13 +++++++++++++
libcloud/test/compute/test_digitalocean_v2.py | 11 +++++++++++
3 files changed, 30 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/dd98507d/libcloud/compute/drivers/digitalocean.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/digitalocean.py b/libcloud/compute/drivers/digitalocean.py
index a9b1e4f..4063c28 100644
--- a/libcloud/compute/drivers/digitalocean.py
+++ b/libcloud/compute/drivers/digitalocean.py
@@ -250,6 +250,12 @@ class DigitalOcean_v2_NodeDriver(DigitalOcean_v2_BaseDriver,
data=json.dumps(attr), method='POST')
return res.status == httplib.CREATED
+ def ex_enable_ipv6(self, node):
+ attr = {'type': 'enable_ipv6'}
+ res = self.connection.request('/v2/droplets/%s/actions' % (node.id),
+ data=json.dumps(attr), method='POST')
+ return res.status == httplib.CREATED
+
def ex_rename_node(self, node, name):
attr = {'type': 'rename', 'name': name}
res = self.connection.request('/v2/droplets/%s/actions' % (node.id),
http://git-wip-us.apache.org/repos/asf/libcloud/blob/dd98507d/libcloud/test/compute/fixtures/digitalocean_v2/ex_enable_ipv6.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/digitalocean_v2/ex_enable_ipv6.json b/libcloud/test/compute/fixtures/digitalocean_v2/ex_enable_ipv6.json
new file mode 100644
index 0000000..9386b97
--- /dev/null
+++ b/libcloud/test/compute/fixtures/digitalocean_v2/ex_enable_ipv6.json
@@ -0,0 +1,13 @@
+{
+ "action": {
+ "id": 36804954,
+ "status": "in-progress",
+ "type": "enable_ipv6",
+ "started_at": "2014-11-14T16:34:24Z",
+ "completed_at": null,
+ "resource_id": 3164450,
+ "resource_type": "droplet",
+ "region": "ams2",
+ "region_slug": "ams2"
+ }
+}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/dd98507d/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 c15dbe7..8589571 100644
--- a/libcloud/test/compute/test_digitalocean_v2.py
+++ b/libcloud/test/compute/test_digitalocean_v2.py
@@ -166,6 +166,12 @@ class DigitalOcean_v2_Tests(LibcloudTestCase):
result = self.driver.ex_change_kernel(node, 7515)
self.assertTrue(result)
+ def test_ex_enable_ipv6_success(self):
+ node = self.driver.list_nodes()[0]
+ DigitalOceanMockHttp.type = 'ENABLEIPV6'
+ result = self.driver.ex_enable_ipv6(node)
+ self.assertTrue(result)
+
def test_ex_rename_node_success(self):
node = self.driver.list_nodes()[0]
DigitalOceanMockHttp.type = 'RENAME'
@@ -312,6 +318,11 @@ class DigitalOceanMockHttp(MockHttp):
body = self.fixtures.load('ex_change_kernel.json')
return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED])
+ def _v2_droplets_3164444_actions_ENABLEIPV6(self, method, url, body, headers):
+ # enable_ipv6
+ body = self.fixtures.load('ex_enable_ipv6.json')
+ return (httplib.CREATED, body, {}, httplib.responses[httplib.CREATED])
+
def _v2_droplets_3164444_actions_RENAME(self, method, url, body, headers):
# rename_node
body = self.fixtures.load('ex_rename_node.json')
[2/2] libcloud git commit: Add changes for #1130
Posted by qu...@apache.org.
Add changes for #1130
Closes #1130
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/29c8eab9
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/29c8eab9
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/29c8eab9
Branch: refs/heads/trunk
Commit: 29c8eab97eb63bd2e7f19760958465ebf92260be
Parents: dd98507
Author: Quentin Pradet <qu...@apache.org>
Authored: Mon Oct 16 11:47:05 2017 +0400
Committer: Quentin Pradet <qu...@apache.org>
Committed: Mon Oct 16 11:47:05 2017 +0400
----------------------------------------------------------------------
CHANGES.rst | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/29c8eab9/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index 3653a4d..d8d7191 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -66,6 +66,10 @@ Compute
(LIBCLOUD-954, GITHUB-1127)
[Quentin Pradet]
+- [Digital Ocean] Add ex_enable_ipv6 in DigitalOcean_v2 driver
+ (GITHUB-1130)
+ [Rick van de Loo]
+
Storage
~~~~~~~