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 2017/09/24 14:33:07 UTC
[01/10] libcloud git commit: ProfitBricks provider API v4 update;
fix & update tests and docs
Repository: libcloud
Updated Branches:
refs/heads/trunk abe0c99ae -> a5f35e22b
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/test_profitbricks.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_profitbricks.py b/libcloud/test/compute/test_profitbricks.py
index 62c892b..da79b26 100644
--- a/libcloud/test/compute/test_profitbricks.py
+++ b/libcloud/test/compute/test_profitbricks.py
@@ -14,15 +14,18 @@
# limitations under the License.
import sys
+from six import assertRegex
from libcloud.utils.py3 import httplib
from libcloud.test import MockHttp
from libcloud.test.file_fixtures import ComputeFileFixtures
from libcloud.compute.types import Provider
from libcloud.compute.types import NodeState
+from libcloud.compute.base import NodeAuthPassword, NodeAuthSSHKey
from libcloud.compute.providers import get_driver
from libcloud.test import unittest
from libcloud.test.secrets import PROFIT_BRICKS_PARAMS
+from libcloud.common.exceptions import BaseHTTPError
class ProfitBricksTests(unittest.TestCase):
@@ -96,20 +99,21 @@ class ProfitBricksTests(unittest.TestCase):
self.assertEqual(extra['image_type'], 'CDROM')
self.assertEqual(extra['public'], True)
+ self.assertIsInstance(extra['image_aliases'], list)
def test_list_locations(self):
locations = self.driver.list_locations()
- self.assertEqual(len(locations), 3)
+ self.assertTrue(len(locations) > 0)
'''
Standard properties
'''
- location = locations[0]
- self.assertEqual(location.id, 'de/fkb')
- self.assertEqual(location.name, 'karlsruhe')
- self.assertEqual(location.country, 'de')
+ location = locations[2]
+ self.assertEqual(location.id, 'us/las')
+ self.assertEqual(location.name, 'lasvegas')
+ self.assertEqual(location.country, 'us')
def test_list_nodes(self):
@@ -129,7 +133,7 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
node.name,
- 'Test Node.'
+ 'libcloud Test'
)
self.assertEqual(
node.state,
@@ -190,13 +194,13 @@ class ProfitBricksTests(unittest.TestCase):
self.assertEqual(
extra['boot_volume']['href'],
(
- '/cloudapi/v3/datacenters/dc-1'
+ '/cloudapi/v4/datacenters/dc-1'
'/volumes/bvol-1'
)
)
self.assertEqual(
extra['boot_volume']['properties']['name'],
- 'Test Node Volume'
+ 'libcloud Test'
)
self.assertEqual(
extra['boot_volume']['properties']['type'],
@@ -204,7 +208,7 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['boot_volume']['properties']['size'],
- 10
+ 2
)
self.assertEqual(
extra['boot_volume']['properties']['image'],
@@ -239,152 +243,12 @@ class ProfitBricksTests(unittest.TestCase):
def test_list_volumes(self):
volumes = self.driver.list_volumes()
- self.assertEqual(len(volumes), 3)
-
- volume = volumes[0]
- extra = volume.extra
-
- '''
- Standard properties
- '''
- self.assertEqual(
- volume.id,
- 'bvol-1'
- )
- self.assertEqual(
- volume.name,
- 'Test Volume'
- )
- self.assertEqual(
- volume.size,
- 10
- )
-
- '''
- Extra
- '''
- self.assertEqual(
- extra['provisioning_state'],
- NodeState.RUNNING)
-
- '''
- Extra metadata
- '''
- self.assertEqual(
- extra['created_by'],
- 'test@test.test'
- )
- self.assertEqual(
- extra['created_date'],
- '2016-10-18T07:20:41Z'
- )
- self.assertEqual(
- extra['etag'],
- '33f6b8d506e7ad756e8554b915f29c61'
- )
- self.assertEqual(
- extra['last_modified_date'],
- '2016-10-18T07:20:41Z'
- )
- self.assertEqual(
- extra['last_modified_by'],
- 'test@test.test'
- )
- self.assertEqual(
- extra['state'],
- 'AVAILABLE'
- )
-
- '''
- Extra properties
- '''
- self.assertEqual(
- extra['name'],
- 'Test Volume'
- )
- self.assertEqual(
- extra['type'],
- 'HDD'
- )
- self.assertEqual(
- extra['size'],
- 10
- )
- self.assertEqual(
- extra['availability_zone'],
- 'AUTO'
- )
- self.assertEqual(
- extra['image'],
- 'bvol-img'
- )
- self.assertEqual(
- extra['image_password'],
- None
- )
- self.assertEqual(
- extra['ssh_keys'],
- None
- )
- self.assertEqual(
- extra['bus'],
- 'VIRTIO'
- )
- self.assertEqual(
- extra['licence_type'],
- 'LINUX'
- )
- self.assertEqual(
- extra['cpu_hot_plug'],
- True
- )
-
- self.assertEqual(
- extra['cpu_hot_unplug'],
- False
- )
- self.assertEqual(
- extra['ram_hot_plug'],
- True
- )
- self.assertEqual(
- extra['ram_hot_unplug'],
- False
- )
- self.assertEqual(
- extra['nic_hot_plug'],
- True
- )
- self.assertEqual(
- extra['nic_hot_unplug'],
- True
- )
-
- self.assertEqual(
- extra['disc_virtio_hot_plug'],
- True
- )
- self.assertEqual(
- extra['disc_virtio_hot_unplug'],
- True
- )
- self.assertEqual(
- extra['disc_scsi_hot_plug'],
- False
- )
- self.assertEqual(
- extra['disc_scsi_hot_unplug'],
- False
- )
- self.assertEqual(
- extra['device_number'],
- 1
- )
+ self.assertTrue(len(volumes) > 0)
def test_ex_list_datacenters(self):
datacenters = self.driver.ex_list_datacenters()
- self.assertEqual(len(datacenters), 1)
+ self.assertTrue(len(datacenters) > 0)
datacenter = datacenters[0]
extra = datacenter.extra
@@ -398,11 +262,11 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
datacenter.href,
- '/cloudapi/v3/datacenters/dc-1'
+ '/cloudapi/v4/datacenters/dc-1'
)
self.assertEqual(
datacenter.name,
- 'Test One.'
+ 'libcloud Test'
)
self.assertEqual(
datacenter.version,
@@ -414,15 +278,15 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'Test One.'
+ 'libcloud Test'
)
self.assertEqual(
extra['description'],
- 'A test data center'
+ 'libcloud test datacenter'
)
self.assertEqual(
extra['location'],
- 'de/fra'
+ 'us/las'
)
self.assertEqual(
extra['version'],
@@ -477,7 +341,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_list_snapshots(self):
volume_snapshots = self.driver.list_snapshots()
- self.assertEqual(len(volume_snapshots), 1)
+ self.assertTrue(len(volume_snapshots) > 0)
snapshot = volume_snapshots[0]
@@ -606,7 +470,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_create_volume_snapshot(self):
volume = self.driver.ex_describe_volume(
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'volumes/vol-2'
)
@@ -634,7 +498,7 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
snapshot.name,
- 'Test Created Snapshot'
+ 'libcloud Test'
)
'''
@@ -642,11 +506,11 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
snapshot.extra['name'],
- 'Test Created Snapshot'
+ 'libcloud Test'
)
self.assertEqual(
snapshot.extra['description'],
- 'Test Created Snapshot'
+ 'libcloud test snapshot'
)
self.assertEqual(
snapshot.extra['location'],
@@ -730,9 +594,14 @@ class ProfitBricksTests(unittest.TestCase):
'BUSY'
)
+ def test_create_volume_snapshot_failure(self):
+ with self.assertRaises(AttributeError):
+ 'Raises attribute error if no volume'
+ self.driver.create_volume_snapshot(volume=None)
+
def test_ex_describe_snapshot(self):
snapshot_w_href = self.driver.ex_describe_snapshot(
- ex_href='/cloudapi/v3/snapshots/sshot'
+ ex_href='/cloudapi/v4/snapshots/sshot'
)
snapshot_w_id = self.driver.ex_describe_snapshot(
ex_snapshot_id='sshot'
@@ -740,6 +609,13 @@ class ProfitBricksTests(unittest.TestCase):
self._verify_snapshot(snapshot=snapshot_w_href)
self._verify_snapshot(snapshot=snapshot_w_id)
+ def test_ex_describe_snapshot_failure(self):
+ with self.assertRaises(BaseHTTPError) as cm:
+ self.driver.ex_describe_snapshot(
+ ex_snapshot_id='00000000'
+ )
+ self.assertIn('Resource does not exist', cm.exception.message.value)
+
def _verify_snapshot(self, snapshot):
'''
Standard properties
@@ -762,7 +638,7 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
snapshot.name,
- 'Test Snapshot'
+ 'libcloud Test'
)
'''
@@ -770,11 +646,11 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
snapshot.extra['name'],
- 'Test Snapshot'
+ 'libcloud Test'
)
self.assertEqual(
snapshot.extra['description'],
- 'Test Snapshot'
+ 'libcloud test snapshot'
)
self.assertEqual(
snapshot.extra['location'],
@@ -859,31 +735,40 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_update_snapshot(self):
snapshot = self.driver.ex_describe_snapshot(
- ex_href='/cloudapi/v3/snapshots/sshot'
+ ex_href='/cloudapi/v4/snapshots/sshot'
)
updated = self.driver.ex_update_snapshot(
snapshot=snapshot,
- name='Updated snapshot',
- description='Upated snapshot',
- cpu_hot_unplug=True
+ name='libcloud Test - RENAME',
+ description='libcloud test snapshot - RENAME'
)
self.assertEqual(
updated.name,
- 'Updated snapshot'
+ 'libcloud Test - RENAME'
)
self.assertEqual(
updated.extra['description'],
- 'Updated snapshot'
+ 'libcloud test snapshot - RENAME'
)
- self.assertEqual(
- updated.extra['cpu_hot_unplug'],
- True
+
+ def test_restore_volume_snapshot(self):
+ volume = self.driver.ex_describe_volume(
+ ex_datacenter_id='dc-1',
+ ex_volume_id='vol-2'
+ )
+ snapshot = self.driver.ex_describe_snapshot(
+ ex_snapshot_id='sshot'
)
+ restored = self.driver.ex_restore_volume_snapshot(
+ volume=volume,
+ snapshot=snapshot
+ )
+ self.assertTrue(restored)
def test_destroy_volume_snapshot(self):
snapshot = self.driver.ex_describe_snapshot(
- ex_href='/cloudapi/v3/snapshots/sshot'
+ ex_href='/cloudapi/v4/snapshots/sshot'
)
destroyed = self.driver.destroy_volume_snapshot(snapshot)
self.assertTrue(destroyed)
@@ -895,7 +780,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_reboot_node(self):
node = self.driver.ex_describe_node(
ex_href=(
- '/cloudapi/v3/datacenters/dc-1'
+ '/cloudapi/v4/datacenters/dc-1'
'/servers/srv-1'
)
)
@@ -904,55 +789,27 @@ class ProfitBricksTests(unittest.TestCase):
def test_create_node(self):
image = self.driver.ex_describe_image(
- ex_href='/cloudapi/v3/images/img-2'
+ ex_href='/cloudapi/v4/images/img-2'
)
datacenter = self.driver.ex_describe_datacenter(
- ex_href='/cloudapi/v3/datacenters/dc-1'
+ ex_href='/cloudapi/v4/datacenters/dc-1'
)
- sizes = self.driver.list_sizes()
-
- with self.assertRaises(ValueError):
- 'Raises value error if no size or ex_ram'
- self.driver.create_node(
- name='Test',
- image=image,
- ex_disk=40,
- ex_cores=1
- )
-
- with self.assertRaises(ValueError):
- 'Raises value error if no size or ex_cores'
- self.driver.create_node(
- name='Test',
- image=image,
- ex_disk=40,
- ex_ram=1024
- )
-
- with self.assertRaises(ValueError):
- 'Raises value error if no size or ex_disk'
- self.driver.create_node(
- name='Test',
- image=image,
- ex_cores=2,
- ex_ram=1024
- )
- with self.assertRaises(ValueError):
- 'Raises value error if no ssh keys or password'
- self.driver.create_node(
- name='Test',
- image=image,
- size=sizes[1],
- datacenter=datacenter
- )
+ ssh_key = NodeAuthSSHKey('ssh-rsa AAAAB3NzaC1')
+ password = NodeAuthPassword('secretpassword1233')
node = self.driver.create_node(
- name='Test',
+ name='libcloud Test',
image=image,
- size=sizes[1],
- ex_password='dummy1234',
- datacenter=datacenter
+ ex_ram=1024,
+ ex_cores=1,
+ ex_disk=2,
+ ex_bus_type='VIRTIO',
+ ex_disk_type='HDD',
+ ex_cpu_family='INTEL_XEON',
+ ex_password=password,
+ ex_ssh_keys=[ssh_key],
+ ex_datacenter=datacenter
)
extra = node.extra
@@ -966,7 +823,7 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
node.name,
- 'Test'
+ 'libcloud Test'
)
self.assertEqual(
node.state,
@@ -1006,7 +863,7 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'Test'
+ 'libcloud Test'
)
self.assertEqual(
extra['cores'],
@@ -1014,7 +871,7 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['ram'],
- 512
+ 1024
)
self.assertEqual(
extra['availability_zone'],
@@ -1046,17 +903,61 @@ class ProfitBricksTests(unittest.TestCase):
1
)
+ def test_create_node_failure(self):
+ image = self.driver.ex_describe_image(
+ ex_href='/cloudapi/v4/images/img-2'
+ )
+ datacenter = self.driver.ex_describe_datacenter(
+ ex_href='/cloudapi/v4/datacenters/dc-1'
+ )
+ sizes = self.driver.list_sizes()
+
+ with self.assertRaises(ValueError):
+ 'Raises value error if no size or ex_ram'
+ self.driver.create_node(
+ name='libcloud Test',
+ image=image,
+ ex_disk=40,
+ ex_cores=1
+ )
+
+ with self.assertRaises(ValueError):
+ 'Raises value error if no size or ex_cores'
+ self.driver.create_node(
+ name='libcloud Test',
+ image=image,
+ ex_disk=40,
+ ex_ram=1024
+ )
+
+ with self.assertRaises(ValueError):
+ 'Raises value error if no size or ex_disk'
+ self.driver.create_node(
+ name='libcloud Test',
+ image=image,
+ ex_cores=2,
+ ex_ram=1024
+ )
+
+ with self.assertRaises(ValueError):
+ 'Raises value error if no ssh keys or password'
+ self.driver.create_node(
+ name='libcloud Test',
+ image=image,
+ size=sizes[1],
+ ex_datacenter=datacenter
+ )
+
def test_destroy_node(self):
node = self.driver.ex_describe_node(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/srv-1'
)
)
destroyed = self.driver.destroy_node(
- node=node,
- ex_remove_attached_disks=False
+ node=node
)
self.assertTrue(destroyed)
@@ -1064,27 +965,27 @@ class ProfitBricksTests(unittest.TestCase):
node = self.driver.ex_describe_node(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/servers/'
'srv-1'
)
)
attached_volumes = self.driver.ex_list_attached_volumes(node)
- self.assertEqual(len(attached_volumes), 3)
+ self.assertTrue(len(attached_volumes) > 0)
def test_attach_volume(self):
node = self.driver.ex_describe_node(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/srv-1'
)
)
volume = self.driver.ex_describe_volume(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'volumes/vol-2'
)
@@ -1102,11 +1003,11 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
attached.name,
- 'Updated storage name'
+ 'libcloud Test'
)
self.assertEqual(
attached.size,
- 40
+ 2
)
'''
@@ -1142,7 +1043,7 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'Updated storage name'
+ 'libcloud Test'
)
self.assertEqual(
extra['type'],
@@ -1150,7 +1051,7 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['size'],
- 40
+ 2
)
self.assertEqual(
extra['image'],
@@ -1171,7 +1072,7 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['licence_type'],
- 'LINUX'
+ 'UNKNOWN'
)
self.assertEqual(
extra['cpu_hot_plug'],
@@ -1217,7 +1118,7 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['device_number'],
- 3
+ 2
)
self.assertNotIn(
@@ -1229,14 +1130,14 @@ class ProfitBricksTests(unittest.TestCase):
node = self.driver.ex_describe_node(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/srv-1'
)
)
volume = self.driver.ex_describe_volume(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'volumes/vol-2'
)
@@ -1251,7 +1152,7 @@ class ProfitBricksTests(unittest.TestCase):
node = self.driver.ex_describe_node(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/srv-1'
)
@@ -1262,7 +1163,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_start_node(self):
node = self.driver.ex_describe_node(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/srv-1'
)
@@ -1273,7 +1174,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_describe_node(self):
node_w_href = self.driver.ex_describe_node(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/srv-1'
)
@@ -1285,6 +1186,15 @@ class ProfitBricksTests(unittest.TestCase):
self._verify_node(node=node_w_href)
self._verify_node(node=node_w_id)
+ def test_ex_describe_node_failure(self):
+ with self.assertRaises(BaseHTTPError) as cm:
+ self.driver.ex_describe_node(
+ ex_datacenter_id='dc-1',
+ ex_node_id='00000000'
+ )
+ self.assertIn('Resource does not exist', cm.exception.message.value)
+
+
def _verify_node(self, node):
extra = node.extra
@@ -1297,7 +1207,7 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
node.name,
- 'A test node'
+ 'libcloud Test'
)
self.assertEqual(
node.state,
@@ -1344,7 +1254,7 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['availability_zone'],
- 'AUTO'
+ 'ZONE_1'
)
self.assertEqual(
extra['boot_cdrom'],
@@ -1357,14 +1267,14 @@ class ProfitBricksTests(unittest.TestCase):
self.assertEqual(
extra['boot_volume']['href'],
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'volumes/bvol-1'
)
)
self.assertEqual(
extra['boot_volume']['properties']['name'],
- 'A test node boot volume'
+ 'libcloud Test'
)
self.assertEqual(
@@ -1373,7 +1283,7 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['boot_volume']['properties']['size'],
- 10
+ 2
)
self.assertEqual(
extra['boot_volume']['properties']['image'],
@@ -1400,101 +1310,23 @@ class ProfitBricksTests(unittest.TestCase):
node = self.driver.ex_describe_node(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/srv-1'
)
)
- zones = self.driver.ex_list_availability_zones()
updated = self.driver.ex_update_node(
node=node,
- name='Test update',
- cores=4,
- ram=4096,
- availability_zone=zones[0],
- ex_cpu_family='INTEL_XEON'
+ name='libcloud Test RENAME'
)
- extra = updated.extra
-
- '''
- Standard properties
- '''
self.assertEqual(
updated.id,
'srv-1'
)
self.assertEqual(
updated.name,
- 'A test node'
- )
- self.assertEqual(
- updated.state,
- NodeState.RUNNING
- )
- self.assertEqual(
- updated.public_ips,
- []
- )
- self.assertEqual(
- updated.private_ips,
- []
- )
-
- '''
- Extra metadata
- '''
- self.assertEqual(
- extra['created_date'],
- '2016-10-18T07:28:05Z'
- )
- self.assertEqual(
- extra['created_by'],
- 'test@test.test'
- )
- self.assertEqual(
- extra['etag'],
- 'e7cf186125f51f3d9511754a40dcd12c'
- )
- self.assertEqual(
- extra['last_modified_date'],
- '2016-10-18T07:28:05Z'
- )
- self.assertEqual(
- extra['last_modified_by'],
- 'test@test.test'
- )
- self.assertEqual(
- extra['state'],
- 'BUSY'
- )
-
- '''
- Extra properties
- '''
- self.assertEqual(
- extra['availability_zone'],
- 'AUTO'
- )
- self.assertEqual(
- extra['boot_cdrom'],
- None
- )
- self.assertEqual(
- extra['boot_volume']['id'],
- 'bvol-1'
- )
- self.assertEqual(
- extra['boot_volume']['href'],
- (
- '/cloudapi/v3/datacenters/'
- 'dc-1/'
- 'volumes/bvol-1'
- )
- )
- self.assertEqual(
- extra['cpu_family'],
- 'AMD_OPTERON'
+ 'libcloud Test RENAME'
)
'''
@@ -1505,30 +1337,47 @@ class ProfitBricksTests(unittest.TestCase):
datacenter = self.driver.ex_describe_datacenter(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1'
)
)
image = self.driver.ex_describe_image(
- ex_href='/cloudapi/v3/images/img-2'
+ ex_href='/cloudapi/v4/images/img-2'
)
created = self.driver.create_volume(
size=30,
name='Test volume',
ex_type='HDD',
- ex_bus_type='IDE',
ex_datacenter=datacenter,
image=image,
- ex_password='dummyP8ssw0rdl33t'
+ ex_ssh_keys=[NodeAuthSSHKey('ssh-rsa AAAAB3NzaC1')]
)
self.assertTrue(created)
+ def test_create_volume_failure(self):
+ datacenter = self.driver.ex_describe_datacenter(
+ ex_href=(
+ '/cloudapi/v4/datacenters/'
+ 'dc-1'
+ )
+ )
+ with self.assertRaises(ValueError):
+ 'Raises value error if no size'
+ self.driver.create_volume(
+ size=30,
+ name='libcloud Test',
+ ex_type='HDD',
+ ex_bus_type='IDE',
+ ex_datacenter=datacenter,
+ image=None
+ )
+
def test_destroy_volume(self):
volume = self.driver.ex_describe_volume(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/volumes/'
'vol-2'
)
@@ -1541,7 +1390,7 @@ class ProfitBricksTests(unittest.TestCase):
volume = self.driver.ex_describe_volume(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'volumes/vol-2'
)
@@ -1565,11 +1414,11 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
updated.name,
- 'Updated storage name'
+ 'libcloud Test - RENAME'
)
self.assertEqual(
updated.size,
- 40
+ 5
)
'''
@@ -1605,7 +1454,7 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'Updated storage name'
+ 'libcloud Test - RENAME'
)
self.assertEqual(
extra['type'],
@@ -1613,11 +1462,11 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['size'],
- 40
+ 5
)
self.assertEqual(
extra['availability_zone'],
- 'AUTO'
+ 'ZONE_3'
)
self.assertEqual(
extra['image'],
@@ -1638,7 +1487,7 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['licence_type'],
- 'LINUX'
+ 'UNKNOWN'
)
self.assertEqual(
extra['cpu_hot_plug'],
@@ -1692,7 +1541,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_describe_volume(self):
volume_w_href = self.driver.ex_describe_volume(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'volumes/vol-2'
)
@@ -1704,6 +1553,14 @@ class ProfitBricksTests(unittest.TestCase):
self._verify_volume(volume=volume_w_href)
self._verify_volume(volume=volume_w_id)
+ def test_ex_describe_volume_failure(self):
+ with self.assertRaises(BaseHTTPError) as cm:
+ self.driver.ex_describe_volume(
+ ex_datacenter_id='dc-1',
+ ex_volume_id='00000000'
+ )
+ self.assertIn('Resource does not exist', cm.exception.message.value)
+
def _verify_volume(self, volume):
extra = volume.extra
@@ -1716,11 +1573,11 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
volume.name,
- 'Updated storage name'
+ 'libcloud Test'
)
self.assertEqual(
volume.size,
- 40
+ 2
)
'''
@@ -1756,7 +1613,7 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'Updated storage name'
+ 'libcloud Test'
)
self.assertEqual(
extra['type'],
@@ -1764,11 +1621,11 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['size'],
- 40
+ 2
)
self.assertEqual(
extra['availability_zone'],
- 'AUTO'
+ 'ZONE_3'
)
self.assertEqual(
extra['image'],
@@ -1789,7 +1646,7 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['licence_type'],
- 'LINUX'
+ 'UNKNOWN'
)
self.assertEqual(
extra['cpu_hot_plug'],
@@ -1848,11 +1705,11 @@ class ProfitBricksTests(unittest.TestCase):
'''
def test_ex_create_datacenter(self):
- location = self.driver.ex_describe_location(ex_location_id='de/fkb')
+ location = self.driver.ex_describe_location(ex_location_id='us/las')
datacenter = self.driver.ex_create_datacenter(
- name='Test Data Center',
+ name='libcloud Test',
location=location,
- description='Test Data Center.'
+ description='libcloud test datacenter'
)
extra = datacenter.extra
@@ -1866,11 +1723,11 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
datacenter.href,
- '/cloudapi/v3/datacenters/dc-1'
+ '/cloudapi/v4/datacenters/dc-1'
)
self.assertEqual(
datacenter.name,
- 'Test Data Center'
+ 'libcloud Test'
)
self.assertEqual(
datacenter.version,
@@ -1910,11 +1767,11 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'Test Data Center'
+ 'libcloud Test'
)
self.assertEqual(
extra['description'],
- 'Test Data Center.'
+ 'libcloud test datacenter'
)
self.assertEqual(
extra['location'],
@@ -1941,11 +1798,20 @@ class ProfitBricksTests(unittest.TestCase):
NodeState.PENDING
)
+ def test_ex_create_datacenter_failure(self):
+ with self.assertRaises(AttributeError):
+ 'Raises attribute error if no location'
+ self.driver.ex_create_datacenter(
+ name='libcloud Test',
+ location=None,
+ description='libcloud test datacenter'
+ )
+
def test_ex_destroy_datacenter(self):
datacenter = self.driver.ex_describe_datacenter(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1'
)
)
@@ -1957,7 +1823,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_describe_datacenter(self):
datacenter_w_href = self.driver.ex_describe_datacenter(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1'
)
)
@@ -1967,6 +1833,11 @@ class ProfitBricksTests(unittest.TestCase):
self._verify_datacenter(datacenter=datacenter_w_href)
self._verify_datacenter(datacenter=datacenter_w_id)
+ def test_ex_describe_datacenter_failure(self):
+ with self.assertRaises(BaseHTTPError) as cm:
+ self.driver.ex_describe_datacenter(ex_datacenter_id='00000000')
+ self.assertIn('Resource does not exist', cm.exception.message.value)
+
def _verify_datacenter(self, datacenter):
extra = datacenter.extra
@@ -1979,11 +1850,11 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
datacenter.href,
- '/cloudapi/v3/datacenters/dc-1'
+ '/cloudapi/v4/datacenters/dc-1'
)
self.assertEqual(
datacenter.name,
- 'Test Data Center'
+ 'libcloud Test'
)
self.assertEqual(
datacenter.version,
@@ -2023,15 +1894,15 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'Test Data Center'
+ 'libcloud Test'
)
self.assertEqual(
extra['description'],
- 'This is a test data center.'
+ 'libcloud test datacenter'
)
self.assertEqual(
extra['location'],
- 'de/fkb'
+ 'us/las'
)
self.assertEqual(
extra['version'],
@@ -2059,13 +1930,13 @@ class ProfitBricksTests(unittest.TestCase):
datacenter = self.driver.ex_describe_datacenter(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1'
)
)
renamed = self.driver.ex_rename_datacenter(
datacenter=datacenter,
- name='Renamed data center'
+ name='libcloud Test - RENAME'
)
extra = renamed.extra
@@ -2078,11 +1949,11 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
renamed.href,
- '/cloudapi/v3/datacenters/dc-1'
+ '/cloudapi/v4/datacenters/dc-1'
)
self.assertEqual(
renamed.name,
- 'Test Data Center'
+ 'libcloud Test - RENAME'
)
self.assertEqual(
renamed.version,
@@ -2122,15 +1993,15 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'Test Data Center'
+ 'libcloud Test - RENAME'
)
self.assertEqual(
extra['description'],
- 'This is a test data center.'
+ 'libcloud test datacenter'
)
self.assertEqual(
extra['location'],
- 'de/fkb'
+ 'us/las'
)
self.assertEqual(
extra['version'],
@@ -2160,7 +2031,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_describe_image(self):
image_w_href = self.driver.ex_describe_image(
ex_href=(
- '/cloudapi/v3/images/'
+ '/cloudapi/v4/images/'
'img-2'
)
)
@@ -2170,6 +2041,11 @@ class ProfitBricksTests(unittest.TestCase):
self._verify_image(image=image_w_href)
self._verify_image(image=image_w_id)
+ def test_ex_describe_image_failure(self):
+ with self.assertRaises(BaseHTTPError) as cm:
+ self.driver.ex_describe_image(ex_image_id='00000000')
+ self.assertIn('Resource does not exist', cm.exception.message.value)
+
def _verify_image(self, image):
extra = image.extra
@@ -2226,7 +2102,7 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['location'],
- 'de/fkb'
+ 'us/las'
)
self.assertEqual(
extra['size'],
@@ -2289,13 +2165,18 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['href'],
- '/cloudapi/v3/images/img-2'
+ '/cloudapi/v4/images/img-2'
+ )
+
+ self.assertIsInstance(
+ extra['image_aliases'],
+ list
)
def test_ex_update_image(self):
image = self.driver.ex_describe_image(
ex_href=(
- '/cloudapi/v3/images/'
+ '/cloudapi/v4/images/'
'img-2'
)
)
@@ -2317,7 +2198,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_delete_image(self):
image = self.driver.ex_describe_image(
ex_href=(
- '/cloudapi/v3/images/'
+ '/cloudapi/v4/images/'
'img-2'
)
)
@@ -2331,10 +2212,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_list_network_interfaces(self):
network_interfaces = self.driver.ex_list_network_interfaces()
- self.assertEqual(
- len(network_interfaces),
- 4
- )
+ self.assertTrue(len(network_interfaces) > 0)
network_interface = network_interfaces[0]
extra = network_interface.extra
@@ -2348,12 +2226,12 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
network_interface.name,
- 'Test network interface'
+ 'libcloud Test'
)
self.assertEqual(
network_interface.href,
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/servers/'
's-3/nics/'
'nic-1'
@@ -2397,7 +2275,7 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'Test network interface'
+ 'libcloud Test'
)
self.assertEqual(
extra['mac'],
@@ -2427,7 +2305,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_describe_network_interface(self):
nic_w_href = self.driver.ex_describe_network_interface(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/s-3'
'/nics/nic-2'
@@ -2441,6 +2319,15 @@ class ProfitBricksTests(unittest.TestCase):
self._verify_network_interface(network_interface=nic_w_href)
self._verify_network_interface(network_interface=nic_w_id)
+ def test_ex_describe_network_interface_failure(self):
+ with self.assertRaises(BaseHTTPError) as cm:
+ self.driver.ex_describe_network_interface(
+ ex_datacenter_id='dc-1',
+ ex_server_id='s-3',
+ ex_nic_id='00000000'
+ )
+ self.assertIn('Resource does not exist', cm.exception.message.value)
+
def _verify_network_interface(self, network_interface):
extra = network_interface.extra
@@ -2453,12 +2340,12 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
network_interface.name,
- 'Updated from LibCloud'
+ 'libcloud Test'
)
self.assertEqual(
network_interface.href,
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/s-3/'
'nics/nic-2'
@@ -2502,7 +2389,7 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'Updated from LibCloud'
+ 'libcloud Test'
)
self.assertEqual(
extra['mac'],
@@ -2514,7 +2401,7 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['dhcp'],
- False
+ True
)
self.assertEqual(
extra['lan'],
@@ -2541,7 +2428,7 @@ class ProfitBricksTests(unittest.TestCase):
node = self.driver.ex_describe_node(
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/srv-1'
)
@@ -2550,7 +2437,7 @@ class ProfitBricksTests(unittest.TestCase):
node=node,
lan_id=1,
dhcp_active=True,
- nic_name='Creating a test network interface.'
+ nic_name='libcloud Test'
)
extra = network_interface.extra
@@ -2563,12 +2450,12 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
network_interface.name,
- 'Creating a test network interface.'
+ 'libcloud Test'
)
self.assertEqual(
network_interface.href,
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/srv-1'
'/nics/nic-2'
@@ -2612,7 +2499,7 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'Creating a test network interface.'
+ 'libcloud Test'
)
self.assertEqual(
extra['mac'],
@@ -2620,7 +2507,7 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['ips'],
- []
+ ['10.0.0.1']
)
self.assertEqual(
extra['dhcp'],
@@ -2639,11 +2526,20 @@ class ProfitBricksTests(unittest.TestCase):
None
)
+ def test_ex_create_network_interface_failure(self):
+ with self.assertRaises(AttributeError):
+ 'Raises attribute error if no node'
+ self.driver.ex_create_network_interface(
+ node=None,
+ lan_id=1,
+ nic_name='libcloud Test'
+ )
+
def test_ex_update_network_interface(self):
network_interface = self.driver.ex_describe_network_interface(
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/s-3'
'/nics/nic-2'
@@ -2651,7 +2547,7 @@ class ProfitBricksTests(unittest.TestCase):
)
updated = self.driver.ex_update_network_interface(
network_interface=network_interface,
- name='New network interface', dhcp_active=False
+ name='libcloud Test - RENAME'
)
extra = updated.extra
@@ -2665,89 +2561,31 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
updated.name,
- 'Updated from LibCloud'
+ 'libcloud Test - RENAME'
)
self.assertEqual(
updated.href,
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/s-3/'
'nics/nic-2'
)
)
- self.assertEqual(
- updated.state,
- NodeState.PENDING
- )
-
- '''
- Extra metadata
- '''
- self.assertEqual(
- extra['created_date'],
- '2016-10-19T08:18:55Z'
- )
- self.assertEqual(
- extra['created_by'],
- 'test@test.te'
- )
- self.assertEqual(
- extra['etag'],
- '56f8d8bbdc84faad4188f647a49a565b'
- )
- self.assertEqual(
- extra['last_modified_date'],
- '2016-10-19T09:44:59Z'
- )
- self.assertEqual(
- extra['last_modified_by'],
- 'test@test.te'
- )
- self.assertEqual(
- extra['state'],
- 'BUSY'
- )
'''
Extra properties
'''
self.assertEqual(
extra['name'],
- 'Updated from LibCloud'
- )
- self.assertEqual(
- extra['mac'],
- '02:01:68:c1:e8:88'
- )
- self.assertEqual(
- extra['ips'],
- ['11.12.13.14']
- )
- self.assertEqual(
- extra['dhcp'],
- True
- )
- self.assertEqual(
- extra['lan'],
- 1
- )
- self.assertEqual(
- extra['firewall_active'],
- False
- )
- self.assertEqual(
- extra['nat'],
- False
+ 'libcloud Test - RENAME'
)
- self.assertTrue(updated)
-
def test_ex_destroy_network_interface(self):
network_interface = self.driver.ex_describe_network_interface(
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/s-3'
'/nics/nic-2'
@@ -2762,7 +2600,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_set_inet_access(self):
network_interface = self.driver.ex_describe_network_interface(
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/s-3'
'/nics/nic-2'
@@ -2783,27 +2621,32 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_describe_location(self):
location_w_href = self.driver.ex_describe_location(
ex_href=(
- '/cloudapi/v3/locations/de/fkb'
+ '/cloudapi/v4/locations/us/las'
)
)
location_w_id = self.driver.ex_describe_location(
- ex_location_id='de/fkb'
+ ex_location_id='us/las'
)
self._verify_location(location=location_w_href)
self._verify_location(location=location_w_id)
+ def test_ex_describe_location_failure(self):
+ with self.assertRaises(BaseHTTPError) as cm:
+ self.driver.ex_describe_location(ex_location_id='us/000')
+ self.assertIn('Resource does not exist', cm.exception.message.value)
+
def _verify_location(self, location):
self.assertEqual(
location.id,
- 'de/fkb'
+ 'us/las'
)
self.assertEqual(
location.name,
- 'karlsruhe'
+ 'lasvegas'
)
self.assertEqual(
location.country,
- 'de'
+ 'us'
)
'''
@@ -2813,16 +2656,15 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_list_firewall_rules(self):
network_interface = self.driver.ex_describe_network_interface(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/s-3/'
'nics/nic-2'
)
)
firewall_rules = self.driver.ex_list_firewall_rules(network_interface)
- self.assertEqual(
- len(firewall_rules),
- 3
+ self.assertTrue(
+ len(firewall_rules) > 0
)
firewall_rule = firewall_rules[0]
@@ -2842,7 +2684,7 @@ class ProfitBricksTests(unittest.TestCase):
self.assertEqual(
firewall_rule.href,
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/s-3/'
'nics/nic-2/'
@@ -2926,7 +2768,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_describe_firewall_rule(self):
firewall_rule_w_href = self.driver.ex_describe_firewall_rule(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/servers/'
's-3/nics/'
'nic-2/firewallrules'
@@ -2942,6 +2784,16 @@ class ProfitBricksTests(unittest.TestCase):
self._verify_firewall_rule(firewall_rule=firewall_rule_w_href)
self._verify_firewall_rule(firewall_rule=firewall_rule_w_id)
+ def test_ex_describe_firewall_rule_failure(self):
+ with self.assertRaises(BaseHTTPError) as cm:
+ self.driver.ex_describe_firewall_rule(
+ ex_datacenter_id='dc-1',
+ ex_server_id='s-3',
+ ex_nic_id='nic-2',
+ ex_firewall_rule_id='00'
+ )
+ self.assertIn('Resource does not exist', cm.exception.message.value)
+
def _verify_firewall_rule(self, firewall_rule):
extra = firewall_rule.extra
@@ -2954,12 +2806,12 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
firewall_rule.name,
- 'HTTPs (SSL)'
+ 'SSH'
)
self.assertEqual(
firewall_rule.href,
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/servers/'
's-3/nics/'
'nic-2/'
@@ -3004,7 +2856,7 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'HTTPs (SSL)'
+ 'SSH'
)
self.assertEqual(
extra['protocol'],
@@ -3012,7 +2864,7 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['source_mac'],
- None
+ '01:23:45:67:89:00'
)
self.assertEqual(
extra['source_ip'],
@@ -3033,18 +2885,18 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['port_range_start'],
- 443
+ 22
)
self.assertEqual(
extra['port_range_end'],
- 443
+ 22
)
def test_ex_create_firewall_rule(self):
network_interface = self.driver.ex_describe_network_interface(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/s-3/'
'nics/nic-2'
@@ -3054,9 +2906,9 @@ class ProfitBricksTests(unittest.TestCase):
firewall_rule = self.driver.ex_create_firewall_rule(
network_interface=network_interface,
protocol='TCP',
- name='Test created firewall rule',
- port_range_start=80,
- port_range_end=80
+ name='SSH',
+ port_range_start=22,
+ port_range_end=22
)
extra = firewall_rule.extra
@@ -3070,135 +2922,20 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
firewall_rule.name,
- 'Test created firewall rule'
- )
- self.assertEqual(
- firewall_rule.href,
- (
- '/cloudapi/v3/datacenters/'
- 'dc-1/'
- 'servers/s-3/'
- 'nics/nic-2/'
- 'firewallrules/fwr-1'
- )
- )
- self.assertEqual(
- firewall_rule.state,
- NodeState.PENDING
- )
-
- '''
- Extra metadata
- '''
- self.assertEqual(
- extra['created_date'],
- '2016-10-19T11:08:04Z'
- )
- self.assertEqual(
- extra['created_by'],
- 'test@test.te'
- )
- self.assertEqual(
- extra['etag'],
- '2a21551ba4adf85d9fb04b05a6938bcc'
- )
- self.assertEqual(
- extra['last_modified_date'],
- '2016-10-19T11:08:04Z'
- )
- self.assertEqual(
- extra['last_modified_by'],
- 'test@test.te'
- )
- self.assertEqual(
- extra['state'],
- 'BUSY'
+ 'SSH'
)
-
- '''
- Extra properties
- '''
self.assertEqual(
- extra['name'],
- 'Test created firewall rule'
- )
- self.assertEqual(
- extra['protocol'],
- 'TCP'
- )
- self.assertEqual(
- extra['source_mac'],
- None
- )
- self.assertEqual(
- extra['source_ip'],
- None
- )
- self.assertEqual(
- extra['target_ip'],
- None
- )
-
- self.assertEqual(
- extra['icmp_code'],
- None
- )
- self.assertEqual(
- extra['icmp_type'],
- None
- )
- self.assertEqual(
- extra['port_range_start'],
- 80
- )
- self.assertEqual(
- extra['port_range_end'],
- 80
- )
-
- def test_ex_update_firewall_rule(self):
-
- firewall_rule = self.driver.ex_describe_firewall_rule(
- ex_href=(
- '/cloudapi/v3/datacenters/'
- 'dc-1/'
- 'servers/s-3/'
- 'nics/nic-2/'
- 'firewallrules/fw2'
- )
- )
- updated = self.driver.ex_update_firewall_rule(
- firewall_rule=firewall_rule,
- name='Test updated firewall rule',
- port_range_start=8080,
- port_range_end=8080
- )
-
- extra = updated.extra
-
- '''
- Standard properties
- '''
- self.assertEqual(
- updated.id,
- 'fw2'
- )
- self.assertEqual(
- updated.name,
- 'HTTPs (SSL)'
- )
- self.assertEqual(
- updated.href,
+ firewall_rule.href,
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
- 'servers/s-3'
- '/nics/nic-2/'
- 'firewallrules/fw2'
+ 'servers/s-3/'
+ 'nics/nic-2/'
+ 'firewallrules/fwr-1'
)
)
self.assertEqual(
- updated.state,
+ firewall_rule.state,
NodeState.PENDING
)
@@ -3207,7 +2944,7 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['created_date'],
- '2016-10-19T09:55:10Z'
+ '2016-10-19T11:08:04Z'
)
self.assertEqual(
extra['created_by'],
@@ -3215,11 +2952,11 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['etag'],
- '00bb5b86562db1ed19ca38697e485160'
+ '2a21551ba4adf85d9fb04b05a6938bcc'
)
self.assertEqual(
extra['last_modified_date'],
- '2016-10-19T09:55:10Z'
+ '2016-10-19T11:08:04Z'
)
self.assertEqual(
extra['last_modified_by'],
@@ -3235,7 +2972,7 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'HTTPs (SSL)'
+ 'SSH'
)
self.assertEqual(
extra['protocol'],
@@ -3243,7 +2980,7 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['source_mac'],
- None
+ '01:23:45:67:89:00'
)
self.assertEqual(
extra['source_ip'],
@@ -3264,18 +3001,62 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
extra['port_range_start'],
- 443
+ 22
)
self.assertEqual(
extra['port_range_end'],
- 443
+ 22
+ )
+
+ def test_ex_create_network_interface_failure(self):
+ with self.assertRaises(AttributeError):
+ 'Raises attribute error if no network interface'
+ self.driver.ex_create_firewall_rule(
+ network_interface=None,
+ protocol='TCP',
+ name='SSH'
+ )
+
+ def test_ex_update_firewall_rule(self):
+
+ firewall_rule = self.driver.ex_describe_firewall_rule(
+ ex_href=(
+ '/cloudapi/v4/datacenters/'
+ 'dc-1/'
+ 'servers/s-3/'
+ 'nics/nic-2/'
+ 'firewallrules/fw2'
+ )
+ )
+ updated = self.driver.ex_update_firewall_rule(
+ firewall_rule=firewall_rule,
+ name='SSH - RENAME'
+ )
+
+ extra = updated.extra
+
+ '''
+ Standard properties
+ '''
+ self.assertEqual(
+ updated.id,
+ 'fw2'
+ )
+ self.assertEqual(
+ updated.name,
+ 'SSH - RENAME'
+ )
+
+ self.assertEqual(
+ extra['name'],
+ 'SSH - RENAME'
)
def test_ex_delete_firewall_rule(self):
firewall_rule = self.driver.ex_describe_firewall_rule(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/s-3/'
'nics/nic-2/'
@@ -3293,7 +3074,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_list_lans(self):
datacenter = self.driver.ex_describe_datacenter(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1'
)
)
@@ -3317,13 +3098,13 @@ class ProfitBricksTests(unittest.TestCase):
self.assertEqual(
lan.href,
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/lans/1'
)
)
self.assertEqual(
lan.name,
- 'Switch for LAN 1'
+ 'libcloud Test'
)
self.assertEqual(
lan.is_public,
@@ -3363,7 +3144,7 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'Switch for LAN 1'
+ 'libcloud Test'
)
self.assertEqual(
extra['is_public'],
@@ -3381,7 +3162,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_create_lan(self):
datacenter = self.driver.ex_describe_datacenter(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1'
)
)
@@ -3401,13 +3182,13 @@ class ProfitBricksTests(unittest.TestCase):
self.assertEqual(
lan.href,
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/lans/10'
)
)
self.assertEqual(
lan.name,
- 'Test Created Lan'
+ 'libcloud Test'
)
self.assertEqual(
lan.is_public,
@@ -3451,17 +3232,24 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'Test Created Lan'
+ 'libcloud Test'
)
self.assertEqual(
extra['is_public'],
True
)
+ def test_ex_create_lan_failure(self):
+ with self.assertRaises(AttributeError):
+ 'Raises attribute error if no datacenter'
+ self.driver.ex_create_lan(
+ datacenter=None
+ )
+
def test_ex_describe_lan(self):
lan_w_href = self.driver.ex_describe_lan(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/lans/10'
)
)
@@ -3472,6 +3260,14 @@ class ProfitBricksTests(unittest.TestCase):
self._verify_lan(lan=lan_w_href)
self._verify_lan(lan=lan_w_id)
+ def test_ex_describe_lan_failure(self):
+ with self.assertRaises(BaseHTTPError) as cm:
+ self.driver.ex_describe_lan(
+ ex_datacenter_id='dc-1',
+ ex_lan_id='0'
+ )
+ self.assertIn('Resource does not exist', cm.exception.message.value)
+
def _verify_lan(self, lan):
extra = lan.extra
@@ -3485,13 +3281,13 @@ class ProfitBricksTests(unittest.TestCase):
self.assertEqual(
lan.href,
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/lans/10'
)
)
self.assertEqual(
lan.name,
- 'Test Created Lan'
+ 'libcloud Test'
)
self.assertEqual(
lan.is_public,
@@ -3535,7 +3331,7 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'Test Created Lan'
+ 'libcloud Test'
)
self.assertEqual(
extra['is_public'],
@@ -3545,14 +3341,14 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_update_lan(self):
lan = self.driver.ex_describe_lan(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/lans/10'
)
)
updated = self.driver.ex_update_lan(
lan=lan,
- is_public=True,
- name='Updated Lan'
+ is_public=False,
+ name='libcloud Test - RENAME'
)
extra = updated.extra
@@ -3566,17 +3362,17 @@ class ProfitBricksTests(unittest.TestCase):
self.assertEqual(
updated.href,
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/lans/10'
)
)
self.assertEqual(
updated.name,
- 'Test Updated Lan'
+ 'libcloud Test - RENAME'
)
self.assertEqual(
updated.is_public,
- True
+ False
)
self.assertEqual(
updated.state,
@@ -3616,17 +3412,17 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'Test Updated Lan'
+ 'libcloud Test - RENAME'
)
self.assertEqual(
extra['is_public'],
- True
+ False
)
def test_ex_delete_lan(self):
lan = self.driver.ex_describe_lan(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/lans/10'
)
)
@@ -3639,85 +3435,14 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_list_load_balancers(self):
load_balancers = self.driver.ex_list_load_balancers()
- self.assertEqual(
- len(load_balancers),
- 2
- )
-
- balancer = load_balancers[0]
-
- '''
- Standard properties
- '''
- self.assertEqual(
- balancer.id,
- 'bal-1'
- )
- self.assertEqual(
- balancer.href,
- (
- '/cloudapi/v3/datacenters/'
- 'dc-2/'
- 'loadbalancers/bal-1'
- )
- )
- self.assertEqual(
- balancer.name,
- 'Test One'
- )
- self.assertEqual(
- balancer.state,
- NodeState.RUNNING
- )
-
- '''
- Extra metadata
- '''
- self.assertEqual(
- balancer.extra['created_date'],
- '2016-10-26T13:02:33Z'
- )
- self.assertEqual(
- balancer.extra['created_by'],
- 'test@test.te'
- )
- self.assertEqual(
- balancer.extra['etag'],
- '71e8df57a58615b9e15400ede4138b41'
- )
- self.assertEqual(
- balancer.extra['last_modified_date'],
- '2016-10-26T13:02:33Z'
- )
- self.assertEqual(
- balancer.extra['last_modified_by'],
- 'test@test.te'
- )
- self.assertEqual(
- balancer.extra['state'],
- 'AVAILABLE'
- )
-
- '''
- Extra properties
- '''
- self.assertEqual(
- balancer.extra['name'],
- 'Test One'
- )
- self.assertEqual(
- balancer.extra['ip'],
- '111.112.113.114'
- )
- self.assertEqual(
- balancer.extra['dhcp'],
- True
+ self.assertTrue(
+ len(load_balancers) > 0
)
def test_ex_describe_load_balancer(self):
load_balancer_w_href = self.driver.ex_describe_load_balancer(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-2/'
'loadbalancers/bal-1'
)
@@ -3730,6 +3455,14 @@ class ProfitBricksTests(unittest.TestCase):
self._verify_load_balancer(load_balancer=load_balancer_w_href)
self._verify_load_balancer(load_balancer=load_balancer_w_id)
+ def test_ex_describe_load_balancer_failure(self):
+ with self.assertRaises(BaseHTTPError) as cm:
+ self.driver.ex_describe_load_balancer(
+ ex_datacenter_id='dc-2',
+ ex_load_balancer_id='00000000'
+ )
+ self.assertIn('Resource does not exist', cm.exception.message.value)
+
def _verify_load_balancer(self, load_balancer):
'''
Standard properties
@@ -3741,14 +3474,14 @@ class ProfitBricksTests(unittest.TestCase):
self.assertEqual(
load_balancer.href,
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-2/'
'loadbalancers/bal-1'
)
)
self.assertEqual(
load_balancer.name,
- 'Test One'
+ 'libcloud Test'
)
self.assertEqual(
load_balancer.state,
@@ -3788,11 +3521,10 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
load_balancer.extra['name'],
- 'Test One'
+ 'libcloud Test'
)
- self.assertEqual(
- load_balancer.extra['ip'],
- '111.112.113.114'
+ self.assertIsNotNone(
+ load_balancer.extra['ip']
)
self.assertEqual(
load_balancer.extra['dhcp'],
@@ -3802,16 +3534,18 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_create_load_balancer(self):
datacenter = self.driver.ex_describe_datacenter(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1'
)
)
+ nics = self.driver.ex_list_network_interfaces()
+
created = self.driver.ex_create_load_balancer(
datacenter=datacenter,
- name='Test load balancer',
- ip='10.11.12.13',
- dhcp=True
+ name='libcloud Test',
+ dhcp=True,
+ nics=[nics[0]]
)
'''
@@ -3824,14 +3558,14 @@ class ProfitBricksTests(unittest.TestCase):
self.assertEqual(
created.href,
(
- '/cloudapi/v3/datacenters'
+ '/cloudapi/v4/datacenters'
'/dc-1'
'/loadbalancers/bal-1'
)
)
self.assertEqual(
created.name,
- 'Test load balancer'
+ 'libcloud Test'
)
self.assertEqual(
created.state,
@@ -3871,7 +3605,7 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
created.extra['name'],
- 'Test load balancer'
+ 'libcloud Test'
)
self.assertEqual(
created.extra['ip'],
@@ -3881,11 +3615,22 @@ class ProfitBricksTests(unittest.TestCase):
created.extra['dhcp'],
True
)
+ self.assertIsNotNone(
+ created.extra['entities']['balancednics']
+ )
+
+ def test_ex_create_load_balancer_failure(self):
+ with self.assertRaises(AttributeError):
+ 'Raises attribute error if no datacenter'
+ self.driver.ex_create_load_balancer(
+ datacenter=None,
+ name='libcloud Test'
+ )
def test_ex_update_load_balancer(self):
load_balancer = self.driver.ex_describe_load_balancer(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-2/'
'loadbalancers/bal-1'
)
@@ -3893,28 +3638,18 @@ class ProfitBricksTests(unittest.TestCase):
updated = self.driver.ex_update_load_balancer(
load_balancer=load_balancer,
- name='Updated Load Balancer',
- ip='123.124.125.126',
- dhcp=False
+ name='libcloud Test - RENAME'
)
self.assertEqual(
updated.name,
- 'Updated Load Balancer'
- )
- self.assertEqual(
- updated.extra['ip'],
- '123.124.125.126'
- )
- self.assertEqual(
- updated.extra['dhcp'],
- False
+ 'libcloud Test - RENAME'
)
def test_ex_list_load_balanced_nics(self):
load_balancer = self.driver.ex_describe_load_balancer(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-2/'
'loadbalancers/bal-1'
)
@@ -3923,6 +3658,11 @@ class ProfitBricksTests(unittest.TestCase):
network_interfaces = self.driver.ex_list_load_balanced_nics(
load_balancer
)
+
+ self.assertTrue(
+ len(network_interfaces) > 0
+ )
+
network_interface = network_interfaces[0]
extra = network_interface.extra
@@ -3935,12 +3675,12 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
network_interface.name,
- 'Test network interface'
+ 'libcloud Test'
)
self.assertEqual(
network_interface.href,
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/s-3/'
'nics/nic-1'
@@ -3984,7 +3724,7 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'Test network interface'
+ 'libcloud Test'
)
self.assertEqual(
extra['mac'],
@@ -4014,7 +3754,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_describe_load_balanced_nic(self):
network_interface_w_href = self.driver.ex_describe_network_interface(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/s-3/'
'nics/nic-2'
@@ -4044,12 +3784,12 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
network_interface.name,
- 'Updated from LibCloud'
+ 'libcloud Test'
)
self.assertEqual(
network_interface.href,
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/s-3'
'/nics/nic-2'
@@ -4093,23 +3833,23 @@ class ProfitBricksTests(unittest.TestCase):
'''
self.assertEqual(
extra['name'],
- 'Updated from LibCloud'
+ 'libcloud Test'
)
- self.assertEqual(
+ assertRegex(
+ self,
extra['mac'],
- '02:01:0b:9d:4d:ce'
+ '^([0-9a-f]{2}[:]){5}([0-9a-f]{2})$'
)
- self.assertEqual(
- extra['ips'],
- ['10.15.124.11']
+ self.assertTrue(
+ len(extra['ips']) > 0
)
self.assertEqual(
extra['dhcp'],
- False
+ True
)
- self.assertEqual(
+ self.assertIsInstance(
extra['lan'],
- 2
+ int
)
self.assertEqual(
extra['firewall_active'],
@@ -4123,7 +3863,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_attach_nic_to_load_balancer(self):
network_interface = self.driver.ex_describe_network_interface(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/s-3'
'/nics/nic-2'
@@ -4131,7 +3871,7 @@ class ProfitBricksTests(unittest.TestCase):
)
load_balancer = self.driver.ex_describe_load_balancer(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-2/'
'loadbalancers/bal-1'
)
@@ -4146,7 +3886,7 @@ class ProfitBricksTests(unittest.TestCase):
network_interface = self.driver.ex_describe_network_interface(
ex_href=(
(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-1/'
'servers/s-3/'
'nics/nic-2'
@@ -4155,7 +3895,7 @@ class ProfitBricksTests(unittest.TestCase):
)
load_balancer = self.driver.ex_describe_load_balancer(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-2/'
'loadbalancers/bal-1'
)
@@ -4169,7 +3909,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_delete_load_balancer(self):
load_balancer = self.driver.ex_describe_load_balancer(
ex_href=(
- '/cloudapi/v3/datacenters/'
+ '/cloudapi/v4/datacenters/'
'dc-2/'
'loadbalancers/bal-1'
)
@@ -4183,80 +3923,16 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_list_ip_blocks(self):
ip_blocks = self.driver.ex_list_ip_blocks()
- self.assertEqual(
- len(ip_blocks),
- 2
- )
-
- ip_block = ip_blocks[0]
- extra = ip_block.extra
-
- '''
- Standard properties
- '''
- self.assertEqual(
- ip_block.id,
- 'ipb-1'
- )
- self.assertEqual(
- ip_block.name,
- 'Test IP Block One'
- )
- self.assertEqual(
- ip_block.href,
- '/cloudapi/v3/ipblocks/ipb-1'
- )
- self.assertEqual(
- ip_block.location,
- 'de/fkb'
- )
- self.assertEqual(
- ip_block.size,
- 2
- )
- self.assertEqual(
- ip_block.ips,
- ['78.137.101.252', '78.137.101.251']
- )
- self.assertEqual(
- ip_block.state,
- NodeState.RUNNING
- )
-
- '''
- Extra metadata
- '''
- self.assertEqual(
- extra['created_date'],
- '2016-10-26T15:05:36Z'
- )
- self.assertEqual(
- extra['created_by'],
- 'test@test.te'
- )
- self.assertEqual(
- extra['etag'],
- 'acbf00bacf7ee48d4b8bc4e7413e1f30'
- )
- self.assertEqual(
- extra['last_modified_date'],
- '2016-10-26T15:05:36Z'
- )
- self.assertEqual(
- extra['last_modified_by'],
- 'test@test.te'
- )
- self.assertEqual(
- extra['state'],
- 'AVAILABLE'
+ self.assertTrue(
+ len(ip_blocks) > 0
)
def test_ex_create_ip_block(self):
- location = self.driver.ex_describe_location(ex_location_id='de/fkb')
+ location = self.driver.ex_describe_location(ex_location_id='us/las')
created = self.driver.ex_create_ip_block(
location=location,
size=2,
- name='Test Created IP Block'
+ name='libcloud Test'
)
extra = created.extra
@@ -4269,23 +3945,23 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
created.name,
- 'Test Created IP Block'
+ 'libcloud Test'
)
self.assertEqual(
created.href,
- '/cloudapi/v3/ipblocks/ipb-1'
+ '/cloudapi/v4/ipblocks/ipb-1'
)
self.assertEqual(
created.location,
- 'de/fkb'
+ 'us/las'
)
self.assertEqual(
created.size,
2
)
self.assertEqual(
- created.ips,
- ['11.12.13.14', '15.16.17.18']
+ len(created.ips),
+ 2
)
self.assertEqual(
created.state,
@@ -4320,10 +3996,19 @@ class ProfitBricksTests(unittest.TestCase):
'BUSY'
)
+ def test_ex_create_ip_block_failure(self):
+ with self.assertRaises(AttributeError):
+ 'Raises attribute error if no location'
+ self.driver.ex_create_ip_block(
+ location=None,
+ size=2,
+ name='libcloud Test'
+ )
+
def test_ex_describe_ip_block(self):
ip_block_w_href = self.driver.ex_describe_ip_block(
ex_href=(
- '/cloudapi/v3/ipblocks/'
+ '/cloudapi/v4/ipblocks/'
'ipb-2'
)
)
@@ -4333,6 +4018,13 @@ class ProfitBricksTests(unittest.TestCase):
self._verify_ip_block(ip_block=ip_block_w_href)
self._verify_ip_block(ip_block=ip_block_w_id)
+ def test_ex_describe_ip_block_failure(self):
+ with self.assertRaises(BaseHTTPError) as cm:
+ self.driver.ex_describe_ip_block(
+ ex_ip_block_id='00000000'
+ )
+ self.assertIn('Resource does not exist', cm.exception.message.value)
+
def _verify_ip_block(self, ip_block):
extra = ip_block.extra
@@ -4345,25 +4037,25 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertEqual(
ip_block.name,
- 'Test IP Block One'
+ 'libcloud Test'
)
self.assertEqual(
ip_block.href,
(
- '/cloudapi/v3/ipblocks/ipb-2'
+ '/cloudapi/v4/ipblocks/ipb-2'
)
)
self.assertEqual(
ip_block.location,
- 'de/fkb'
+ 'us/las'
)
self.assertEqual(
ip_block.size,
- 1
+ 2
)
self.assertEqual(
- ip_block.ips,
- ['78.137.101.250']
+ len(ip_block.ips),
+ 2
)
self.assertEqual(
ip_block.state,
@@ -4401,7 +4093,7 @@ class ProfitBricksTests(unittest.TestCase):
def test_ex_delete_ip_block(self):
ip_block = self.driver.ex_describe_ip_block(
ex_href=(
- '/cloudapi/v3/ipblocks/'
+ '/cloudapi/v4/ipblocks/'
'ipb-2'
)
)
@@ -4418,7 +4110,7 @@ class ProfitBricksMockHttp(MockHttp):
GET - fetches images
'''
- def _cloudapi_v3_images(
+ def _cloudapi_v4_images(
self, method, url, body, headers
):
body = self.fixtures.load('list_images.json')
@@ -4434,7 +4126,7 @@ class ProfitBricksMockHttp(MockHttp):
GET - fetches locations
'''
- def _cloudapi_v3_locations(
+ def _cloudapi_v4_locations(
self, method, url, body, headers
):
body = self.fixtures.load('list_locations.json')
@@ -4451,7 +4143,7 @@ class ProfitBricksMockHttp(MockHttp):
GET - fetches data centers
PATCH - creates a data center
'''
- def _cloudapi_v3_datacenters(
+ def _cloudapi_v4_datacenters(
self, method, url, body, headers
):
if method == 'GET':
@@ -4479,7 +4171,7 @@ class ProfitBricksMockHttp(MockHttp):
DELETE - destroys a data center
PATCH - updates a data center
'''
- def _cloudapi_v3_datacenters_dc_1(
+ def _cloudapi_v4_datacenters_dc_1(
self, method, url, body, headers
):
if method == 'GET':
@@ -4508,13 +4200,18 @@ class ProfitBricksMockHttp(MockHttp):
httplib.responses[httplib.ACCEPTED]
)
+ def _cloudapi_v4_datacenters_00000000(
+ self, method, url, body, headers
+ ):
+ return self._get_not_found()
+
'''
Operations on data center nodes (servers)
GET - fetches a list of nodes (servers) for a data center
POST - creates a node (server) for a data center
'''
- def _cloudapi_v3_datacenters_dc_1_servers(
+ def _cloudapi_v4_datacenters_dc_1_servers(
self, method, url, body, headers
):
if method == 'GET':
@@ -4541,7 +4238,7 @@ class ProfitBricksMockHttp(MockHttp):
GET - fetches a list of volumes for a data center
POST - creates a volume for a data center
'''
- def _cloudapi_v3_datacenters_dc_1_volumes(
+ def _cloudapi_v4_datacenters_dc_1_volumes(
self, method, url, body, headers
):
if method == 'GET':
@@ -4569,7 +4266,7 @@ class ProfitBricksMockHttp(MockHttp):
DELETE - destroys a node (server)
PATCH - updates a node
'''
- def _cloudapi_v3_datacenters_dc_1_servers_srv_1(
+ def _cloudapi_v4_datacenters_dc_1_servers_srv_1(
self, method, url, body, headers
):
if method == 'GET':
@@ -4597,13 +4294,19 @@ class ProfitBricksMockHttp(MockHttp):
{},
httplib.responses[httplib.ACCEPTED]
)
+
+ def _cloudapi_v4_datacenters_dc_1_servers_00000000(
+ self, method, url, body, headers
+ ):
+ return self._get_not_found()
+
'''
Operations on a node (server)
POST - reboots, then starts and stops a node
'''
'reboot a node'
- def _cloudapi_v3_datacenters_dc_1_servers_srv_1_reboot(
+ def _cloudapi_v4_datacenters_dc_1_servers_srv_1_reboot(
self, method, url, body, headers
):
return (
@@ -4613,7 +4316,7 @@ class ProfitBricksMockHttp(MockHttp):
httplib.responses[httplib.ACCEPTED]
)
'start a node'
- def _cloudapi_v3_datacenters_dc_1_servers_srv_1_stop(
+ def _cloudapi_v4_datacenters_dc_1_servers_srv_1_stop(
self, method, url, body, headers
):
return (
@@ -4624,7 +4327,7 @@ class ProfitBricksMockHttp(MockHttp):
)
'stop a node'
- def _cloudapi_v3_datacenters_dc_1_servers_srv_1_start(
+ def _cloudapi_v4_datacenters_dc_1_servers_srv_1_start(
self, method, url, body, headers
):
return (
@@ -4641,7 +4344,7 @@ class ProfitBricksMockHttp(MockHttp):
DELETE - deletes an image
PATCH - updates an image
"""
- def _cloudapi_v3_images_img_2(
+ def _cloudapi_v4_images_img_2(
self, method, url, body, headers
):
if method == 'GET':
@@ -4670,6 +4373,11 @@ class ProfitBricksMockHttp(MockHttp):
httplib.responses[httplib.ACCEPTED]
)
+ def _cloudapi_v4_images_00000000(
+ self, method, url, body, headers
+ ):
+ return self._get_not_found()
+
'''
Operations on a volume
@@ -4677,7 +4385,7 @@ class ProfitBricksMockHttp(MockHttp):
DELETE - destroys a volume
PATCH - updates a volume
'''
- def _cloudapi_v3_datacenters_dc_1_volumes_vol_2(
+ def _cloudapi_v4_datacenters_dc_1_volumes_vol_2(
self, method, url, body, headers
):
if method == 'GET':
@@ -4705,13 +4413,18 @@ class ProfitBricksMockHttp(MockHttp):
httplib.responses[httplib.ACCEPTED]
)
+ def _cloudapi_v4_datacenters_dc_1_volumes_00000000(
+ self, method, url, body, headers
+ ):
+ return self._get_not_found()
+
'''
Operations on a volume connected to a node (server)
DELETE - destroys the link between a volume
and a server but does delete the volume.
'''
- def _cloudapi_v3_datacenters_dc_1_servers_srv_1_volumes_vol_2(
+ def _cloudapi_v4_datacenters_dc_1_servers_srv_1_volumes_vol_2(
self, method, url, body, headers
):
return (
@@ -4726,7 +4439,7 @@ class ProfitBricksMockHttp(MockHttp):
GET - fetches a location
'''
- def _cloudapi_v3_locations_de_fkb(
+ def _cloudapi_v4_locations_us_las(
self, method, url, body, headers
):
body = self.fixtures.load('ex_describe_location.json')
@@ -4737,13 +4450,18 @@ class ProfitBricksMockHttp(MockHttp):
httplib.responses[httplib.OK]
)
+ def _cloudapi_v4_locations_us_000(
+ self, method, url, body, headers
+ ):
+ return self._get_not_found()
+
'''
Operations on volumes connected to nodes (servers)
GET - fetch volumes connected to a server
POST - attach a volume to a node (server)
'''
- def _cloudapi_v3_datacenters_dc_1_servers_srv_1_volumes(
+ def _cloudapi_v4_datacenters_dc_1_servers_srv_1_volumes(
self, method, url, body, headers
):
if(method == 'GET'):
@@ -4770,7 +4488,7 @@ class ProfitBricksMockHttp(MockHttp):
GET - fetch network interfaces for a node (server)
POST - create a network interface for a node (server)
'''
- def _cloudapi_v3_datacenters_dc_1_servers_srv_1_nics(
+ def _cloudapi_v4_datacenters_dc_1_servers_srv_1_nics(
self, method, url, body, headers
):
if method == 'GET':
@@ -4798,7 +4516,7 @@ class ProfitBricksMockHttp(MockHttp):
DELETE - destroy a network interface
PATCH - update a network interface
'''
- def _cloudapi_v3_datacenters_dc_1_servers_s_3_nics_nic_2(
+ def _cloudapi_v4_datacenters_dc_1_servers_s_3_nics_nic_2(
self, method, url, body, headers
):
if method == 'GET':
@@ -4819,7 +4537,7 @@ class ProfitBricksMockHttp(MockHttp):
)
elif method == 'PATCH':
- body = self.fixtures.load('ex_set_inet_access.json')
+ body = self.fixtures.load('ex_update_network_interface.json')
return (
httplib.ACCEPTED,
body,
@@ -4827,6 +4545,11 @@ class ProfitBricksMockHttp(MockHttp):
httplib.responses[httplib.ACCEPTED]
)
+ def _cloudapi_v4_datacenters_dc_1_servers_s_3_ni
<TRUNCATED>
[06/10] libcloud git commit: fix urlencode for Python 3 & retain back
compatibility for Node and Volume create
Posted by to...@apache.org.
fix urlencode for Python 3 & retain back compatibility for Node and Volume create
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/5d76cf6d
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/5d76cf6d
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/5d76cf6d
Branch: refs/heads/trunk
Commit: 5d76cf6dfa015c27d3dfb69620a36f90d7797c8f
Parents: 85de9c1
Author: nurfet-becirevic <nu...@stackpointcloud.com>
Authored: Mon Sep 11 12:49:44 2017 +0200
Committer: nurfet-becirevic <nu...@stackpointcloud.com>
Committed: Mon Sep 11 12:49:44 2017 +0200
----------------------------------------------------------------------
libcloud/compute/drivers/profitbricks.py | 41 ++++++++++++++++++---------
1 file changed, 28 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/5d76cf6d/libcloud/compute/drivers/profitbricks.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/profitbricks.py b/libcloud/compute/drivers/profitbricks.py
index b310f09..9477a09 100644
--- a/libcloud/compute/drivers/profitbricks.py
+++ b/libcloud/compute/drivers/profitbricks.py
@@ -19,13 +19,14 @@ import base64
import json
import copy
import time
-import urllib
from libcloud.utils.py3 import b
+from libcloud.utils.py3 import urlencode
from libcloud.compute.providers import Provider
from libcloud.common.base import ConnectionUserAndKey, JsonResponse
from libcloud.compute.base import Node, NodeDriver, NodeLocation, NodeSize
from libcloud.compute.base import NodeImage, StorageVolume, VolumeSnapshot
+from libcloud.compute.base import NodeAuthPassword, NodeAuthSSHKey
from libcloud.compute.base import UuidMixin
from libcloud.compute.types import NodeState
from libcloud.common.types import LibcloudError, MalformedResponseError
@@ -695,10 +696,11 @@ class ProfitBricksNodeDriver(NodeDriver):
:type ex_disk: ``int``
:param ex_password: The password for the volume.
- :type ex_password: :class:`NodeAuthPassword`
+ :type ex_password: :class:`NodeAuthPassword` or ``str``
:param ex_ssh_keys: Optional SSH keys for the volume.
- :type ex_ssh_keys: ``list`` of :class:`NodeAuthSSHKey`
+ :type ex_ssh_keys: ``list`` of :class:`NodeAuthSSHKey` or
+ ``list`` of ``str``
:param ex_bus_type: Volume bus type (VIRTIO, IDE).
:type ex_bus_type: ``str``
@@ -832,12 +834,18 @@ class ProfitBricksNodeDriver(NodeDriver):
}
if ex_password is not None:
- new_volume['properties']['imagePassword'] = \
- ex_password.password
+ if isinstance(ex_password, NodeAuthPassword):
+ new_volume['properties']['imagePassword'] = \
+ ex_password.password
+ else:
+ new_volume['properties']['imagePassword'] = ex_password
if ex_ssh_keys is not None:
- new_volume['properties']['sshKeys'] = \
- [ssh_key.pubkey for ssh_key in ex_ssh_keys]
+ if isinstance(ex_ssh_keys[0], NodeAuthSSHKey):
+ new_volume['properties']['sshKeys'] = \
+ [ssh_key.pubkey for ssh_key in ex_ssh_keys]
+ else:
+ new_volume['properties']['sshKeys'] = ex_ssh_keys
body['entities']['volumes']['items'].append(new_volume)
@@ -1072,10 +1080,11 @@ class ProfitBricksNodeDriver(NodeDriver):
:type ex_bus_type: ``str``
:param ex_ssh_keys: Optional SSH keys.
- :type ex_ssh_keys: ``list`` of :class:`NodeAuthSSHKey`
+ :type ex_ssh_keys: ``list`` of :class:`NodeAuthSSHKey` or
+ ``list`` of ``str``
:param ex_password: Optional password for root.
- :type ex_password: :class:`NodeAuthPassword`
+ :type ex_password: :class:`NodeAuthPassword` or ``str``
:param ex_availability_zone: Volume Availability Zone.
:type ex_availability_zone: ``str``
@@ -1132,10 +1141,16 @@ class ProfitBricksNodeDriver(NodeDriver):
if ex_bus_type is not None:
body['properties']['bus'] = ex_bus_type
if ex_ssh_keys is not None:
- body['properties']['sshKeys'] = \
- [ssh_key.pubkey for ssh_key in ex_ssh_keys]
+ if isinstance(ex_ssh_keys[0], NodeAuthSSHKey):
+ body['properties']['sshKeys'] = \
+ [ssh_key.pubkey for ssh_key in ex_ssh_keys]
+ else:
+ body['properties']['sshKeys'] = ex_ssh_keys
if ex_password is not None:
- body['properties']['imagePassword'] = ex_password.password
+ if isinstance(ex_password, NodeAuthPassword):
+ body['properties']['imagePassword'] = ex_password.password
+ else:
+ body['properties']['imagePassword'] = ex_password
if ex_availability_zone is not None:
body['properties']['availabilityZone'] = ex_availability_zone
@@ -2697,7 +2712,7 @@ class ProfitBricksNodeDriver(NodeDriver):
action = volume.extra['href'] + '/restore-snapshot'
data = {'snapshotId': snapshot.id}
- body = urllib.urlencode(data)
+ body = urlencode(data)
self.connection.request(
action=action,
[07/10] libcloud git commit: Update EC2 pricing data - add info for
new instance types.
Posted by to...@apache.org.
Update EC2 pricing data - add info for new instance types.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/59651468
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/59651468
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/59651468
Branch: refs/heads/trunk
Commit: 5965146876acdcc537a7ea59f13a9c6dce9d8149
Parents: abe0c99
Author: Tomaz Muraus <to...@tomaz.me>
Authored: Thu Sep 21 23:22:28 2017 +0200
Committer: Tomaz Muraus <to...@tomaz.me>
Committed: Thu Sep 21 23:22:28 2017 +0200
----------------------------------------------------------------------
libcloud/data/pricing.json | 64 +++++++++++++++++++++++++++++++++++++----
1 file changed, 58 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/59651468/libcloud/data/pricing.json
----------------------------------------------------------------------
diff --git a/libcloud/data/pricing.json b/libcloud/data/pricing.json
index d7c6ba4..f9147c1 100644
--- a/libcloud/data/pricing.json
+++ b/libcloud/data/pricing.json
@@ -49,6 +49,9 @@
"d2.8xlarge": 6.752,
"g2.2xlarge": 0.898,
"g2.8xlarge": 3.592,
+ "g3.4xlarge": 1.58,
+ "g3.8xlarge": 3.16,
+ "g3.16xlarge": 6.32,
"hi1.4xlarge": 3.276,
"hs1.8xlarge": 5.4,
"i2.xlarge": 1.001,
@@ -101,7 +104,8 @@
"t2.nano": 0.008,
"t2.2xlarge": 0.512,
"x1.16xlarge": 9.671,
- "x1.32xlarge": 19.341
+ "x1.32xlarge": 19.341,
+ "x1e.32xlarge": 38.688
},
"ec2_ap_south_1": {
"c4.large": 0.11,
@@ -129,6 +133,9 @@
"m4.4xlarge": 0.984,
"m4.10xlarge": 2.46,
"m4.16xlarge": 3.936,
+ "p2.xlarge": 1.718,
+ "p2.8xlarge": 13.744,
+ "p2.16xlarge": 27.488,
"r3.large": 0.19,
"r3.xlarge": 0.379,
"r3.2xlarge": 0.758,
@@ -169,6 +176,9 @@
"d2.8xlarge": 6.96,
"g2.2xlarge": 1.0,
"g2.8xlarge": 4.0,
+ "g3.4xlarge": 1.67,
+ "g3.8xlarge": 3.34,
+ "g3.16xlarge": 6.68,
"hs1.8xlarge": 5.57,
"i2.xlarge": 1.018,
"i2.2xlarge": 2.035,
@@ -197,6 +207,9 @@
"m4.4xlarge": 1.0,
"m4.10xlarge": 2.5,
"m4.16xlarge": 4.0,
+ "p2.xlarge": 1.718,
+ "p2.8xlarge": 13.744,
+ "p2.16xlarge": 27.488,
"r3.large": 0.2,
"r3.xlarge": 0.399,
"r3.2xlarge": 0.798,
@@ -238,6 +251,9 @@
"d2.8xlarge": 6.96,
"g2.2xlarge": 0.898,
"g2.8xlarge": 3.592,
+ "g3.4xlarge": 1.754,
+ "g3.8xlarge": 3.508,
+ "g3.16xlarge": 7.016,
"hs1.8xlarge": 5.57,
"i2.xlarge": 1.018,
"i2.2xlarge": 2.035,
@@ -266,6 +282,9 @@
"m4.4xlarge": 1.0,
"m4.10xlarge": 2.5,
"m4.16xlarge": 4.0,
+ "p2.xlarge": 1.542,
+ "p2.8xlarge": 12.336,
+ "p2.16xlarge": 24.672,
"r3.large": 0.2,
"r3.xlarge": 0.399,
"r3.2xlarge": 0.798,
@@ -381,6 +400,9 @@
"d2.8xlarge": 6.352,
"g2.2xlarge": 0.772,
"g2.8xlarge": 3.088,
+ "g3.4xlarge": 1.425,
+ "g3.8xlarge": 2.85,
+ "g3.16xlarge": 5.7,
"i2.xlarge": 1.013,
"i2.2xlarge": 2.026,
"i2.4xlarge": 4.051,
@@ -401,6 +423,9 @@
"m4.4xlarge": 0.96,
"m4.10xlarge": 2.4,
"m4.16xlarge": 3.84,
+ "p2.xlarge": 1.326,
+ "p2.8xlarge": 10.608,
+ "p2.16xlarge": 21.216,
"r3.large": 0.2,
"r3.xlarge": 0.4,
"r3.2xlarge": 0.8,
@@ -442,8 +467,13 @@
"d2.2xlarge": 1.47,
"d2.4xlarge": 2.94,
"d2.8xlarge": 5.88,
+ "f1.2xlarge": 1.815,
+ "f1.16xlarge": 14.52,
"g2.2xlarge": 0.702,
"g2.8xlarge": 2.808,
+ "g3.4xlarge": 1.21,
+ "g3.8xlarge": 2.42,
+ "g3.16xlarge": 4.84,
"hi1.4xlarge": 3.1,
"hs1.8xlarge": 4.9,
"i2.xlarge": 0.938,
@@ -496,7 +526,8 @@
"t2.nano": 0.0063,
"t2.2xlarge": 0.404,
"x1.16xlarge": 8.003,
- "x1.32xlarge": 16.006
+ "x1.32xlarge": 16.006,
+ "x1e.32xlarge": 32.0
},
"ec2_eu_west_2": {
"c4.large": 0.119,
@@ -628,7 +659,9 @@
"t2.large": 0.162,
"t2.xlarge": 0.324,
"t2.nano": 0.0101,
- "t2.2xlarge": 0.648
+ "t2.2xlarge": 0.648,
+ "x1.16xlarge": 13.005,
+ "x1.32xlarge": 26.01
},
"ec2_us_east": {
"c1.medium": 0.13,
@@ -654,6 +687,9 @@
"f1.16xlarge": 13.2,
"g2.2xlarge": 0.65,
"g2.8xlarge": 2.6,
+ "g3.4xlarge": 1.14,
+ "g3.8xlarge": 2.28,
+ "g3.16xlarge": 4.56,
"hi1.4xlarge": 3.1,
"hs1.8xlarge": 4.6,
"i2.xlarge": 0.853,
@@ -706,7 +742,8 @@
"t2.nano": 0.0059,
"t2.2xlarge": 0.376,
"x1.16xlarge": 6.669,
- "x1.32xlarge": 13.338
+ "x1.32xlarge": 13.338,
+ "x1e.32xlarge": 26.688
},
"ec2_us_east_ohio": {
"c4.large": 0.1,
@@ -718,6 +755,9 @@
"d2.2xlarge": 1.38,
"d2.4xlarge": 2.76,
"d2.8xlarge": 5.52,
+ "g3.4xlarge": 1.14,
+ "g3.8xlarge": 2.28,
+ "g3.16xlarge": 4.56,
"i2.xlarge": 0.853,
"i2.2xlarge": 1.705,
"i2.4xlarge": 3.41,
@@ -776,6 +816,9 @@
"d2.2xlarge": 1.656,
"d2.4xlarge": 3.312,
"d2.8xlarge": 6.624,
+ "g3.4xlarge": 1.32,
+ "g3.8xlarge": 2.64,
+ "g3.16xlarge": 5.28,
"hs1.8xlarge": 5.52,
"i2.xlarge": 1.023,
"i2.2xlarge": 2.046,
@@ -848,6 +891,9 @@
"d2.8xlarge": 6.25,
"g2.2xlarge": 0.702,
"g2.8xlarge": 2.808,
+ "g3.4xlarge": 1.534,
+ "g3.8xlarge": 3.068,
+ "g3.16xlarge": 6.136,
"i2.xlarge": 0.938,
"i2.2xlarge": 1.876,
"i2.4xlarge": 3.751,
@@ -914,8 +960,13 @@
"d2.2xlarge": 1.38,
"d2.4xlarge": 2.76,
"d2.8xlarge": 5.52,
+ "f1.2xlarge": 1.65,
+ "f1.16xlarge": 13.2,
"g2.2xlarge": 0.65,
"g2.8xlarge": 2.6,
+ "g3.4xlarge": 1.14,
+ "g3.8xlarge": 2.28,
+ "g3.16xlarge": 4.56,
"hi1.4xlarge": 3.1,
"hs1.8xlarge": 4.6,
"i2.xlarge": 0.853,
@@ -968,7 +1019,8 @@
"t2.nano": 0.0059,
"t2.2xlarge": 0.376,
"x1.16xlarge": 6.669,
- "x1.32xlarge": 13.338
+ "x1.32xlarge": 13.338,
+ "x1e.32xlarge": 26.688
},
"elastichosts": {
"small": 0.1,
@@ -1457,5 +1509,5 @@
}
},
"storage": {},
- "updated": 1494321515
+ "updated": 1506028928
}
\ No newline at end of file
[09/10] libcloud git commit: Merge branch 'trunk' into
profitbricks-update
Posted by to...@apache.org.
Merge branch 'trunk' into profitbricks-update
Closes #1103
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/53447fcc
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/53447fcc
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/53447fcc
Branch: refs/heads/trunk
Commit: 53447fcc056b3efa7d57a898d51ce42c98aea537
Parents: 5d76cf6 0afdda2
Author: Tomaz Muraus <to...@tomaz.me>
Authored: Sun Sep 24 16:07:47 2017 +0200
Committer: Tomaz Muraus <to...@tomaz.me>
Committed: Sun Sep 24 16:11:58 2017 +0200
----------------------------------------------------------------------
.codecov.yml | 23 +
.gitignore | 1 +
.travis.yml | 5 +-
CHANGES.rst | 57 +-
MANIFEST.in | 1 +
README.rst | 4 +-
.../generate_provider_feature_matrix_table.py | 7 +-
doap_libcloud.rdf | 9 +-
docs/committer_guide.rst | 22 +-
.../_supported_methods_block_storage.rst | 2 +-
.../_supported_methods_image_management.rst | 2 +-
docs/compute/_supported_providers.rst | 2 +-
docs/conf.py | 20 +-
docs/copyright.rst | 10 +
docs/dns/_supported_providers.rst | 2 +-
docs/loadbalancer/_supported_providers.rst | 2 +-
docs/storage/_supported_methods_cdn.rst | 2 +
docs/storage/_supported_methods_main.rst | 2 +
docs/storage/_supported_providers.rst | 8 +-
libcloud/__init__.py | 3 +-
libcloud/compute/drivers/azure_arm.py | 46 +-
libcloud/compute/drivers/ec2.py | 64 +-
libcloud/compute/drivers/oneandone.py | 398 +-
libcloud/compute/ssh.py | 5 +-
libcloud/data/pricing.json | 64 +-
libcloud/http.py | 22 +-
libcloud/storage/drivers/azure_blobs.py | 6 +-
libcloud/test/__init__.py | 2 +
...9_providers_Microsoft_Commerce_RateCard.json | 84270 -----------------
...99999999999_providers_Microsoft_Compute.json | 200 -
...99999_providers_Microsoft_Compute_disks.json | 65 -
...rosoft_Compute_locations_eastus_vmSizes.json | 28 -
...9_providers_Microsoft_Compute_snapshots.json | 75 -
...iders_Microsoft_Compute_virtualMachines.json | 52 -
...ers_Microsoft_Compute_disks_test_disk_1.json | 22 -
...Microsoft_Compute_snapshots_test_snap_1.json | 20 -
...oft_Compute_virtualMachines_test_node_1.json | 48 -
...irtualMachines_test_node_1_InstanceView.json | 27 -
...twork_networkInterfaces_test_node_1_nic.json | 38 -
...11111_providers_Microsoft_Compute_disks.json | 22 -
...1_providers_Microsoft_Compute_snapshots.json | 38 -
...9_providers_Microsoft_Commerce_RateCard.json | 84270 +++++++++++++++++
...ns_99999999_providers_Microsoft_Compute.json | 200 +
...99999_providers_Microsoft_Compute_disks.json | 65 +
...rosoft_Compute_locations_eastus_vmSizes.json | 28 +
...9_providers_Microsoft_Compute_snapshots.json | 75 +
...iders_Microsoft_Compute_virtualMachines.json | 52 +
...ers_Microsoft_Compute_disks_test_disk_1.json | 22 +
...Microsoft_Compute_snapshots_test_snap_1.json | 20 +
...oft_Compute_virtualMachines_test_node_1.json | 48 +
...irtualMachines_test_node_1_InstanceView.json | 27 +
...twork_networkInterfaces_test_node_1_nic.json | 38 +
...11111_providers_Microsoft_Compute_disks.json | 22 +
...1_providers_Microsoft_Compute_snapshots.json | 38 +
libcloud/test/compute/test_azure_arm.py | 38 +-
libcloud/test/compute/test_ec2.py | 10 +-
libcloud/test/storage/test_azure_blobs.py | 25 +-
requirements-tests.txt | 4 +-
scripts/check_file_names.sh | 34 +
tox.ini | 38 +-
60 files changed, 85516 insertions(+), 85234 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/53447fcc/CHANGES.rst
----------------------------------------------------------------------
diff --cc CHANGES.rst
index 75dbf52,875bfc5..06ad6c0
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@@ -1,23 -1,62 +1,76 @@@
Changelog
=========
- Changes in current version of Apache Libcloud
- ---------------------------------------------
+ Changes in Apach Libcloud in development
+ ----------------------------------------
+
+ - [EC2] Add new x1.16xlarge and x1e.32xlarge instance type. (GITHUB-1101)
+ [@zulupro]
+
+ - [EC2] Update pricing information for EC2 instances.
+ [Tomaz Muraus]
+
+ Changes in Apache Libcloud 2.2.1
+ --------------------------------
+
+ Common
+ ~~~~~~
+
+ - Fix an issue with installation failing on some operating system and file
+ systems combinations (e.g. ecryptfs layered on top of ext4) which don't
+ support file names longer than 143 characters. (LIBCLOUD-946, GITHUB-1112)
+
+ Reported by Cyrille Verrier.
+ [Tomaz Muraus]
+
+ Compute
+ ~~~~~~~
+
+ - [EC2] add g3 instance types
+ [GITHUB-1101]
+ (@zulupro)
+
+ - [EC2] add 'end' to ec2 reserved_node
+ [GITHUB-1099]
+ (@xofer)
+
+ - Decrease sleep delay (from 1.5 to 0.2 seconds) inside paramiko client which
+ is used to prevent busy waiting while waiting for data on the channel.
+
+ This should cause deploy scripts which produce a lot of output in incremental
+ manner to finish faster.
+ [Tomaz Muraus]
+
+ - Fix a regression in the Azure ARM driver which didn't allow custom storage
+ URI suffix to be used with create_node. (GITHUB-1110)
+ [Lucas Di Pentima]
+
+ Tests
+ ~~~~~
+
+ - Make sure we normalize header values and cast all the numbers to strings in
+ base connection classes used by tests. (LIBCLOUD-945, GITHUB-1111)
+
+ Reported by Erich Eckner.
+ [Tomaz Muraus]
+
+ Changes in Apache Libcloud 2.2.0
+ --------------------------------
+Compute
+~~~~~~~
+
+- [EC2] add g3 instance types
+ [GITHUB-1101]
+ (@zulupro)
+
+- [EC2] add 'end' to ec2 reserved_node
+ [GITHUB-1099]
+ (@xofer)
+
+Changes in Apache Libcloud 2.2.0
+--------------------------------
+
Common
~~~~~~
http://git-wip-us.apache.org/repos/asf/libcloud/blob/53447fcc/doap_libcloud.rdf
----------------------------------------------------------------------
diff --cc doap_libcloud.rdf
index 815feed,f298571..6c93df4
--- a/doap_libcloud.rdf
+++ b/doap_libcloud.rdf
@@@ -371,7 -371,14 +371,14 @@@
<revision>v2.2.0</revision>
</Version>
</release>
- <repository>
+ <release>
+ <Version>
+ <name>2.2.1</name>
+ <created>2017-09-21</created>
+ <revision>v2.2.1</revision>
+ </Version>
+ </release>
- <repository>
++ <repository>
<SVNRepository>
<location rdf:resource="https://svn.apache.org/repos/asf/libcloud/trunk/"/>
<browse rdf:resource="https://svn.apache.org/viewvc/libcloud/trunk/"/>
[10/10] libcloud git commit: Add changelog entry for GITHUB-1103.
Posted by to...@apache.org.
Add changelog entry for GITHUB-1103.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/a5f35e22
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/a5f35e22
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/a5f35e22
Branch: refs/heads/trunk
Commit: a5f35e22ba55bd4b15920cb4cb7a67ea3f0e9dfa
Parents: 53447fc
Author: Tomaz Muraus <to...@tomaz.me>
Authored: Sun Sep 24 16:13:36 2017 +0200
Committer: Tomaz Muraus <to...@tomaz.me>
Committed: Sun Sep 24 16:13:36 2017 +0200
----------------------------------------------------------------------
CHANGES.rst | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/a5f35e22/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index 06ad6c0..bc42ce5 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,12 +4,18 @@
Changes in Apach Libcloud in development
----------------------------------------
+Compute
+~~~~~~~
+
- [EC2] Add new x1.16xlarge and x1e.32xlarge instance type. (GITHUB-1101)
[@zulupro]
- [EC2] Update pricing information for EC2 instances.
[Tomaz Muraus]
+- Update ProfitBricks driver and add support for the new API v4. (GITHUB-1103)
+ [Nurfet Becirevic]
+
Changes in Apache Libcloud 2.2.1
--------------------------------
[03/10] libcloud git commit: ProfitBricks provider API v4 update;
fix & update tests and docs
Posted by to...@apache.org.
ProfitBricks provider API v4 update; fix & update tests and docs
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/01ce1d5c
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/01ce1d5c
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/01ce1d5c
Branch: refs/heads/trunk
Commit: 01ce1d5cb8c72884037a5a1ad18ce7212e79fe75
Parents: 7c84193
Author: nurfet-becirevic <nu...@stackpointcloud.com>
Authored: Sun Sep 3 17:56:17 2017 -0400
Committer: nurfet-becirevic <nu...@stackpointcloud.com>
Committed: Sun Sep 3 17:56:17 2017 -0400
----------------------------------------------------------------------
.../images/provider_logos/profitbricks.png | Bin 0 -> 3866 bytes
docs/compute/drivers/profitbricks.rst | 83 +
.../compute/profitbricks/create_datacenter.py | 26 +
.../examples/compute/profitbricks/create_lan.py | 20 +
.../compute/profitbricks/create_node.py | 51 +
.../compute/profitbricks/create_volume.py | 29 +
.../compute/profitbricks/instantiate_driver.py | 5 +
libcloud/compute/drivers/profitbricks.py | 172 +-
.../fixtures/profitbricks/attach_volume.json | 10 +-
.../fixtures/profitbricks/create_node.json | 10 +-
.../fixtures/profitbricks/create_volume.json | 8 +-
.../profitbricks/create_volume_snapshot.json | 6 +-
.../profitbricks/error_resource_not_found.json | 8 +
.../profitbricks/ex_create_datacenter.json | 6 +-
.../profitbricks/ex_create_firewall_rule.json | 10 +-
.../profitbricks/ex_create_ip_block.json | 6 +-
.../fixtures/profitbricks/ex_create_lan.json | 4 +-
.../profitbricks/ex_create_load_balancer.json | 25 +-
.../ex_create_network_interface.json | 6 +-
.../profitbricks/ex_describe_datacenter.json | 60 +-
.../profitbricks/ex_describe_firewall_rule.json | 10 +-
.../profitbricks/ex_describe_image.json | 5 +-
.../profitbricks/ex_describe_ip_block.json | 11 +-
.../fixtures/profitbricks/ex_describe_lan.json | 6 +-
.../profitbricks/ex_describe_load_balancer.json | 6 +-
.../profitbricks/ex_describe_location.json | 6 +-
.../ex_describe_network_interface.json | 8 +-
.../fixtures/profitbricks/ex_describe_node.json | 28 +-
.../profitbricks/ex_describe_snapshot.json | 6 +-
.../profitbricks/ex_describe_volume.json | 10 +-
.../profitbricks/ex_list_attached_volumes.json | 49 +-
.../profitbricks/ex_list_datacenters.json | 18 +-
.../profitbricks/ex_list_firewall_rules.json | 8 +-
.../profitbricks/ex_list_ip_blocks.json | 10 +-
.../fixtures/profitbricks/ex_list_lans.json | 24 +-
.../ex_list_load_balanced_nics.json | 12 +-
.../profitbricks/ex_list_load_balancers.json | 30 +-
.../ex_list_network_interfaces.json | 14 +-
.../profitbricks/ex_rename_datacenter.json | 16 +-
.../profitbricks/ex_set_inet_access.json | 31 -
.../profitbricks/ex_update_firewall_rule.json | 10 +-
.../fixtures/profitbricks/ex_update_image.json | 5 +-
.../fixtures/profitbricks/ex_update_lan.json | 8 +-
.../profitbricks/ex_update_load_balancer.json | 6 +-
.../ex_update_network_interface.json | 22 +-
.../fixtures/profitbricks/ex_update_node.json | 16 +-
.../profitbricks/ex_update_snapshot.json | 6 +-
.../fixtures/profitbricks/ex_update_volume.json | 10 +-
.../fixtures/profitbricks/list_images.json | 26 +-
.../fixtures/profitbricks/list_locations.json | 83 +-
.../fixtures/profitbricks/list_nodes.json | 46 +-
.../fixtures/profitbricks/list_snapshots.json | 4 +-
.../fixtures/profitbricks/list_volumes.json | 10 +-
libcloud/test/compute/test_profitbricks.py | 1485 ++++++++----------
54 files changed, 1298 insertions(+), 1292 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/docs/_static/images/provider_logos/profitbricks.png
----------------------------------------------------------------------
diff --git a/docs/_static/images/provider_logos/profitbricks.png b/docs/_static/images/provider_logos/profitbricks.png
new file mode 100644
index 0000000..de1a9eb
Binary files /dev/null and b/docs/_static/images/provider_logos/profitbricks.png differ
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/docs/compute/drivers/profitbricks.rst
----------------------------------------------------------------------
diff --git a/docs/compute/drivers/profitbricks.rst b/docs/compute/drivers/profitbricks.rst
new file mode 100644
index 0000000..5c6420c
--- /dev/null
+++ b/docs/compute/drivers/profitbricks.rst
@@ -0,0 +1,83 @@
+ProfitBricks Driver Documentation
+=================================
+
+`ProfitBricks`_ is an innovative and enterprise-grade IaaS provider.
+
+.. figure:: /_static/images/provider_logos/profitbricks.png
+ :align: center
+ :width: 300
+ :target: https://www.profitbricks.com/
+
+The ProfitBricks driver allows you to integrate with the `ProfitBricks Cloud API`_ to manage
+virtual data centers and other resources located in the United States and Germany availability zones.
+
+Instantiating a Driver
+----------------------
+
+Before you start using the ProfitBricks driver you will have to sign up for a ProfitBricks account.
+To instantiate a driver you will need to pass your ProfitBrick credentials, i.e., username and password.
+
+.. literalinclude:: /examples/compute/profitbricks/instantiate_driver.py
+ :language: python
+
+Examples
+--------
+
+Create a data center
+~~~~~~~~~~~~~~~~~~~~
+
+.. literalinclude:: /examples/compute/profitbricks/create_datacenter.py
+ :language: python
+
+Create a LAN
+~~~~~~~~~~~~
+
+.. literalinclude:: /examples/compute/profitbricks/create_lan.py
+ :language: python
+
+Create a node
+~~~~~~~~~~~~~
+
+.. literalinclude:: /examples/compute/profitbricks/create_node.py
+ :language: python
+
+Create an SSD volume
+~~~~~~~~~~~~~~~~~~~~
+
+.. literalinclude:: /examples/compute/profitbricks/create_volume.py
+ :language: python
+
+Refer to the `driver documentation`_ for more examples and code snippets.
+
+API Docs
+--------
+
+.. autoclass:: libcloud.compute.drivers.profitbricks.ProfitBricksNodeDriver
+ :members:
+ :inherited-members:
+
+.. autoclass:: libcloud.compute.drivers.profitbricks.Datacenter
+ :members:
+
+.. autoclass:: libcloud.compute.drivers.profitbricks.ProfitBricksNetworkInterface
+ :members:
+
+.. autoclass:: libcloud.compute.drivers.profitbricks.ProfitBricksFirewallRule
+ :members:
+
+.. autoclass:: libcloud.compute.drivers.profitbricks.ProfitBricksLan
+ :members:
+
+.. autoclass:: libcloud.compute.drivers.profitbricks.ProfitBricksLoadBalancer
+ :members:
+
+.. autoclass:: libcloud.compute.drivers.profitbricks.ProfitBricksAvailabilityZone
+ :members:
+
+.. autoclass:: libcloud.compute.drivers.profitbricks.ProfitBricksIPBlock
+ :members:
+
+.. _`ProfitBricks`: https://www.profitbricks.com/
+.. _`ProfitBricks Cloud API`: https://devops.profitbricks.com/api/cloud/
+.. _`driver documentation`: https://devops.profitbricks.com/libraries/libcloud/
+
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/docs/examples/compute/profitbricks/create_datacenter.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/profitbricks/create_datacenter.py b/docs/examples/compute/profitbricks/create_datacenter.py
new file mode 100644
index 0000000..3912af7
--- /dev/null
+++ b/docs/examples/compute/profitbricks/create_datacenter.py
@@ -0,0 +1,26 @@
+import os
+
+from libcloud.compute.types import Provider
+from libcloud.compute.providers import get_driver
+
+cls = get_driver(Provider.PROFIT_BRICKS)
+
+# Get ProfitBricks credentials from environment variables
+pb_username = os.environ.get('PROFITBRICKS_USERNAME')
+pb_password = os.environ.get('PROFITBRICKS_PASSWORD')
+
+driver = cls(pb_username, pb_password)
+
+# list available locations
+locations = driver.list_locations()
+
+my_location = None
+# US Las Vegas location
+for loc in locations:
+ if loc.id == 'us/las':
+ my_location = loc
+ break
+
+# Create a data center
+datacenter = driver.ex_create_datacenter('demo-dc', my_location)
+print(datacenter)
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/docs/examples/compute/profitbricks/create_lan.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/profitbricks/create_lan.py b/docs/examples/compute/profitbricks/create_lan.py
new file mode 100644
index 0000000..03fe75d
--- /dev/null
+++ b/docs/examples/compute/profitbricks/create_lan.py
@@ -0,0 +1,20 @@
+import os
+
+from libcloud.compute.types import Provider
+from libcloud.compute.providers import get_driver
+
+cls = get_driver(Provider.PROFIT_BRICKS)
+
+# Get ProfitBricks credentials from environment variables
+pb_username = os.environ.get('PROFITBRICKS_USERNAME')
+pb_password = os.environ.get('PROFITBRICKS_PASSWORD')
+
+driver = cls(pb_username, pb_password)
+
+datacenters = driver.list_datacenters()
+# Looks for existing data centers named 'demo-dc'
+datacenter = [dc for dc in datacenters if dc.name == 'demo-dc'][0]
+
+# Create a public LAN
+lan = driver.ex_create_lan(datacenter, is_public=True)
+print(lan)
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/docs/examples/compute/profitbricks/create_node.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/profitbricks/create_node.py b/docs/examples/compute/profitbricks/create_node.py
new file mode 100644
index 0000000..7c79e28
--- /dev/null
+++ b/docs/examples/compute/profitbricks/create_node.py
@@ -0,0 +1,51 @@
+import os
+
+from libcloud.compute.types import Provider
+from libcloud.compute.providers import get_driver
+from libcloud.compute.base import NodeAuthSSHKey
+
+cls = get_driver(Provider.PROFIT_BRICKS)
+
+# Get ProfitBricks credentials from environment variables
+pb_username = os.environ.get('PROFITBRICKS_USERNAME')
+pb_password = os.environ.get('PROFITBRICKS_PASSWORD')
+
+driver = cls(pb_username, pb_password)
+
+# List available sizes
+sizes = driver.list_sizes()
+
+# Medium-size instance
+my_size = sizes[1]
+
+datacenters = driver.ex_list_datacenters()
+# Looks for existing data centers named 'demo-dc'
+desired_dc = [dc for dc in datacenters if dc.name == 'demo-dc']
+
+# Get available HDD public images
+images = driver.list_images('HDD')
+
+my_image = None
+# Let's choose Ubuntu-16.04 image in us/las region
+for img in images:
+ if ('Ubuntu-16.04-LTS-server' in img.name and
+ 'us/las' == img.extra['location']):
+ my_image = img
+ break
+
+node_key = None
+# Read SSH key from file
+# Specify correct path
+with open('/home/user/.ssh/id_rsa.pub', 'r') as f:
+ node_key = NodeAuthSSHKey(f.read())
+f.close()
+
+node = driver.create_node(
+ name='demo-node',
+ size=my_size,
+ ex_cpu_family='INTEL_XEON',
+ image=my_image,
+ ex_datacenter=desired_dc[0],
+ ex_ssh_keys=[node_key]
+)
+print(node)
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/docs/examples/compute/profitbricks/create_volume.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/profitbricks/create_volume.py b/docs/examples/compute/profitbricks/create_volume.py
new file mode 100644
index 0000000..a506d29
--- /dev/null
+++ b/docs/examples/compute/profitbricks/create_volume.py
@@ -0,0 +1,29 @@
+import os
+
+from libcloud.compute.types import Provider
+from libcloud.compute.providers import get_driver
+
+cls = get_driver(Provider.PROFIT_BRICKS)
+
+# Get ProfitBricks credentials from environment variables
+pb_username = os.environ.get('PROFITBRICKS_USERNAME')
+pb_password = os.environ.get('PROFITBRICKS_PASSWORD')
+
+driver = cls(pb_username, pb_password)
+
+datacenters = driver.ex_list_datacenters()
+location = driver.ex_describe_location(ex_location_id='us/las')
+datacenter = [dc for dc in datacenters if dc.extra['location'] == location.id]
+
+images = driver.list_images(image_type='HDD')
+image = [img for img in images if img.extra['location'] == location.id][0]
+# Create a new SSD volume. Set `ex_type='HDD'` to create a HDD volume.
+ssd_volume = driver.create_volume(
+ name='Example SSD volume',
+ size=100,
+ image=image,
+ ex_type='SSD',
+ ex_datacenter=datacenter[0],
+ ex_password='PuTSoMeSTRONGPaSsWoRdHeRe2017'
+)
+print(ssd_volume)
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/docs/examples/compute/profitbricks/instantiate_driver.py
----------------------------------------------------------------------
diff --git a/docs/examples/compute/profitbricks/instantiate_driver.py b/docs/examples/compute/profitbricks/instantiate_driver.py
new file mode 100644
index 0000000..059613a
--- /dev/null
+++ b/docs/examples/compute/profitbricks/instantiate_driver.py
@@ -0,0 +1,5 @@
+from libcloud.compute.types import Provider
+from libcloud.compute.providers import get_driver
+
+cls = get_driver(Provider.PROFIT_BRICKS)
+driver = cls('username', 'password')
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/compute/drivers/profitbricks.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/profitbricks.py b/libcloud/compute/drivers/profitbricks.py
index 43996d4..f2d44cb 100644
--- a/libcloud/compute/drivers/profitbricks.py
+++ b/libcloud/compute/drivers/profitbricks.py
@@ -26,6 +26,7 @@ from libcloud.compute.providers import Provider
from libcloud.common.base import ConnectionUserAndKey, JsonResponse
from libcloud.compute.base import Node, NodeDriver, NodeLocation, NodeSize
from libcloud.compute.base import NodeImage, StorageVolume, VolumeSnapshot
+from libcloud.compute.base import NodeAuthPassword, NodeAuthSSHKey
from libcloud.compute.base import UuidMixin
from libcloud.compute.types import NodeState
from libcloud.common.types import LibcloudError, MalformedResponseError
@@ -41,13 +42,14 @@ __all__ = [
'ProfitBricksNetworkInterface',
'ProfitBricksFirewallRule',
'ProfitBricksLan',
+ 'ProfitBricksIPFailover',
'ProfitBricksLoadBalancer',
'ProfitBricksAvailabilityZone',
'ProfitBricksIPBlock'
]
API_HOST = 'api.profitbricks.com'
-API_VERSION = '/cloudapi/v3/'
+API_VERSION = '/cloudapi/v4/'
class ProfitBricksResponse(JsonResponse):
@@ -296,6 +298,30 @@ class ProfitBricksLan(object):
% (self.id, self.name, self.href))
+class ProfitBricksIPFailover(object):
+ """
+ Extension class which stores information about a
+ ProfitBricks LAN's failover
+
+ :param ip: The IP address to fail over.
+ :type ip: ``str``
+
+ :param nic_uuid: The ID of the NIC to fail over.
+ :param nic_uuid: ``str``
+
+ Note: This class is ProfitBricks specific.
+
+ """
+
+ def __init__(self, ip, nic_uuid):
+ self.ip = ip
+ self.nic_uuid = nic_uuid
+
+ def __repr__(self):
+ return (('<ProfitBricksIPFailover: ip=%s, nic_uuid=%s>')
+ % (self.ip, self.nic_uuid))
+
+
class ProfitBricksLoadBalancer(object):
"""
Extention class which stores information about a
@@ -670,10 +696,10 @@ class ProfitBricksNodeDriver(NodeDriver):
:type ex_disk: ``int``
:param ex_password: The password for the volume.
- :type ex_password: ``str``
+ :type ex_password: :class:`NodeAuthPassword`
:param ex_ssh_keys: Optional SSH keys for the volume.
- :type ex_ssh_keys: ``list`` of ``str``
+ :type ex_ssh_keys: ``list`` of :class:`NodeAuthSSHKey`
:param ex_bus_type: Volume bus type (VIRTIO, IDE).
:type ex_bus_type: ``str``
@@ -736,7 +762,7 @@ class ProfitBricksNodeDriver(NodeDriver):
'''
If passing in an image we need
- to enfore a password or ssh keys.
+ to enforce a password or ssh keys.
'''
if not volume and image is not None:
if ex_password is None and ex_ssh_keys is None:
@@ -807,10 +833,12 @@ class ProfitBricksNodeDriver(NodeDriver):
}
if ex_password is not None:
- new_volume['properties']['imagePassword'] = ex_password
+ new_volume['properties']['imagePassword'] = \
+ ex_password.password
if ex_ssh_keys is not None:
- new_volume['properties']['sshKeys'] = ex_ssh_keys
+ new_volume['properties']['sshKeys'] = \
+ [ssh_key.pubkey for ssh_key in ex_ssh_keys]
body['entities']['volumes']['items'].append(new_volume)
@@ -1008,9 +1036,10 @@ class ProfitBricksNodeDriver(NodeDriver):
def create_volume(
self,
size,
- image,
ex_datacenter,
name=None,
+ image=None,
+ ex_image_alias=None,
ex_type=None,
ex_bus_type=None,
ex_ssh_keys=None,
@@ -1023,9 +1052,6 @@ class ProfitBricksNodeDriver(NodeDriver):
:param size: The size of the volume in GB.
:type size: ``int``
- :param image: The OS image for the volume.
- :type image: :class:`NodeImage`
-
:param ex_datacenter: The datacenter you're placing
the storage in. (req)
:type ex_datacenter: :class:`Datacenter`
@@ -1033,6 +1059,13 @@ class ProfitBricksNodeDriver(NodeDriver):
:param name: The name to be given to the volume.
:param name: ``str``
+ :param image: The OS image for the volume.
+ :type image: :class:`NodeImage`
+
+ :param ex_image_alias: An alias to a ProfitBricks public image.
+ Use instead of 'image'.
+ :type ex_image_alias: ``str``
+
:param ex_type: The type to be given to the volume (SSD or HDD).
:param ex_type: ``str``
@@ -1040,10 +1073,10 @@ class ProfitBricksNodeDriver(NodeDriver):
:type ex_bus_type: ``str``
:param ex_ssh_keys: Optional SSH keys.
- :type ex_ssh_keys: ``dict``
+ :type ex_ssh_keys: ``list`` of :class:`NodeAuthSSHKey`
:param ex_password: Optional password for root.
- :type ex_password: ``str``
+ :type ex_password: :class:`NodeAuthPassword`
:param ex_availability_zone: Volume Availability Zone.
:type ex_availability_zone: ``str``
@@ -1056,39 +1089,43 @@ class ProfitBricksNodeDriver(NodeDriver):
raise ValueError('You need to specify a data center'
' to attach this volume to.')
- if not image:
- raise ValueError('You need to specify an image'
- ' to create this volume from.')
-
- if image.extra['image_type'] != 'HDD':
- raise ValueError('Invalid type of {image_type} specified for '
- '{image_name}, which needs to be of type HDD'
- .format(image_type=image.extra['image_type'],
- image_name=image.name))
-
- if ex_datacenter.extra['location'] != image.extra['location']:
- raise ValueError(
- 'The image {image_name} '
- '(location: {image_location}) you specified '
- 'is not available at the data center '
- '{datacenter_name} '
- '(location: {datacenter_location}).'
- .format(
- image_name=image.extra['name'],
- datacenter_name=ex_datacenter.extra['name'],
- image_location=image.extra['location'],
- datacenter_location=ex_datacenter.extra['location']
+ if image is not None:
+ if image.extra['image_type'] != 'HDD':
+ raise ValueError('Invalid type of {image_type} specified for '
+ '{image_name}, which needs to be of type HDD'
+ .format(image_type=image.extra['image_type'],
+ image_name=image.name))
+
+ if ex_datacenter.extra['location'] != image.extra['location']:
+ raise ValueError(
+ 'The image {image_name} '
+ '(location: {image_location}) you specified '
+ 'is not available at the data center '
+ '{datacenter_name} '
+ '(location: {datacenter_location}).'
+ .format(
+ image_name=image.extra['name'],
+ datacenter_name=ex_datacenter.extra['name'],
+ image_location=image.extra['location'],
+ datacenter_location=ex_datacenter.extra['location']
+ )
)
- )
+ else:
+ if not ex_image_alias:
+ raise ValueError('You need to specify an image or image alias'
+ ' to create this volume from.')
action = ex_datacenter.href + '/volumes'
body = {
'properties': {
- 'size': size,
- 'image': image.id
+ 'size': size
}
}
+ if image is not None:
+ body['properties']['image'] = image.id
+ else:
+ body['properties']['imageAlias'] = ex_image_alias
if name is not None:
body['properties']['name'] = name
if ex_type is not None:
@@ -1096,9 +1133,10 @@ class ProfitBricksNodeDriver(NodeDriver):
if ex_bus_type is not None:
body['properties']['bus'] = ex_bus_type
if ex_ssh_keys is not None:
- body['properties']['sshKeys'] = ex_ssh_keys
+ body['properties']['sshKeys'] = \
+ [ssh_key.pubkey for ssh_key in ex_ssh_keys]
if ex_password is not None:
- body['properties']['imagePassword'] = ex_password
+ body['properties']['imagePassword'] = ex_password.password
if ex_availability_zone is not None:
body['properties']['availabilityZone'] = ex_availability_zone
@@ -1382,7 +1420,8 @@ class ProfitBricksNodeDriver(NodeDriver):
:param availability_zone: Update the availability zone.
:type availability_zone: :class:`ProfitBricksAvailabilityZone`
- :param ex_licence_type: Licence type (WINDOWS, LINUX, OTHER).
+ :param ex_licence_type: Licence type (WINDOWS, WINDOWS2016, LINUX,
+ OTHER, UNKNOWN).
:type ex_licence_type: ``str``
:param ex_boot_volume: Setting the new boot (HDD) volume.
@@ -1531,7 +1570,7 @@ class ProfitBricksNodeDriver(NodeDriver):
you are describing.
:type ex_href: ``str``
- :param ex_datacenter_id: The ID for the data cente
+ :param ex_datacenter_id: The ID for the data center
you are describing.
:type ex_datacenter_id: ``str``
@@ -1696,37 +1735,37 @@ class ProfitBricksNodeDriver(NodeDriver):
body['description'] = description
if licence_type is not None:
- body['licence_type'] = licence_type
+ body['licenceType'] = licence_type
if cpu_hot_plug is not None:
- body['cpu_hot_plug'] = cpu_hot_plug
+ body['cpuHotPlug'] = cpu_hot_plug
if cpu_hot_unplug is not None:
- body['cpu_hot_unplug'] = cpu_hot_unplug
+ body['cpuHotUnplug'] = cpu_hot_unplug
if ram_hot_plug is not None:
- body['ram_hot_plug'] = ram_hot_plug
+ body['ramHotPlug'] = ram_hot_plug
if ram_hot_unplug is not None:
- body['ram_hot_unplug'] = ram_hot_unplug
+ body['ramHotUnplug'] = ram_hot_unplug
if nic_hot_plug is not None:
- body['nic_hot_plug'] = nic_hot_plug
+ body['nicHotPlug'] = nic_hot_plug
if nic_hot_unplug is not None:
- body['nic_hot_unplug'] = nic_hot_unplug
+ body['nicHotUnplug'] = nic_hot_unplug
if disc_virtio_hot_plug is not None:
- body['disc_virtio_hot_plug'] = disc_virtio_hot_plug
+ body['discVirtioHotPlug'] = disc_virtio_hot_plug
if disc_virtio_hot_unplug is not None:
- body['disc_virtio_hot_unplug'] = disc_virtio_hot_unplug
+ body['discVirtioHotUnplug'] = disc_virtio_hot_unplug
if disc_scsi_hot_plug is not None:
- body['disc_scsi_hot_plug'] = disc_scsi_hot_plug
+ body['discScsiHotPlug'] = disc_scsi_hot_plug
if disc_scsi_hot_unplug is not None:
- body['disc_scsi_hot_unplug'] = disc_scsi_hot_unplug
+ body['discScsiHotUnplug'] = disc_scsi_hot_unplug
response = self.connection.request(
action=action,
@@ -1754,7 +1793,7 @@ class ProfitBricksNodeDriver(NodeDriver):
:type ex_href: ``str``
:param ex_location_id: The id for the location you are
- describing ('de/fra', 'de/fkb', 'us/las')
+ describing ('de/fra', 'de/fkb', 'us/las', 'us/ewr')
:type ex_location_id: ``str``
:return: Instance of class ``NodeLocation``
@@ -1766,7 +1805,7 @@ class ProfitBricksNodeDriver(NodeDriver):
if ex_href is None:
if ex_location_id is None:
raise ValueError(
- 'The loctation ID is required.'
+ 'The location ID is required.'
)
else:
use_full_url = False
@@ -2347,7 +2386,7 @@ class ProfitBricksNodeDriver(NodeDriver):
- a datacenter if one is specified
- all datacenters if none specified
- :param datacenter: The DC you are renaming.
+ :param datacenter: The parent DC for the LAN.
:type datacenter: :class:`Datacenter`
:return: ``list`` of class ``ProfitBricksLan``
@@ -2378,13 +2417,16 @@ class ProfitBricksNodeDriver(NodeDriver):
return lans
- def ex_create_lan(self, datacenter, is_public=False, nics=None):
+ def ex_create_lan(self, datacenter, name=None, is_public=False, nics=None):
"""
Create and attach a Lan to a data center.
- :param datacenter: The DC you are renaming.
+ :param datacenter: The parent DC for the LAN..
:type datacenter: :class:`Datacenter`
+ :param name: LAN name.
+ :type name: ``str``
+
:param is_public: True if the Lan is to have internet access.
:type is_public: ``bool``
@@ -2398,7 +2440,9 @@ class ProfitBricksNodeDriver(NodeDriver):
action = datacenter.extra['entities']['lans']['href']
body = {
'properties': {
- 'name': 'LAN - {datacenter_name}'.format(
+ 'name':
+ name or
+ 'LAN - {datacenter_name}'.format(
datacenter_name=datacenter.name
),
'public': is_public
@@ -2472,7 +2516,7 @@ class ProfitBricksNodeDriver(NodeDriver):
return self._to_lan(response.object)
- def ex_update_lan(self, lan, is_public, name=None):
+ def ex_update_lan(self, lan, is_public, name=None, ip_failover=None):
"""
Update a local area network
@@ -2486,6 +2530,9 @@ class ProfitBricksNodeDriver(NodeDriver):
:param name: The name of the lan.
:type name: ``str``
+ :param ip_failover: The IP to fail over.
+ :type ip_failover: ``list`` of :class: ``ProfitBricksIPFailover``
+
:return: Instance class ``ProfitBricksLan``
:rtype: :class:`ProfitBricksLan`
"""
@@ -2497,6 +2544,10 @@ class ProfitBricksNodeDriver(NodeDriver):
if name is not None:
body['name'] = name
+ if ip_failover is not None:
+ body['ipFailover'] = [{'ip': item.ip, 'nicUuid': item.nic_uuid}
+ for item in ip_failover]
+
request = self.connection.request(
action=action,
headers={
@@ -2908,7 +2959,7 @@ class ProfitBricksNodeDriver(NodeDriver):
"""
Create and attach a load balancer to a data center.
- :param datacenter: The DC you are renaming.
+ :param datacenter: The parent DC for the load balancer.
:type datacenter: :class:`Datacenter`
:param name: Load balancer name.
@@ -3595,6 +3646,7 @@ class ProfitBricksNodeDriver(NodeDriver):
'discScsiHotUnplug': 'disc_scsi_hot_unplug',
'licenceType': 'licence_type',
'imageType': 'image_type',
+ 'imageAliases': 'image_aliases',
'public': 'public'
}
}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/attach_volume.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/attach_volume.json b/libcloud/test/compute/fixtures/profitbricks/attach_volume.json
index eda9a22..700aa0f 100644
--- a/libcloud/test/compute/fixtures/profitbricks/attach_volume.json
+++ b/libcloud/test/compute/fixtures/profitbricks/attach_volume.json
@@ -1,7 +1,7 @@
{
"id" : "vol-2",
"type" : "volume",
- "href" : "/cloudapi/v3/datacenters/dc-1/volumes/vol-2",
+ "href" : "/cloudapi/v4/datacenters/dc-1/volumes/vol-2",
"metadata" : {
"createdDate" : "2016-10-17T13:13:36Z",
"createdBy" : "test@test.te",
@@ -11,14 +11,14 @@
"state" : "BUSY"
},
"properties" : {
- "name" : "Updated storage name",
+ "name" : "libcloud Test",
"type" : "HDD",
- "size" : 40,
+ "size" : 2,
"image" : "bvol-img",
"imagePassword" : null,
"sshKeys": null,
"bus" : "VIRTIO",
- "licenceType" : "LINUX",
+ "licenceType" : "UNKNOWN",
"cpuHotPlug" : true,
"cpuHotUnplug" : false,
"ramHotPlug" : true,
@@ -29,6 +29,6 @@
"discVirtioHotUnplug" : true,
"discScsiHotPlug" : false,
"discScsiHotUnplug" : false,
- "deviceNumber" : 3
+ "deviceNumber" : 2
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/create_node.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/create_node.json b/libcloud/test/compute/fixtures/profitbricks/create_node.json
index b732980..8a129f4 100644
--- a/libcloud/test/compute/fixtures/profitbricks/create_node.json
+++ b/libcloud/test/compute/fixtures/profitbricks/create_node.json
@@ -1,7 +1,7 @@
{
"id": "srv-2",
"type": "server",
- "href": "cloudapi/v3/datacenters/f3f7ca3c-6f3d-4a4d-b3d6-15853ae5ba78/servers/srv-2",
+ "href": "cloudapi/v4/datacenters/f3f7ca3c-6f3d-4a4d-b3d6-15853ae5ba78/servers/srv-2",
"metadata": {
"createdDate": "2016-10-19T13:25:19Z",
"createdBy": "test@test.te",
@@ -11,9 +11,9 @@
"state": "BUSY"
},
"properties": {
- "name": "Test",
+ "name": "libcloud Test",
"cores": 1,
- "ram": 512,
+ "ram": 1024,
"availabilityZone": "ZONE_1",
"vmState": null,
"bootCdrom": null,
@@ -24,12 +24,12 @@
"volumes": {
"id": "srv-2/volumes",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/f3f7ca3c-6f3d-4a4d-b3d6-15853ae5ba78/servers/srv-2/volumes",
+ "href": "/cloudapi/v4/datacenters/f3f7ca3c-6f3d-4a4d-b3d6-15853ae5ba78/servers/srv-2/volumes",
"items": [
{
"id": "53abb4de-b37b-4025-b139-3e09141e20bb",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/srv-2/volumes/53abb4de-b37b-4025-b139-3e09141e20bb"
+ "href": "/cloudapi/v4/datacenters/srv-2/volumes/53abb4de-b37b-4025-b139-3e09141e20bb"
}
]
}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/create_volume.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/create_volume.json b/libcloud/test/compute/fixtures/profitbricks/create_volume.json
index 59720d9..5118cde 100644
--- a/libcloud/test/compute/fixtures/profitbricks/create_volume.json
+++ b/libcloud/test/compute/fixtures/profitbricks/create_volume.json
@@ -1,7 +1,7 @@
{
"id" : "vol-2",
"type" : "volume",
- "href" : "/cloudapi/v3/datacenters/dc-1/volumes/vol-2",
+ "href" : "/cloudapi/v4/datacenters/dc-1/volumes/vol-2",
"metadata" : {
"createdDate" : "2016-10-17T13:13:36Z",
"createdBy" : "test@test.te",
@@ -11,10 +11,10 @@
"state" : "BUSY"
},
"properties" : {
- "name": "Updated storage name",
+ "name": "libcloud Test",
"type": "HDD",
- "size": 40,
- "availabilityZone": "AUTO",
+ "size": 2,
+ "availabilityZone": "ZONE_3",
"image": "bvol-img",
"imagePassword": null,
"sshKeys": null,
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/create_volume_snapshot.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/create_volume_snapshot.json b/libcloud/test/compute/fixtures/profitbricks/create_volume_snapshot.json
index a90f585..da1eec6 100644
--- a/libcloud/test/compute/fixtures/profitbricks/create_volume_snapshot.json
+++ b/libcloud/test/compute/fixtures/profitbricks/create_volume_snapshot.json
@@ -1,7 +1,7 @@
{
"id": "sshot",
"type": "snapshot",
- "href": "/cloudapi/v3/snapshots/sshot",
+ "href": "/cloudapi/v4/snapshots/sshot",
"metadata": {
"createdDate": "2016-10-26T11:38:45Z",
"createdBy": "test@test.te",
@@ -11,8 +11,8 @@
"state": "BUSY"
},
"properties": {
- "name": "Test Created Snapshot",
- "description": "Test Created Snapshot",
+ "name": "libcloud Test",
+ "description": "libcloud test snapshot",
"location": "us/las",
"size": 10,
"cpuHotPlug": true,
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/error_resource_not_found.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/error_resource_not_found.json b/libcloud/test/compute/fixtures/profitbricks/error_resource_not_found.json
new file mode 100644
index 0000000..d0ce3c3
--- /dev/null
+++ b/libcloud/test/compute/fixtures/profitbricks/error_resource_not_found.json
@@ -0,0 +1,8 @@
+{
+ "httpStatus": 404,
+ "messages": [{
+ "errorCode": "309",
+ "message": "Resource does not exist"
+ }
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_create_datacenter.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_create_datacenter.json b/libcloud/test/compute/fixtures/profitbricks/ex_create_datacenter.json
index 3f42689..e819d8e 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_create_datacenter.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_create_datacenter.json
@@ -1,7 +1,7 @@
{
"id": "dc-1",
"type": "datacenter",
- "href": "/cloudapi/v3/datacenters/dc-1",
+ "href": "/cloudapi/v4/datacenters/dc-1",
"metadata": {
"createdDate": "2016-10-18T17:20:56Z",
"createdBy": "test@test.te",
@@ -11,8 +11,8 @@
"state": "BUSY"
},
"properties": {
- "name": "Test Data Center",
- "description": "Test Data Center.",
+ "name": "libcloud Test",
+ "description": "libcloud test datacenter",
"location": "us/las",
"version": null,
"features": []
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_create_firewall_rule.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_create_firewall_rule.json b/libcloud/test/compute/fixtures/profitbricks/ex_create_firewall_rule.json
index a5f4210..fe1f685 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_create_firewall_rule.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_create_firewall_rule.json
@@ -1,7 +1,7 @@
{
"id": "fwr-1",
"type": "firewall-rule",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-2/firewallrules/fwr-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-2/firewallrules/fwr-1",
"metadata": {
"createdDate": "2016-10-19T11:08:04Z",
"createdBy": "test@test.te",
@@ -11,14 +11,14 @@
"state": "BUSY"
},
"properties": {
- "name": "Test created firewall rule",
+ "name": "SSH",
"protocol": "TCP",
- "sourceMac": null,
+ "sourceMac": "01:23:45:67:89:00",
"sourceIp": null,
"targetIp": null,
"icmpCode": null,
"icmpType": null,
- "portRangeStart": 80,
- "portRangeEnd": 80
+ "portRangeStart": 22,
+ "portRangeEnd": 22
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_create_ip_block.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_create_ip_block.json b/libcloud/test/compute/fixtures/profitbricks/ex_create_ip_block.json
index 56b0544..b561bb0 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_create_ip_block.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_create_ip_block.json
@@ -1,7 +1,7 @@
{
"id": "ipb-1",
"type": "ipblock",
- "href": "/cloudapi/v3/ipblocks/ipb-1",
+ "href": "/cloudapi/v4/ipblocks/ipb-1",
"metadata": {
"createdDate": "2016-10-26T15:05:36Z",
"createdBy": "test@test.te",
@@ -15,8 +15,8 @@
"11.12.13.14",
"15.16.17.18"
],
- "location": "de/fkb",
+ "location": "us/las",
"size": 2,
- "name": "Test Created IP Block"
+ "name": "libcloud Test"
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_create_lan.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_create_lan.json b/libcloud/test/compute/fixtures/profitbricks/ex_create_lan.json
index 0e2b9cc..c76ed44 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_create_lan.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_create_lan.json
@@ -1,7 +1,7 @@
{
"id" : "10",
"type" : "lan",
- "href" : "/cloudapi/v3/datacenters/dc-1/lans/10",
+ "href" : "/cloudapi/v4/datacenters/dc-1/lans/10",
"metadata" : {
"createdDate": "2016-10-17T11:33:11Z",
"createdBy": "test@test.te",
@@ -11,7 +11,7 @@
"state": "BUSY"
},
"properties" : {
- "name" : "Test Created Lan",
+ "name" : "libcloud Test",
"public" : true
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_create_load_balancer.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_create_load_balancer.json b/libcloud/test/compute/fixtures/profitbricks/ex_create_load_balancer.json
index 67af86b..3f7761c 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_create_load_balancer.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_create_load_balancer.json
@@ -1,7 +1,7 @@
{
"id": "bal-1",
"type": "loadbalancer",
- "href": "/cloudapi/v3/datacenters/dc-1/loadbalancers/bal-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/loadbalancers/bal-1",
"metadata": {
"createdDate": "2016-10-26T13:02:33Z",
"createdBy": "test@test.te",
@@ -11,8 +11,29 @@
"state": "BUSY"
},
"properties": {
- "name": "Test load balancer",
+ "name": "libcloud Test",
"ip": null,
"dhcp": true
+ },
+ "entities": {
+ "balancednics": {
+ "id": "bal-1/balancednics",
+ "type": "collection",
+ "href": "cloudapi/v4/datacenters/dc-1/loadbalancers/bal-1/balancednics",
+ "items": [{
+ "id": "nic-1",
+ "type": "nic",
+ "href": "cloudapi/v4/datacenters/dc-1/servers/bal-1/nics/nic-1",
+ "metadata": {
+ "createdDate": "2016-10-17T15:46:38Z",
+ "createdBy": "test@test.te",
+ "etag": "dbd8216137cf0ec9951170f93fa8fa53",
+ "lastModifiedDate": "2016-10-17T18:19:43Z",
+ "lastModifiedBy": "test@test.te",
+ "state": "BUSY"
+ }
+ }
+ ]
+ }
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_create_network_interface.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_create_network_interface.json b/libcloud/test/compute/fixtures/profitbricks/ex_create_network_interface.json
index 5e45994..0210b83 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_create_network_interface.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_create_network_interface.json
@@ -1,7 +1,7 @@
{
"id": "nic-2",
"type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1/nics/nic-2",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1/nics/nic-2",
"metadata": {
"createdDate": "2016-10-19T08:18:50Z",
"createdBy": "test@test.te",
@@ -11,9 +11,9 @@
"state": "BUSY"
},
"properties": {
- "name": "Creating a test network interface.",
+ "name": "libcloud Test",
"mac": null,
- "ips": [],
+ "ips": [ "10.0.0.1" ],
"dhcp": true,
"lan": 1,
"firewallActive": null,
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_describe_datacenter.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_describe_datacenter.json b/libcloud/test/compute/fixtures/profitbricks/ex_describe_datacenter.json
index 4f20e63..36ba13d 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_describe_datacenter.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_describe_datacenter.json
@@ -1,7 +1,7 @@
{
"id": "dc-1",
"type": "datacenter",
- "href": "/cloudapi/v3/datacenters/dc-1",
+ "href": "/cloudapi/v4/datacenters/dc-1",
"metadata": {
"createdDate": "2016-10-17T11:33:11Z",
"createdBy": "test@test.test",
@@ -11,9 +11,9 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Test Data Center",
- "description": "This is a test data center.",
- "location": "de/fkb",
+ "name": "libcloud Test",
+ "description": "libcloud test datacenter",
+ "location": "us/las",
"version": 35,
"features": [
"SSD",
@@ -24,12 +24,12 @@
"servers": {
"id": "dc-1/servers",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers",
"items": [
{
"id": "srv-1",
"type": "server",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1",
"metadata": {
"createdDate": "2016-10-18T07:28:05Z",
"createdBy": "test@test.test",
@@ -48,7 +48,7 @@
"bootVolume": {
"id": "bvol-1",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/bvol-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/bvol-1",
"metadata": {
"createdDate": "2016-10-18T07:20:41Z",
"createdBy": "test@test.test",
@@ -84,35 +84,35 @@
"cdroms": {
"id": "srv-1/cdroms",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1/cdroms",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1/cdroms",
"items": []
},
"volumes": {
"id": "srv-1/volumes",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1/volumes",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1/volumes",
"items": [
{
"id": "d6688ced-700d-4c9c-a3a7-9f7170c5edc3",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/d6688ced-700d-4c9c-a3a7-9f7170c5edc3"
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/d6688ced-700d-4c9c-a3a7-9f7170c5edc3"
},
{
"id": "vol-2",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/vol-2"
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/vol-2"
},
{
"id": "bvol-1",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/bvol-1"
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/bvol-1"
}
]
},
"nics": {
"id": "srv-1/nics",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1/nics",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1/nics",
"items": []
}
}
@@ -120,7 +120,7 @@
{
"id": "s-3",
"type": "server",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3",
"metadata": {
"createdDate": "2016-10-17T11:33:20Z",
"createdBy": "test@test.test",
@@ -139,7 +139,7 @@
"bootVolume": {
"id": "21d7e7de-5054-4041-b691-717aa8b3c799",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/21d7e7de-5054-4041-b691-717aa8b3c799",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/21d7e7de-5054-4041-b691-717aa8b3c799",
"metadata": {
"createdDate": "2016-10-17T11:33:20Z",
"createdBy": "test@test.test",
@@ -175,30 +175,30 @@
"cdroms": {
"id": "s-3/cdroms",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/cdroms",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/cdroms",
"items": []
},
"volumes": {
"id": "s-3/volumes",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/volumes",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/volumes",
"items": [
{
"id": "21d7e7de-5054-4041-b691-717aa8b3c799",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/21d7e7de-5054-4041-b691-717aa8b3c799"
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/21d7e7de-5054-4041-b691-717aa8b3c799"
}
]
},
"nics": {
"id": "s-3/nics",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics",
"items": [
{
"id": "nic-1",
"type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-1"
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-1"
}
]
}
@@ -209,12 +209,12 @@
"volumes": {
"id": "dc-1/volumes",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes",
"items": [
{
"id": "vol-2",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/vol-2",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/vol-2",
"metadata": {
"createdDate": "2016-10-18T15:13:44Z",
"createdBy": "test@test.test",
@@ -249,7 +249,7 @@
{
"id": "bvol-1",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/bvol-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/bvol-1",
"metadata": {
"createdDate": "2016-10-18T07:20:41Z",
"createdBy": "test@test.test",
@@ -284,7 +284,7 @@
{
"id": "d6688ced-700d-4c9c-a3a7-9f7170c5edc3",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/d6688ced-700d-4c9c-a3a7-9f7170c5edc3",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/d6688ced-700d-4c9c-a3a7-9f7170c5edc3",
"metadata": {
"createdDate": "2016-10-17T13:13:36Z",
"createdBy": "test@test.test",
@@ -319,7 +319,7 @@
{
"id": "21d7e7de-5054-4041-b691-717aa8b3c799",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/21d7e7de-5054-4041-b691-717aa8b3c799",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/21d7e7de-5054-4041-b691-717aa8b3c799",
"metadata": {
"createdDate": "2016-10-17T11:33:20Z",
"createdBy": "test@test.test",
@@ -356,18 +356,18 @@
"loadbalancers": {
"id": "dc-1/loadbalancers",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/loadbalancers",
+ "href": "/cloudapi/v4/datacenters/dc-1/loadbalancers",
"items": []
},
"lans": {
"id": "dc-1/lans",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/lans",
+ "href": "/cloudapi/v4/datacenters/dc-1/lans",
"items": [
{
"id": "2",
"type": "lan",
- "href": "/cloudapi/v3/datacenters/dc-1/lans/2",
+ "href": "/cloudapi/v4/datacenters/dc-1/lans/2",
"metadata": {
"createdDate": "2016-10-17T18:19:43Z",
"createdBy": "test@test.test",
@@ -384,12 +384,12 @@
"nics": {
"id": "2/nics",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/lans/2/nics",
+ "href": "/cloudapi/v4/datacenters/dc-1/lans/2/nics",
"items": [
{
"id": "nic-1",
"type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-1"
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-1"
}
]
}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_describe_firewall_rule.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_describe_firewall_rule.json b/libcloud/test/compute/fixtures/profitbricks/ex_describe_firewall_rule.json
index 523245d..5573809 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_describe_firewall_rule.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_describe_firewall_rule.json
@@ -1,7 +1,7 @@
{
"id": "fw2",
"type": "firewall-rule",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-2/firewallrules/fw2",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-2/firewallrules/fw2",
"metadata": {
"createdDate": "2016-10-19T09:55:10Z",
"createdBy": "test@test.te",
@@ -11,14 +11,14 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "HTTPs (SSL)",
+ "name": "SSH",
"protocol": "TCP",
- "sourceMac": null,
+ "sourceMac": "01:23:45:67:89:00",
"sourceIp": null,
"targetIp": null,
"icmpCode": null,
"icmpType": null,
- "portRangeStart": 443,
- "portRangeEnd": 443
+ "portRangeStart": 22,
+ "portRangeEnd": 22
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_describe_image.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_describe_image.json b/libcloud/test/compute/fixtures/profitbricks/ex_describe_image.json
index a6977ac..bf3faf4 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_describe_image.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_describe_image.json
@@ -1,7 +1,7 @@
{
"id": "img-2",
"type": "image",
- "href": "/cloudapi/v3/images/img-2",
+ "href": "/cloudapi/v4/images/img-2",
"metadata": {
"createdDate": "2015-10-09T12:06:34Z",
"createdBy": "test@test.te",
@@ -13,7 +13,7 @@
"properties": {
"name": "vivid-server-cloudimg-amd64-disk1.img",
"description": null,
- "location": "de/fkb",
+ "location": "us/las",
"size": 2,
"cpuHotPlug": false,
"cpuHotUnplug": false,
@@ -27,6 +27,7 @@
"discScsiHotUnplug": false,
"licenceType": "UNKNOWN",
"imageType": "HDD",
+ "imageAliases": [ ],
"public": false
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_describe_ip_block.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_describe_ip_block.json b/libcloud/test/compute/fixtures/profitbricks/ex_describe_ip_block.json
index 63f59e5..1abab89 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_describe_ip_block.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_describe_ip_block.json
@@ -1,7 +1,7 @@
{
"id": "ipb-2",
"type": "ipblock",
- "href": "/cloudapi/v3/ipblocks/ipb-2",
+ "href": "/cloudapi/v4/ipblocks/ipb-2",
"metadata": {
"createdDate": "2016-10-26T15:05:12Z",
"createdBy": "test@test.te",
@@ -12,10 +12,11 @@
},
"properties": {
"ips": [
- "78.137.101.250"
+ "208.94.36.101",
+ "192.152.28.137"
],
- "location": "de/fkb",
- "size": 1,
- "name": "Test IP Block One"
+ "location": "us/las",
+ "size": 2,
+ "name": "libcloud Test"
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_describe_lan.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_describe_lan.json b/libcloud/test/compute/fixtures/profitbricks/ex_describe_lan.json
index 459a74e..f761295 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_describe_lan.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_describe_lan.json
@@ -1,7 +1,7 @@
{
"id" : "10",
"type" : "lan",
- "href" : "/cloudapi/v3/datacenters/dc-1/lans/10",
+ "href" : "/cloudapi/v4/datacenters/dc-1/lans/10",
"metadata" : {
"createdDate": "2016-10-17T11:33:11Z",
"createdBy": "test@test.te",
@@ -11,14 +11,14 @@
"state": "BUSY"
},
"properties" : {
- "name" : "Test Created Lan",
+ "name" : "libcloud Test",
"public" : true
},
"entities": {
"nics": {
"id": "10/nics",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/lans/10/nics"
+ "href": "/cloudapi/v4/datacenters/dc-1/lans/10/nics"
}
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_describe_load_balancer.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_describe_load_balancer.json b/libcloud/test/compute/fixtures/profitbricks/ex_describe_load_balancer.json
index bb26434..2ddd7d6 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_describe_load_balancer.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_describe_load_balancer.json
@@ -1,7 +1,7 @@
{
"id": "bal-1",
"type": "loadbalancer",
- "href": "/cloudapi/v3/datacenters/dc-2/loadbalancers/bal-1",
+ "href": "/cloudapi/v4/datacenters/dc-2/loadbalancers/bal-1",
"metadata": {
"createdDate": "2016-10-26T13:02:33Z",
"createdBy": "test@test.te",
@@ -11,7 +11,7 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Test One",
+ "name": "libcloud Test",
"ip": "111.112.113.114",
"dhcp": true
},
@@ -19,7 +19,7 @@
"balancednics": {
"id": "bal-1/balancednics",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-2/loadbalancers/bal-1/balancednics"
+ "href": "/cloudapi/v4/datacenters/dc-2/loadbalancers/bal-1/balancednics"
}
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_describe_location.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_describe_location.json b/libcloud/test/compute/fixtures/profitbricks/ex_describe_location.json
index 6cd6628..845c7ef 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_describe_location.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_describe_location.json
@@ -1,9 +1,9 @@
{
- "id": "de/fkb",
+ "id": "us/las",
"type": "location",
- "href": "/cloudapi/v3/locations/de/fkb",
+ "href": "/cloudapi/v4/locations/us/las",
"properties": {
- "name": "karlsruhe",
+ "name": "lasvegas",
"features": [
"SSD",
"MULTIPLE_CPU"
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_describe_network_interface.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_describe_network_interface.json b/libcloud/test/compute/fixtures/profitbricks/ex_describe_network_interface.json
index dedecce..3ff6585 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_describe_network_interface.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_describe_network_interface.json
@@ -1,7 +1,7 @@
{
"id": "nic-2",
"type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-2",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-2",
"metadata": {
"createdDate": "2016-10-17T15:46:38Z",
"createdBy": "test@test.te",
@@ -11,12 +11,12 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Updated from LibCloud",
+ "name": "libcloud Test",
"mac": "02:01:0b:9d:4d:ce",
"ips": [
"10.15.124.11"
],
- "dhcp": false,
+ "dhcp": true,
"lan": 2,
"firewallActive": true,
"nat": false
@@ -25,7 +25,7 @@
"firewallrules": {
"id": "nic-1/firewallrules",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-2/firewallrules"
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-2/firewallrules"
}
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_describe_node.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_describe_node.json b/libcloud/test/compute/fixtures/profitbricks/ex_describe_node.json
index 476a4b9..88e2b5f 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_describe_node.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_describe_node.json
@@ -1,7 +1,7 @@
{
"id": "srv-1",
"type": "server",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1",
"metadata": {
"createdDate": "2016-10-18T07:28:05Z",
"createdBy": "test@test.test",
@@ -11,16 +11,16 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "A test node",
- "cores": 2,
- "ram": 4096,
- "availabilityZone": "AUTO",
+ "name": "libcloud Test",
+ "cores": 1,
+ "ram": 1024,
+ "availabilityZone": "ZONE_1",
"vmState": "RUNNING",
"bootCdrom": null,
"bootVolume": {
"id": "bvol-1",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/bvol-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/bvol-1",
"metadata": {
"createdDate": "2016-10-18T07:20:41Z",
"createdBy": "test@test.test",
@@ -30,9 +30,9 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "A test node boot volume",
+ "name": "libcloud Test",
"type": "HDD",
- "size": 10,
+ "size": 2,
"image": "bvol-img",
"imagePassword": null,
"bus": "VIRTIO",
@@ -56,18 +56,18 @@
"cdroms": {
"id": "srv-1/cdroms",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1/cdroms",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1/cdroms",
"items": []
},
"volumes": {
"id": "srv-1/volumes",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1/volumes",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1/volumes",
"items": [
{
"id": "bvol-1",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/bvol-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/bvol-1",
"metadata": {
"createdDate": "2016-10-18T07:20:41Z",
"createdBy": "test@test.test",
@@ -77,9 +77,9 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "A test node volume",
+ "name": "libcloud Test",
"type": "HDD",
- "size": 10,
+ "size": 2,
"availabilityZone": "AUTO",
"image": "bvol-img",
"imagePassword": null,
@@ -104,7 +104,7 @@
"nics": {
"id": "srv-1/nics",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1/nics",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1/nics",
"items": []
}
}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_describe_snapshot.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_describe_snapshot.json b/libcloud/test/compute/fixtures/profitbricks/ex_describe_snapshot.json
index 06cce65..10a2f1c 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_describe_snapshot.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_describe_snapshot.json
@@ -1,7 +1,7 @@
{
"id": "sshot",
"type": "snapshot",
- "href": "/cloudapi/v3/snapshots/sshot",
+ "href": "/cloudapi/v4/snapshots/sshot",
"metadata": {
"createdDate": "2016-10-26T11:38:45Z",
"createdBy": "test@test.te",
@@ -11,8 +11,8 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Test Snapshot",
- "description": "Test Snapshot",
+ "name": "libcloud Test",
+ "description": "libcloud test snapshot",
"location": "us/las",
"size": 10,
"cpuHotPlug": true,
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_describe_volume.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_describe_volume.json b/libcloud/test/compute/fixtures/profitbricks/ex_describe_volume.json
index d0eab6a..732d8f9 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_describe_volume.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_describe_volume.json
@@ -1,7 +1,7 @@
{
"id": "vol-2",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/vol-2",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/vol-2",
"metadata": {
"createdDate": "2016-10-17T13:13:36Z",
"createdBy": "test@test.te",
@@ -11,15 +11,15 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Updated storage name",
+ "name": "libcloud Test",
"type": "HDD",
- "size": 40,
- "availabilityZone": "AUTO",
+ "size": 2,
+ "availabilityZone": "ZONE_3",
"image": "bvol-img",
"imagePassword": null,
"sshKeys": null,
"bus": "VIRTIO",
- "licenceType": "LINUX",
+ "licenceType": "UNKNOWN",
"cpuHotPlug": true,
"cpuHotUnplug": false,
"ramHotPlug": true,
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_list_attached_volumes.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_list_attached_volumes.json b/libcloud/test/compute/fixtures/profitbricks/ex_list_attached_volumes.json
index 6777ba3..c422c00 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_list_attached_volumes.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_list_attached_volumes.json
@@ -1,12 +1,12 @@
{
"id": "srv-1/volumes",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1/volumes",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1/volumes",
"items": [
{
"id": "d6688ced-700d-4c9c-a3a7-9f7170c5edc3",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/d6688ced-700d-4c9c-a3a7-9f7170c5edc3",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/d6688ced-700d-4c9c-a3a7-9f7170c5edc3",
"metadata": {
"createdDate": "2016-10-17T13:13:36Z",
"createdBy": "test@test.test",
@@ -16,15 +16,15 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Volume one",
+ "name": "libcloud Test",
"type": "HDD",
- "size": 40,
+ "size": 2,
"availabilityZone": "AUTO",
"image": "bvol-img",
"imagePassword": null,
"sshKeys": null,
"bus": "VIRTIO",
- "licenceType": "LINUX",
+ "licenceType": "UNKNOWN",
"cpuHotPlug": true,
"cpuHotUnplug": false,
"ramHotPlug": true,
@@ -35,48 +35,13 @@
"discVirtioHotUnplug": true,
"discScsiHotPlug": false,
"discScsiHotUnplug": false,
- "deviceNumber": 3
- }
- },
- {
- "id": "vol-2",
- "type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/vol-2",
- "metadata": {
- "createdDate": "2016-10-18T15:13:44Z",
- "createdBy": "test@test.test",
- "etag": "a96f7781920c2890c25f967e66e6ee91",
- "lastModifiedDate": "2016-10-18T15:13:44Z",
- "lastModifiedBy": "test@test.test",
- "state": "AVAILABLE"
- },
- "properties": {
- "name": "Volume two",
- "type": "HDD",
- "size": 10,
- "availabilityZone": "AUTO",
- "image": null,
- "imagePassword": null,
- "sshKeys": null,
- "bus": "VIRTIO",
- "licenceType": null,
- "cpuHotPlug": false,
- "cpuHotUnplug": false,
- "ramHotPlug": false,
- "ramHotUnplug": false,
- "nicHotPlug": false,
- "nicHotUnplug": false,
- "discVirtioHotPlug": false,
- "discVirtioHotUnplug": false,
- "discScsiHotPlug": false,
- "discScsiHotUnplug": false,
"deviceNumber": 2
}
},
{
"id": "bvol-1",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/bvol-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/bvol-1",
"metadata": {
"createdDate": "2016-10-18T07:20:41Z",
"createdBy": "test@test.test",
@@ -86,7 +51,7 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Volume three",
+ "name": "libcloud Test",
"type": "HDD",
"size": 10,
"availabilityZone": "AUTO",
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_list_datacenters.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_list_datacenters.json b/libcloud/test/compute/fixtures/profitbricks/ex_list_datacenters.json
index 912c0fc..d13ff6b 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_list_datacenters.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_list_datacenters.json
@@ -1,12 +1,12 @@
{
"id": "datacenters",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/",
+ "href": "/cloudapi/v4/datacenters/",
"items": [
{
"id": "dc-1",
"type": "datacenter",
- "href": "/cloudapi/v3/datacenters/dc-1",
+ "href": "/cloudapi/v4/datacenters/dc-1",
"metadata": {
"createdDate": "2016-10-14T07:24:59Z",
"createdBy": "test@test.test",
@@ -16,9 +16,9 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Test One.",
- "description": "A test data center",
- "location": "de/fra",
+ "name": "libcloud Test",
+ "description": "libcloud test datacenter",
+ "location": "us/las",
"version": 3,
"features": [
"SSD",
@@ -29,22 +29,22 @@
"servers": {
"id": "983a45be-a9aa-427a-8117-271ce9f392bb/servers",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers"
+ "href": "/cloudapi/v4/datacenters/dc-1/servers"
},
"volumes": {
"id": "983a45be-a9aa-427a-8117-271ce9f392bb/volumes",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes"
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes"
},
"loadbalancers": {
"id": "983a45be-a9aa-427a-8117-271ce9f392bb/loadbalancers",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/loadbalancers"
+ "href": "/cloudapi/v4/datacenters/dc-1/loadbalancers"
},
"lans": {
"id": "983a45be-a9aa-427a-8117-271ce9f392bb/lans",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/lans"
+ "href": "/cloudapi/v4/datacenters/dc-1/lans"
}
}
}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_list_firewall_rules.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_list_firewall_rules.json b/libcloud/test/compute/fixtures/profitbricks/ex_list_firewall_rules.json
index 7128877..bd31786 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_list_firewall_rules.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_list_firewall_rules.json
@@ -1,12 +1,12 @@
{
"id": "nic-2/firewallrules",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-2/firewallrules",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-2/firewallrules",
"items": [
{
"id": "fwr-1",
"type": "firewall-rule",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-2/firewallrules/fwr-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-2/firewallrules/fwr-1",
"metadata": {
"createdDate": "2016-10-19T11:08:10Z",
"createdBy": "test@test.te",
@@ -30,7 +30,7 @@
{
"id": "fw2",
"type": "firewall-rule",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-2/firewallrules/fw2",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-2/firewallrules/fw2",
"metadata": {
"createdDate": "2016-10-19T09:55:10Z",
"createdBy": "test@test.te",
@@ -54,7 +54,7 @@
{
"id": "6238b1e2-c706-4dc9-80a9-307fa0bd4287",
"type": "firewall-rule",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-2/firewallrules/6238b1e2-c706-4dc9-80a9-307fa0bd4287",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-2/firewallrules/6238b1e2-c706-4dc9-80a9-307fa0bd4287",
"metadata": {
"createdDate": "2016-10-19T09:55:10Z",
"createdBy": "test@test.te",
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_list_ip_blocks.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_list_ip_blocks.json b/libcloud/test/compute/fixtures/profitbricks/ex_list_ip_blocks.json
index df3c9cb..a935adb 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_list_ip_blocks.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_list_ip_blocks.json
@@ -1,12 +1,12 @@
{
"id": "ipblocks",
"type": "collection",
- "href": "/cloudapi/v3/ipblocks",
+ "href": "/cloudapi/v4/ipblocks",
"items": [
{
"id": "ipb-1",
"type": "ipblock",
- "href": "/cloudapi/v3/ipblocks/ipb-1",
+ "href": "/cloudapi/v4/ipblocks/ipb-1",
"metadata": {
"createdDate": "2016-10-26T15:05:36Z",
"createdBy": "test@test.te",
@@ -20,7 +20,7 @@
"78.137.101.252",
"78.137.101.251"
],
- "location": "de/fkb",
+ "location": "us/las",
"size": 2,
"name": "Test IP Block One"
}
@@ -28,7 +28,7 @@
{
"id": "ipb-2",
"type": "ipblock",
- "href": "/cloudapi/v3/ipblocks/ipb-2",
+ "href": "/cloudapi/v4/ipblocks/ipb-2",
"metadata": {
"createdDate": "2016-10-26T15:05:12Z",
"createdBy": "test@test.te",
@@ -41,7 +41,7 @@
"ips": [
"78.137.101.250"
],
- "location": "de/fkb",
+ "location": "us/las",
"size": 1,
"name": "Test IP Block One"
}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_list_lans.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_list_lans.json b/libcloud/test/compute/fixtures/profitbricks/ex_list_lans.json
index ede4187..5695388 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_list_lans.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_list_lans.json
@@ -1,12 +1,12 @@
{
"id": "dc-1/lans",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/lans",
+ "href": "/cloudapi/v4/datacenters/dc-1/lans",
"items": [
{
"id": "1",
"type": "lan",
- "href": "/cloudapi/v3/datacenters/dc-1/lans/1",
+ "href": "/cloudapi/v4/datacenters/dc-1/lans/1",
"metadata": {
"createdDate": "2016-10-24T08:03:22Z",
"createdBy": "test@test.te",
@@ -16,19 +16,19 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Switch for LAN 1",
+ "name": "libcloud Test",
"public": false
},
"entities": {
"nics": {
"id": "1/nics",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/lans/1/nics",
+ "href": "/cloudapi/v4/datacenters/dc-1/lans/1/nics",
"items": [
{
"id": "dc5e1c66-7280-4a5c-8e13-51ce030e0980",
"type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/d37abf6b-0980-4bf8-813b-b69863cf7b9e/nics/dc5e1c66-7280-4a5c-8e13-51ce030e0980",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/d37abf6b-0980-4bf8-813b-b69863cf7b9e/nics/dc5e1c66-7280-4a5c-8e13-51ce030e0980",
"metadata": {
"createdDate": "2016-10-21T13:00:02Z",
"createdBy": "test@test.te",
@@ -52,14 +52,14 @@
"firewallrules": {
"id": "dc5e1c66-7280-4a5c-8e13-51ce030e0980/firewallrules",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/d37abf6b-0980-4bf8-813b-b69863cf7b9e/nics/dc5e1c66-7280-4a5c-8e13-51ce030e0980/firewallrules"
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/d37abf6b-0980-4bf8-813b-b69863cf7b9e/nics/dc5e1c66-7280-4a5c-8e13-51ce030e0980/firewallrules"
}
}
},
{
"id": "912324a6-c057-445d-84dd-8fea82dfa719",
"type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/811ab72b-f7f3-427b-8220-f031eae34f63/nics/912324a6-c057-445d-84dd-8fea82dfa719",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/811ab72b-f7f3-427b-8220-f031eae34f63/nics/912324a6-c057-445d-84dd-8fea82dfa719",
"metadata": {
"createdDate": "2016-10-21T13:00:02Z",
"createdBy": "test@test.te",
@@ -83,14 +83,14 @@
"firewallrules": {
"id": "912324a6-c057-445d-84dd-8fea82dfa719/firewallrules",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/811ab72b-f7f3-427b-8220-f031eae34f63/nics/912324a6-c057-445d-84dd-8fea82dfa719/firewallrules"
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/811ab72b-f7f3-427b-8220-f031eae34f63/nics/912324a6-c057-445d-84dd-8fea82dfa719/firewallrules"
}
}
},
{
"id": "8d9fb87c-79f7-4c3c-8f7b-e2050a881b16",
"type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/b1a64861-5819-498a-899a-a57126050952/nics/8d9fb87c-79f7-4c3c-8f7b-e2050a881b16",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/b1a64861-5819-498a-899a-a57126050952/nics/8d9fb87c-79f7-4c3c-8f7b-e2050a881b16",
"metadata": {
"createdDate": "2016-10-21T13:00:02Z",
"createdBy": "test@test.te",
@@ -114,14 +114,14 @@
"firewallrules": {
"id": "8d9fb87c-79f7-4c3c-8f7b-e2050a881b16/firewallrules",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/b1a64861-5819-498a-899a-a57126050952/nics/8d9fb87c-79f7-4c3c-8f7b-e2050a881b16/firewallrules"
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/b1a64861-5819-498a-899a-a57126050952/nics/8d9fb87c-79f7-4c3c-8f7b-e2050a881b16/firewallrules"
}
}
},
{
"id": "76d7965d-19e5-491f-8b2f-1c4a3ef127b5",
"type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/77ef2301-b4df-46aa-8544-2dae76c9d7b5/nics/76d7965d-19e5-491f-8b2f-1c4a3ef127b5",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/77ef2301-b4df-46aa-8544-2dae76c9d7b5/nics/76d7965d-19e5-491f-8b2f-1c4a3ef127b5",
"metadata": {
"createdDate": "2016-10-21T13:00:02Z",
"createdBy": "test@test.te",
@@ -145,7 +145,7 @@
"firewallrules": {
"id": "76d7965d-19e5-491f-8b2f-1c4a3ef127b5/firewallrules",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/77ef2301-b4df-46aa-8544-2dae76c9d7b5/nics/76d7965d-19e5-491f-8b2f-1c4a3ef127b5/firewallrules"
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/77ef2301-b4df-46aa-8544-2dae76c9d7b5/nics/76d7965d-19e5-491f-8b2f-1c4a3ef127b5/firewallrules"
}
}
}
[04/10] libcloud git commit: merge from upstream 'trunk'
Posted by to...@apache.org.
merge from upstream 'trunk'
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/32178ac1
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/32178ac1
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/32178ac1
Branch: refs/heads/trunk
Commit: 32178ac10086e23615f15e64881475861e085d78
Parents: 01ce1d5
Author: nurfet-becirevic <nu...@stackpointcloud.com>
Authored: Mon Sep 4 09:18:39 2017 -0400
Committer: nurfet-becirevic <nu...@stackpointcloud.com>
Committed: Mon Sep 4 09:18:39 2017 -0400
----------------------------------------------------------------------
.gitignore | 6 ++
CHANGES.rst | 14 ++++
doap_libcloud.rdf | 7 ++
libcloud/__init__.py | 2 +-
libcloud/compute/drivers/ec2.py | 81 +++++++++++++++++---
libcloud/compute/drivers/libvirt_driver.py | 2 +-
.../ec2/describe_reserved_instances.xml | 1 +
libcloud/test/compute/test_ec2.py | 17 ++--
libcloud/test/conftest.py | 25 ++++++
9 files changed, 132 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/32178ac1/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index e5db6ec..36902da 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,3 +23,9 @@ apache_libcloud.egg-info/
.eggs/
.cache/
.vscode/
+.Python
+bin/
+include/
+lib/
+pip-selfcheck.json
+report.html
http://git-wip-us.apache.org/repos/asf/libcloud/blob/32178ac1/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index fc6aa72..75dbf52 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,6 +4,20 @@
Changes in current version of Apache Libcloud
---------------------------------------------
+Compute
+~~~~~~~
+
+- [EC2] add g3 instance types
+ [GITHUB-1101]
+ (@zulupro)
+
+- [EC2] add 'end' to ec2 reserved_node
+ [GITHUB-1099]
+ (@xofer)
+
+Changes in Apache Libcloud 2.2.0
+--------------------------------
+
Common
~~~~~~
http://git-wip-us.apache.org/repos/asf/libcloud/blob/32178ac1/doap_libcloud.rdf
----------------------------------------------------------------------
diff --git a/doap_libcloud.rdf b/doap_libcloud.rdf
index 2c8341c..815feed 100644
--- a/doap_libcloud.rdf
+++ b/doap_libcloud.rdf
@@ -364,6 +364,13 @@
<revision>v2.1.0</revision>
</Version>
</release>
+ <release>
+ <Version>
+ <name>2.2.0</name>
+ <created>2017-09-04</created>
+ <revision>v2.2.0</revision>
+ </Version>
+ </release>
<repository>
<SVNRepository>
<location rdf:resource="https://svn.apache.org/repos/asf/libcloud/trunk/"/>
http://git-wip-us.apache.org/repos/asf/libcloud/blob/32178ac1/libcloud/__init__.py
----------------------------------------------------------------------
diff --git a/libcloud/__init__.py b/libcloud/__init__.py
index bf2ef2d..24d4a68 100644
--- a/libcloud/__init__.py
+++ b/libcloud/__init__.py
@@ -36,7 +36,7 @@ __all__ = [
'__version__',
'enable_debug'
]
-__version__ = '2.1.0'
+__version__ = '2.2.0'
def enable_debug(fo):
http://git-wip-us.apache.org/repos/asf/libcloud/blob/32178ac1/libcloud/compute/drivers/ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/ec2.py b/libcloud/compute/drivers/ec2.py
index efb6275..126d362 100644
--- a/libcloud/compute/drivers/ec2.py
+++ b/libcloud/compute/drivers/ec2.py
@@ -322,6 +322,42 @@ INSTANCE_TYPES = {
'cpu': 32
}
},
+ 'g3.4xlarge': {
+ 'id': 'g3.4xlarge',
+ 'name': 'Cluster GPU G3 Four Extra Large Instance',
+ 'ram': GiB(122),
+ 'disk': 0, # EBS only
+ 'bandwidth': None,
+ 'extra': {
+ 'cpu': 16,
+ 'gpu': 1,
+ 'gpu_ram': GiB(8)
+ }
+ },
+ 'g3.8xlarge': {
+ 'id': 'g3.8xlarge',
+ 'name': 'Cluster GPU G3 Eight Extra Large Instance',
+ 'ram': GiB(244),
+ 'disk': 0, # EBS only
+ 'bandwidth': None,
+ 'extra': {
+ 'cpu': 32,
+ 'gpu': 2,
+ 'gpu_ram': GiB(16)
+ }
+ },
+ 'g3.16xlarge': {
+ 'id': 'g3.16xlarge',
+ 'name': 'Cluster GPU G3 16 Extra Large Instance',
+ 'ram': GiB(488),
+ 'disk': 0, # EBS only
+ 'bandwidth': None,
+ 'extra': {
+ 'cpu': 64,
+ 'gpu': 4,
+ 'gpu_ram': GiB(32)
+ }
+ },
'p2.xlarge': {
'id': 'p2.xlarge',
'name': 'Cluster GPU P2 Large Instance',
@@ -869,6 +905,9 @@ REGION_DETAILS = {
'cg1.4xlarge',
'g2.2xlarge',
'g2.8xlarge',
+ 'g3.4xlarge',
+ 'g3.8xlarge',
+ 'g3.16xlarge',
'cr1.8xlarge',
'hs1.8xlarge',
'i2.xlarge',
@@ -933,6 +972,9 @@ REGION_DETAILS = {
'c1.xlarge',
'g2.2xlarge',
'g2.8xlarge',
+ 'g3.4xlarge',
+ 'g3.8xlarge',
+ 'g3.16xlarge',
'c3.large',
'c3.xlarge',
'c3.2xlarge',
@@ -1012,6 +1054,9 @@ REGION_DETAILS = {
'cg1.4xlarge',
'g2.2xlarge',
'g2.8xlarge',
+ 'g3.4xlarge',
+ 'g3.8xlarge',
+ 'g3.16xlarge',
'cr1.8xlarge',
'hs1.8xlarge',
'i2.xlarge',
@@ -1076,6 +1121,9 @@ REGION_DETAILS = {
'c1.xlarge',
'g2.2xlarge',
'g2.8xlarge',
+ 'g3.4xlarge',
+ 'g3.8xlarge',
+ 'g3.16xlarge',
'p2.xlarge',
'p2.8xlarge',
'p2.16xlarge',
@@ -1153,6 +1201,9 @@ REGION_DETAILS = {
'c1.xlarge',
'g2.2xlarge',
'g2.8xlarge',
+ 'g3.4xlarge',
+ 'g3.8xlarge',
+ 'g3.16xlarge',
'c3.large',
'c3.xlarge',
'c3.2xlarge',
@@ -1747,6 +1798,7 @@ REGION_DETAILS = {
'x1.32xlarge'
]
},
+ # GovCloud Region
'us-gov-west-1': {
'endpoint': 'ec2.us-gov-west-1.amazonaws.com',
'api_name': 'ec2_us_govwest',
@@ -1775,6 +1827,9 @@ REGION_DETAILS = {
'c1.xlarge',
'g2.2xlarge',
'g2.8xlarge',
+ 'g3.4xlarge',
+ 'g3.8xlarge',
+ 'g3.16xlarge',
'c3.large',
'c3.xlarge',
'c3.2xlarge',
@@ -2765,6 +2820,10 @@ RESOURCE_EXTRA_ATTRIBUTES_MAP = {
'xpath': 'start',
'transform_func': str
},
+ 'end': {
+ 'xpath': 'end',
+ 'transform_func': str
+ },
'duration': {
'xpath': 'duration',
'transform_func': int
@@ -3765,19 +3824,23 @@ class BaseEC2NodeDriver(NodeDriver):
if subnet_id:
params['SubnetId'] = subnet_id
+ # Specify tags at instance creation time
+ tags = {'Name': kwargs['name']}
+ if 'ex_metadata' in kwargs:
+ tags.update(kwargs['ex_metadata'])
+ tagspec_root = 'TagSpecification.1.'
+ params[tagspec_root + 'ResourceType'] = 'instance'
+ tag_nr = 1
+ for k, v in tags.items():
+ tag_root = tagspec_root + 'Tag.%d.' % tag_nr
+ params[tag_root + 'Key'] = k
+ params[tag_root + 'Value'] = v
+ tag_nr += 1
+
object = self.connection.request(self.path, params=params).object
nodes = self._to_nodes(object, 'instancesSet/item')
for node in nodes:
- tags = {'Name': kwargs['name']}
- if 'ex_metadata' in kwargs:
- tags.update(kwargs['ex_metadata'])
-
- try:
- self.ex_create_tags(resource=node, tags=tags)
- except Exception:
- continue
-
node.name = kwargs['name']
node.extra.update({'tags': tags})
http://git-wip-us.apache.org/repos/asf/libcloud/blob/32178ac1/libcloud/compute/drivers/libvirt_driver.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/libvirt_driver.py b/libcloud/compute/drivers/libvirt_driver.py
index a914c5e..f2ccfc5 100644
--- a/libcloud/compute/drivers/libvirt_driver.py
+++ b/libcloud/compute/drivers/libvirt_driver.py
@@ -411,7 +411,7 @@ class LibvirtNodeDriver(NodeDriver):
Sets up the regexp for parsing out IP addresses from the 'ip neighbor'
command and pass it along to the parser function.
- :return: Dictionary from the parsing funtion
+ :return: Dictionary from the parsing function
:rtype: ``dict``
"""
ip_regex = re.compile('(.*?)\s+.*lladdr\s+(.*?)\s+')
http://git-wip-us.apache.org/repos/asf/libcloud/blob/32178ac1/libcloud/test/compute/fixtures/ec2/describe_reserved_instances.xml
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/ec2/describe_reserved_instances.xml b/libcloud/test/compute/fixtures/ec2/describe_reserved_instances.xml
index 29d7f3f..6c5ac71 100644
--- a/libcloud/test/compute/fixtures/ec2/describe_reserved_instances.xml
+++ b/libcloud/test/compute/fixtures/ec2/describe_reserved_instances.xml
@@ -6,6 +6,7 @@
<instanceType>t1.micro</instanceType>
<availabilityZone>us-east-1b</availabilityZone>
<start>2013-06-18T12:07:53.161Z</start>
+ <end>2014-06-18T12:07:53.161Z</end>
<duration>31536000</duration>
<fixedPrice>23.0</fixedPrice>
<usagePrice>0.012</usagePrice>
http://git-wip-us.apache.org/repos/asf/libcloud/blob/32178ac1/libcloud/test/compute/test_ec2.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_ec2.py b/libcloud/test/compute/test_ec2.py
index 2766fc7..3209ac4 100644
--- a/libcloud/test/compute/test_ec2.py
+++ b/libcloud/test/compute/test_ec2.py
@@ -282,6 +282,7 @@ class EC2Tests(LibcloudTestCase, TestCaseMixin):
self.assertEqual(node.extra['instance_type'], 't1.micro')
self.assertEqual(node.extra['availability'], 'us-east-1b')
self.assertEqual(node.extra['start'], '2013-06-18T12:07:53.161Z')
+ self.assertEqual(node.extra['end'], '2014-06-18T12:07:53.161Z')
self.assertEqual(node.extra['duration'], 31536000)
self.assertEqual(node.extra['usage_price'], 0.012)
self.assertEqual(node.extra['fixed_price'], 23.0)
@@ -444,21 +445,21 @@ class EC2Tests(LibcloudTestCase, TestCaseMixin):
self.assertTrue('m2.4xlarge' in ids)
if region_name == 'us-east-1':
- self.assertEqual(len(sizes), 67)
+ self.assertEqual(len(sizes), 70)
self.assertTrue('cg1.4xlarge' in ids)
self.assertTrue('cc2.8xlarge' in ids)
self.assertTrue('cr1.8xlarge' in ids)
self.assertTrue('x1.32xlarge' in ids)
elif region_name == 'us-west-1':
- self.assertEqual(len(sizes), 58)
+ self.assertEqual(len(sizes), 61)
if region_name == 'us-west-2':
- self.assertEqual(len(sizes), 68)
+ self.assertEqual(len(sizes), 71)
elif region_name == 'ap-southeast-1':
self.assertEqual(len(sizes), 57)
elif region_name == 'ap-southeast-2':
self.assertEqual(len(sizes), 61)
elif region_name == 'eu-west-1':
- self.assertEqual(len(sizes), 65)
+ self.assertEqual(len(sizes), 68)
elif region_name == 'ap-south-1':
self.assertEqual(len(sizes), 41)
@@ -1526,10 +1527,6 @@ class EC2MockHttp(MockHttp):
body = self.fixtures.load('modify_snapshot_attribute.xml')
return (httplib.OK, body, {}, httplib.responses[httplib.OK])
- def _idempotent_CreateTags(self, method, url, body, headers):
- body = self.fixtures.load('create_tags.xml')
- return (httplib.OK, body, {}, httplib.responses[httplib.OK])
-
def _CreateVolume(self, method, url, body, headers):
body = self.fixtures.load('create_volume.xml')
return (httplib.OK, body, {}, httplib.responses[httplib.OK])
@@ -1741,10 +1738,6 @@ class EucMockHttp(EC2MockHttp):
headers):
return self._RunInstances(method, url, body, headers)
- def _services_Eucalyptus_CreateTags(self, method, url, body,
- headers):
- return self._CreateTags(method, url, body, headers)
-
def _services_Eucalyptus_DescribeInstanceTypes(self, method, url, body,
headers):
body = self.fixtures.load('describe_instance_types.xml')
http://git-wip-us.apache.org/repos/asf/libcloud/blob/32178ac1/libcloud/test/conftest.py
----------------------------------------------------------------------
diff --git a/libcloud/test/conftest.py b/libcloud/test/conftest.py
new file mode 100644
index 0000000..505c570
--- /dev/null
+++ b/libcloud/test/conftest.py
@@ -0,0 +1,25 @@
+import os.path
+import pytest
+
+
+def pytest_configure(config):
+ """Check that secrets.py is valid"""
+
+ this_dir = os.path.abspath(os.path.split(__file__)[0])
+ secrets_current = os.path.join(this_dir, 'secrets.py')
+ secrets_dist = os.path.join(this_dir, 'secrets.py-dist')
+
+ if not os.path.isfile(secrets_current):
+ print("Missing " + secrets_current)
+ print("Maybe you forgot to copy it from -dist:")
+ print("cp libcloud/test/secrets.py-dist libcloud/test/secrets.py")
+ pytest.exit('')
+
+ mtime_current = os.path.getmtime(secrets_current)
+ mtime_dist = os.path.getmtime(secrets_dist)
+
+ if mtime_dist > mtime_current:
+ print("It looks like test/secrets.py file is out of date.")
+ print("Please copy the new secrets.py-dist file over otherwise" +
+ " tests might fail")
+ pytest.exit('')
[08/10] libcloud git commit: Add changelog entry.
Posted by to...@apache.org.
Add changelog entry.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/0afdda28
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/0afdda28
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/0afdda28
Branch: refs/heads/trunk
Commit: 0afdda28d70f63343c7fda263876f87d6f93e4f0
Parents: 5965146
Author: Tomaz Muraus <to...@tomaz.me>
Authored: Thu Sep 21 23:23:02 2017 +0200
Committer: Tomaz Muraus <to...@tomaz.me>
Committed: Thu Sep 21 23:23:02 2017 +0200
----------------------------------------------------------------------
CHANGES.rst | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/0afdda28/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index d5fbe76..875bfc5 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -7,6 +7,9 @@ Changes in Apach Libcloud in development
- [EC2] Add new x1.16xlarge and x1e.32xlarge instance type. (GITHUB-1101)
[@zulupro]
+- [EC2] Update pricing information for EC2 instances.
+ [Tomaz Muraus]
+
Changes in Apache Libcloud 2.2.1
--------------------------------
[05/10] libcloud git commit: fix flake8 linting
Posted by to...@apache.org.
fix flake8 linting
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/85de9c19
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/85de9c19
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/85de9c19
Branch: refs/heads/trunk
Commit: 85de9c1967dc8b98939265f8f92440f08f4910eb
Parents: 32178ac
Author: nurfet-becirevic <nu...@stackpointcloud.com>
Authored: Tue Sep 5 13:35:11 2017 +0200
Committer: nurfet-becirevic <nu...@stackpointcloud.com>
Committed: Tue Sep 5 13:35:11 2017 +0200
----------------------------------------------------------------------
libcloud/compute/drivers/profitbricks.py | 1 -
libcloud/test/compute/test_profitbricks.py | 3 +--
2 files changed, 1 insertion(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/85de9c19/libcloud/compute/drivers/profitbricks.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/profitbricks.py b/libcloud/compute/drivers/profitbricks.py
index f2d44cb..b310f09 100644
--- a/libcloud/compute/drivers/profitbricks.py
+++ b/libcloud/compute/drivers/profitbricks.py
@@ -26,7 +26,6 @@ from libcloud.compute.providers import Provider
from libcloud.common.base import ConnectionUserAndKey, JsonResponse
from libcloud.compute.base import Node, NodeDriver, NodeLocation, NodeSize
from libcloud.compute.base import NodeImage, StorageVolume, VolumeSnapshot
-from libcloud.compute.base import NodeAuthPassword, NodeAuthSSHKey
from libcloud.compute.base import UuidMixin
from libcloud.compute.types import NodeState
from libcloud.common.types import LibcloudError, MalformedResponseError
http://git-wip-us.apache.org/repos/asf/libcloud/blob/85de9c19/libcloud/test/compute/test_profitbricks.py
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/test_profitbricks.py b/libcloud/test/compute/test_profitbricks.py
index da79b26..0ece89d 100644
--- a/libcloud/test/compute/test_profitbricks.py
+++ b/libcloud/test/compute/test_profitbricks.py
@@ -1194,7 +1194,6 @@ class ProfitBricksTests(unittest.TestCase):
)
self.assertIn('Resource does not exist', cm.exception.message.value)
-
def _verify_node(self, node):
extra = node.extra
@@ -3008,7 +3007,7 @@ class ProfitBricksTests(unittest.TestCase):
22
)
- def test_ex_create_network_interface_failure(self):
+ def test_ex_create_firewall_rule_failure(self):
with self.assertRaises(AttributeError):
'Raises attribute error if no network interface'
self.driver.ex_create_firewall_rule(
[02/10] libcloud git commit: ProfitBricks provider API v4 update;
fix & update tests and docs
Posted by to...@apache.org.
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_list_load_balanced_nics.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_list_load_balanced_nics.json b/libcloud/test/compute/fixtures/profitbricks/ex_list_load_balanced_nics.json
index bdd7ec3..348b521 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_list_load_balanced_nics.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_list_load_balanced_nics.json
@@ -1,12 +1,12 @@
{
"id": "s-3/nics",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics",
"items": [
{
"id": "nic-1",
"type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-1",
"metadata": {
"createdDate": "2016-10-17T15:46:38Z",
"createdBy": "test@test.te",
@@ -16,7 +16,7 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Test network interface",
+ "name": "libcloud Test",
"mac": "02:01:0b:9d:4d:ce",
"ips": [
"10.15.124.11"
@@ -30,14 +30,14 @@
"firewallrules": {
"id": "nic-1/firewallrules",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-1/firewallrules"
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-1/firewallrules"
}
}
},
{
"id": "8f7ea845-cf40-49c8-9e93-68366f31d605",
"type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/8f7ea845-cf40-49c8-9e93-68366f31d605",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/8f7ea845-cf40-49c8-9e93-68366f31d605",
"metadata": {
"createdDate": "2016-10-17T16:46:38Z",
"createdBy": "test@test.te",
@@ -61,7 +61,7 @@
"firewallrules": {
"id": "8f7ea845-cf40-49c8-9e93-68366f31d605/firewallrules",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-1/firewallrules"
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-1/firewallrules"
}
}
}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_list_load_balancers.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_list_load_balancers.json b/libcloud/test/compute/fixtures/profitbricks/ex_list_load_balancers.json
index ffb3ef0..f1d0cd1 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_list_load_balancers.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_list_load_balancers.json
@@ -1,12 +1,12 @@
{
"id": "dc-2/loadbalancers",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-2/loadbalancers",
+ "href": "/cloudapi/v4/datacenters/dc-2/loadbalancers",
"items": [
{
"id": "bal-1",
"type": "loadbalancer",
- "href": "/cloudapi/v3/datacenters/dc-2/loadbalancers/bal-1",
+ "href": "/cloudapi/v4/datacenters/dc-2/loadbalancers/bal-1",
"metadata": {
"createdDate": "2016-10-26T13:02:33Z",
"createdBy": "test@test.te",
@@ -24,12 +24,12 @@
"balancednics": {
"id": "bal-1/balancednics",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-2/loadbalancers/bal-1/balancednics",
+ "href": "/cloudapi/v4/datacenters/dc-2/loadbalancers/bal-1/balancednics",
"items": [
{
"id": "68e3bd55-55a1-4fa0-8903-8c3cf23ee30a",
"type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-2/servers/92445f57-5378-4a5b-8b53-f0f36fb8e6ad/nics/68e3bd55-55a1-4fa0-8903-8c3cf23ee30a",
+ "href": "/cloudapi/v4/datacenters/dc-2/servers/92445f57-5378-4a5b-8b53-f0f36fb8e6ad/nics/68e3bd55-55a1-4fa0-8903-8c3cf23ee30a",
"metadata": {
"createdDate": "2016-10-26T13:02:33Z",
"createdBy": "test@test.te",
@@ -53,7 +53,7 @@
"firewallrules": {
"id": "68e3bd55-55a1-4fa0-8903-8c3cf23ee30a/firewallrules",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-2/servers/92445f57-5378-4a5b-8b53-f0f36fb8e6ad/nics/68e3bd55-55a1-4fa0-8903-8c3cf23ee30a/firewallrules"
+ "href": "/cloudapi/v4/datacenters/dc-2/servers/92445f57-5378-4a5b-8b53-f0f36fb8e6ad/nics/68e3bd55-55a1-4fa0-8903-8c3cf23ee30a/firewallrules"
}
}
}
@@ -64,7 +64,7 @@
{
"id": "24d24a20-1161-4870-8b49-434622a18875",
"type": "loadbalancer",
- "href": "/cloudapi/v3/datacenters/dc-2/loadbalancers/24d24a20-1161-4870-8b49-434622a18875",
+ "href": "/cloudapi/v4/datacenters/dc-2/loadbalancers/24d24a20-1161-4870-8b49-434622a18875",
"metadata": {
"createdDate": "2016-10-26T13:02:33Z",
"createdBy": "test@test.te",
@@ -82,12 +82,12 @@
"balancednics": {
"id": "24d24a20-1161-4870-8b49-434622a18875/balancednics",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-2/loadbalancers/24d24a20-1161-4870-8b49-434622a18875/balancednics",
+ "href": "/cloudapi/v4/datacenters/dc-2/loadbalancers/24d24a20-1161-4870-8b49-434622a18875/balancednics",
"items": [
{
"id": "0485e083-3461-447a-8c5a-392be3c76473",
"type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-2/servers/7571b2d9-312a-45be-8d68-58c269c3911c/nics/0485e083-3461-447a-8c5a-392be3c76473",
+ "href": "/cloudapi/v4/datacenters/dc-2/servers/7571b2d9-312a-45be-8d68-58c269c3911c/nics/0485e083-3461-447a-8c5a-392be3c76473",
"metadata": {
"createdDate": "2016-10-25T08:49:48Z",
"createdBy": "test@test.te",
@@ -111,14 +111,14 @@
"firewallrules": {
"id": "0485e083-3461-447a-8c5a-392be3c76473/firewallrules",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-2/servers/7571b2d9-312a-45be-8d68-58c269c3911c/nics/0485e083-3461-447a-8c5a-392be3c76473/firewallrules"
+ "href": "/cloudapi/v4/datacenters/dc-2/servers/7571b2d9-312a-45be-8d68-58c269c3911c/nics/0485e083-3461-447a-8c5a-392be3c76473/firewallrules"
}
}
},
{
"id": "2e9c54f4-85c0-4d10-8369-cf5e3a6e7b68",
"type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-2/servers/ff3b523c-21bd-453d-80a3-c2bcdae1f509/nics/2e9c54f4-85c0-4d10-8369-cf5e3a6e7b68",
+ "href": "/cloudapi/v4/datacenters/dc-2/servers/ff3b523c-21bd-453d-80a3-c2bcdae1f509/nics/2e9c54f4-85c0-4d10-8369-cf5e3a6e7b68",
"metadata": {
"createdDate": "2016-10-25T14:01:03Z",
"createdBy": "test@test.te",
@@ -142,14 +142,14 @@
"firewallrules": {
"id": "2e9c54f4-85c0-4d10-8369-cf5e3a6e7b68/firewallrules",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-2/servers/ff3b523c-21bd-453d-80a3-c2bcdae1f509/nics/2e9c54f4-85c0-4d10-8369-cf5e3a6e7b68/firewallrules"
+ "href": "/cloudapi/v4/datacenters/dc-2/servers/ff3b523c-21bd-453d-80a3-c2bcdae1f509/nics/2e9c54f4-85c0-4d10-8369-cf5e3a6e7b68/firewallrules"
}
}
},
{
"id": "707d7aa4-8311-4a61-82a4-a80333e9ecc2",
"type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-2/servers/2e77a9cc-2338-43e6-84bf-e4c2ff9be265/nics/707d7aa4-8311-4a61-82a4-a80333e9ecc2",
+ "href": "/cloudapi/v4/datacenters/dc-2/servers/2e77a9cc-2338-43e6-84bf-e4c2ff9be265/nics/707d7aa4-8311-4a61-82a4-a80333e9ecc2",
"metadata": {
"createdDate": "2016-10-25T15:36:06Z",
"createdBy": "test@test.te",
@@ -173,14 +173,14 @@
"firewallrules": {
"id": "707d7aa4-8311-4a61-82a4-a80333e9ecc2/firewallrules",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-2/servers/2e77a9cc-2338-43e6-84bf-e4c2ff9be265/nics/707d7aa4-8311-4a61-82a4-a80333e9ecc2/firewallrules"
+ "href": "/cloudapi/v4/datacenters/dc-2/servers/2e77a9cc-2338-43e6-84bf-e4c2ff9be265/nics/707d7aa4-8311-4a61-82a4-a80333e9ecc2/firewallrules"
}
}
},
{
"id": "710f6842-440d-4fdc-878e-0c329037d4a9",
"type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-2/servers/fc0f7e86-a7de-4cee-84b5-409cc8b89ad2/nics/710f6842-440d-4fdc-878e-0c329037d4a9",
+ "href": "/cloudapi/v4/datacenters/dc-2/servers/fc0f7e86-a7de-4cee-84b5-409cc8b89ad2/nics/710f6842-440d-4fdc-878e-0c329037d4a9",
"metadata": {
"createdDate": "2016-10-25T14:01:03Z",
"createdBy": "test@test.te",
@@ -204,7 +204,7 @@
"firewallrules": {
"id": "710f6842-440d-4fdc-878e-0c329037d4a9/firewallrules",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-2/servers/fc0f7e86-a7de-4cee-84b5-409cc8b89ad2/nics/710f6842-440d-4fdc-878e-0c329037d4a9/firewallrules"
+ "href": "/cloudapi/v4/datacenters/dc-2/servers/fc0f7e86-a7de-4cee-84b5-409cc8b89ad2/nics/710f6842-440d-4fdc-878e-0c329037d4a9/firewallrules"
}
}
}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_list_network_interfaces.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_list_network_interfaces.json b/libcloud/test/compute/fixtures/profitbricks/ex_list_network_interfaces.json
index bdd7ec3..d183111 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_list_network_interfaces.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_list_network_interfaces.json
@@ -1,12 +1,12 @@
{
"id": "s-3/nics",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics",
"items": [
{
"id": "nic-1",
"type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-1",
"metadata": {
"createdDate": "2016-10-17T15:46:38Z",
"createdBy": "test@test.te",
@@ -16,7 +16,7 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Test network interface",
+ "name": "libcloud Test",
"mac": "02:01:0b:9d:4d:ce",
"ips": [
"10.15.124.11"
@@ -30,14 +30,14 @@
"firewallrules": {
"id": "nic-1/firewallrules",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-1/firewallrules"
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-1/firewallrules"
}
}
},
{
"id": "8f7ea845-cf40-49c8-9e93-68366f31d605",
"type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/8f7ea845-cf40-49c8-9e93-68366f31d605",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/8f7ea845-cf40-49c8-9e93-68366f31d605",
"metadata": {
"createdDate": "2016-10-17T16:46:38Z",
"createdBy": "test@test.te",
@@ -47,7 +47,7 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Another test network interface",
+ "name": "libcloud Test",
"mac": "02:01:0b:9d:4d:dd",
"ips": [
"10.15.124.12"
@@ -61,7 +61,7 @@
"firewallrules": {
"id": "8f7ea845-cf40-49c8-9e93-68366f31d605/firewallrules",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-1/firewallrules"
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-1/firewallrules"
}
}
}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_rename_datacenter.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_rename_datacenter.json b/libcloud/test/compute/fixtures/profitbricks/ex_rename_datacenter.json
index bfb2d5b..75d625e 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_rename_datacenter.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_rename_datacenter.json
@@ -1,7 +1,7 @@
{
"id": "dc-1",
"type": "datacenter",
- "href": "/cloudapi/v3/datacenters/dc-1",
+ "href": "/cloudapi/v4/datacenters/dc-1",
"metadata" : {
"createdDate": "2016-10-17T11:33:11Z",
"createdBy": "test@test.test",
@@ -11,9 +11,9 @@
"state" : "BUSY"
},
"properties" : {
- "name": "Test Data Center",
- "description": "This is a test data center.",
- "location": "de/fkb",
+ "name": "libcloud Test - RENAME",
+ "description": "libcloud test datacenter",
+ "location": "us/las",
"version": 35,
"features": [
"SSD",
@@ -24,23 +24,23 @@
"servers" : {
"id": "dc-1/servers",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers"
+ "href": "/cloudapi/v4/datacenters/dc-1/servers"
},
"volumes" : {
"id": "dc-1/volumes",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes"
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes"
},
"loadbalancers" : {
"id": "dc-1/loadbalancers",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/loadbalancers",
+ "href": "/cloudapi/v4/datacenters/dc-1/loadbalancers",
"items": []
},
"lans" : {
"id": "dc-1/lans",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/lans"
+ "href": "/cloudapi/v4/datacenters/dc-1/lans"
}
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_set_inet_access.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_set_inet_access.json b/libcloud/test/compute/fixtures/profitbricks/ex_set_inet_access.json
deleted file mode 100644
index badfd0a..0000000
--- a/libcloud/test/compute/fixtures/profitbricks/ex_set_inet_access.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "id": "nic-2",
- "type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-2",
- "metadata": {
- "createdDate": "2016-10-19T08:18:55Z",
- "createdBy": "test@test.te",
- "etag": "56f8d8bbdc84faad4188f647a49a565b",
- "lastModifiedDate": "2016-10-19T09:44:59Z",
- "lastModifiedBy": "test@test.te",
- "state": "BUSY"
- },
- "properties": {
- "name": "Updated from LibCloud",
- "mac": "02:01:68:c1:e8:88",
- "ips": [
- "11.12.13.14"
- ],
- "dhcp": true,
- "lan": 1,
- "firewallActive": false,
- "nat": false
- },
- "entities": {
- "firewallrules": {
- "id": "nic-2/firewallrules",
- "type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-2/firewallrules"
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_update_firewall_rule.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_update_firewall_rule.json b/libcloud/test/compute/fixtures/profitbricks/ex_update_firewall_rule.json
index f6d13ef..4deeaa2 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_update_firewall_rule.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_update_firewall_rule.json
@@ -1,7 +1,7 @@
{
"id": "fw2",
"type": "firewall-rule",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-2/firewallrules/fw2",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-2/firewallrules/fw2",
"metadata": {
"createdDate": "2016-10-19T09:55:10Z",
"createdBy": "test@test.te",
@@ -11,15 +11,15 @@
"state": "BUSY"
},
"properties": {
- "name": "HTTPs (SSL)",
+ "name": "SSH - RENAME",
"protocol": "TCP",
- "sourceMac": null,
+ "sourceMac": "01:23:45:67:89:00",
"sourceIp": null,
"targetIp": null,
"icmpCode": null,
"icmpType": null,
- "portRangeStart": 443,
- "portRangeEnd": 443
+ "portRangeStart": 22,
+ "portRangeEnd": 22
}
}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_update_image.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_update_image.json b/libcloud/test/compute/fixtures/profitbricks/ex_update_image.json
index 32db4ce..38eda31 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_update_image.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_update_image.json
@@ -1,7 +1,7 @@
{
"id": "img-2",
"type": "image",
- "href": "/cloudapi/v3/images/img-2",
+ "href": "/cloudapi/v4/images/img-2",
"metadata": {
"createdDate": "2015-10-09T12:06:34Z",
"createdBy": "test@test.te",
@@ -13,7 +13,7 @@
"properties": {
"name": "my-updated-image.img",
"description": null,
- "location": "de/fkb",
+ "location": "us/las",
"size": 2,
"cpuHotPlug": false,
"cpuHotUnplug": false,
@@ -27,6 +27,7 @@
"discScsiHotUnplug": false,
"licenceType": "UNKNOWN",
"imageType": "HDD",
+ "imageAliases": [ ],
"public": false
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_update_lan.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_update_lan.json b/libcloud/test/compute/fixtures/profitbricks/ex_update_lan.json
index 27b841d..eb8421b 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_update_lan.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_update_lan.json
@@ -1,7 +1,7 @@
{
"id" : "10",
"type" : "lan",
- "href" : "/cloudapi/v3/datacenters/dc-1/lans/10",
+ "href" : "/cloudapi/v4/datacenters/dc-1/lans/10",
"metadata" : {
"createdDate": "2016-10-17T11:33:11Z",
"createdBy": "test@test.te",
@@ -11,14 +11,14 @@
"state": "BUSY"
},
"properties" : {
- "name" : "Test Updated Lan",
- "public" : true
+ "name" : "libcloud Test - RENAME",
+ "public" : false
},
"entities": {
"nics": {
"id": "10/nics",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/lans/10/nics"
+ "href": "/cloudapi/v4/datacenters/dc-1/lans/10/nics"
}
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_update_load_balancer.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_update_load_balancer.json b/libcloud/test/compute/fixtures/profitbricks/ex_update_load_balancer.json
index 0705e68..c4b4a24 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_update_load_balancer.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_update_load_balancer.json
@@ -1,7 +1,7 @@
{
"id": "bal-1",
"type": "loadbalancer",
- "href": "/cloudapi/v3/datacenters/dc-1/loadbalancers/bal-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/loadbalancers/bal-1",
"metadata": {
"createdDate": "2019-10-26T13:02:33Z",
"createdBy": "test@test.te",
@@ -11,8 +11,8 @@
"state": "BUSY"
},
"properties": {
- "name": "Updated Load Balancer",
+ "name": "libcloud Test - RENAME",
"ip": "123.124.125.126",
- "dhcp": false
+ "dhcp": true
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_update_network_interface.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_update_network_interface.json b/libcloud/test/compute/fixtures/profitbricks/ex_update_network_interface.json
index d0fb880..12f0d57 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_update_network_interface.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_update_network_interface.json
@@ -1,31 +1,31 @@
{
- "id": "nic-1",
+ "id": "nic-2",
"type": "nic",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-2",
"metadata": {
- "createdDate": "2016-10-17T15:46:38Z",
+ "createdDate": "2016-10-19T08:18:55Z",
"createdBy": "test@test.te",
- "etag": "23dd052b608b59be38cef62765af7039",
- "lastModifiedDate": "2016-10-19T09:29:00Z",
+ "etag": "56f8d8bbdc84faad4188f647a49a565b",
+ "lastModifiedDate": "2016-10-19T09:44:59Z",
"lastModifiedBy": "test@test.te",
"state": "BUSY"
},
"properties": {
- "name": "Updated from LibCloud",
- "mac": "02:01:0b:9d:4d:ce",
+ "name": "libcloud Test - RENAME",
+ "mac": "02:01:68:c1:e8:88",
"ips": [
- "10.15.124.11"
+ "11.12.13.14"
],
"dhcp": true,
"lan": 1,
- "firewallActive": true,
+ "firewallActive": false,
"nat": false
},
"entities": {
"firewallrules": {
- "id": "nic-1/firewallrules",
+ "id": "nic-2/firewallrules",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/s-3/nics/nic-1/firewallrules"
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/s-3/nics/nic-2/firewallrules"
}
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_update_node.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_update_node.json b/libcloud/test/compute/fixtures/profitbricks/ex_update_node.json
index 6df459d..76c189a 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_update_node.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_update_node.json
@@ -1,7 +1,7 @@
{
"id": "srv-1",
"type": "server",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1",
"metadata" : {
"createdDate": "2016-10-18T07:28:05Z",
"createdBy": "test@test.test",
@@ -11,17 +11,17 @@
"state" : "BUSY"
},
"properties" : {
- "name" : "A test node",
+ "name" : "libcloud Test RENAME",
"cores" : 1,
- "ram" : 512,
+ "ram" : 1024,
"bootCdrom" : null,
- "availabilityZone": "AUTO",
+ "availabilityZone": "ZONE_1",
"vmState": "RUNNING",
"bootCdrom": null,
"bootVolume": {
"id": "bvol-1",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/bvol-1"
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/bvol-1"
},
"cpuFamily" : "AMD_OPTERON"
},
@@ -29,17 +29,17 @@
"cdroms": {
"id": "srv-1/cdroms",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1/cdroms"
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1/cdroms"
},
"volumes": {
"id": "srv-1/volumes",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1/volumes"
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1/volumes"
},
"nics": {
"id": "srv-1/nics",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1/nics"
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1/nics"
}
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_update_snapshot.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_update_snapshot.json b/libcloud/test/compute/fixtures/profitbricks/ex_update_snapshot.json
index f37024e..829825a 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_update_snapshot.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_update_snapshot.json
@@ -1,7 +1,7 @@
{
"id": "sshot",
"type": "snapshot",
- "href": "/cloudapi/v3/snapshots/sshot",
+ "href": "/cloudapi/v4/snapshots/sshot",
"metadata": {
"createdDate": "2016-10-26T11:38:45Z",
"createdBy": "test@test.te",
@@ -11,8 +11,8 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Updated snapshot",
- "description": "Updated snapshot",
+ "name": "libcloud Test - RENAME",
+ "description": "libcloud test snapshot - RENAME",
"location": "us/las",
"size": 10,
"cpuHotPlug": true,
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/ex_update_volume.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/ex_update_volume.json b/libcloud/test/compute/fixtures/profitbricks/ex_update_volume.json
index d0eab6a..19753b1 100644
--- a/libcloud/test/compute/fixtures/profitbricks/ex_update_volume.json
+++ b/libcloud/test/compute/fixtures/profitbricks/ex_update_volume.json
@@ -1,7 +1,7 @@
{
"id": "vol-2",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/vol-2",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/vol-2",
"metadata": {
"createdDate": "2016-10-17T13:13:36Z",
"createdBy": "test@test.te",
@@ -11,15 +11,15 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Updated storage name",
+ "name": "libcloud Test - RENAME",
"type": "HDD",
- "size": 40,
- "availabilityZone": "AUTO",
+ "size": 5,
+ "availabilityZone": "ZONE_3",
"image": "bvol-img",
"imagePassword": null,
"sshKeys": null,
"bus": "VIRTIO",
- "licenceType": "LINUX",
+ "licenceType": "UNKNOWN",
"cpuHotPlug": true,
"cpuHotUnplug": false,
"ramHotPlug": true,
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/list_images.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/list_images.json b/libcloud/test/compute/fixtures/profitbricks/list_images.json
index f7d718c..997beed 100644
--- a/libcloud/test/compute/fixtures/profitbricks/list_images.json
+++ b/libcloud/test/compute/fixtures/profitbricks/list_images.json
@@ -1,12 +1,12 @@
{
"id": "images",
"type": "collection",
- "href": "/cloudapi/v3/images",
+ "href": "/cloudapi/v4/images",
"items": [
{
"id": "img-2",
"type": "image",
- "href": "/cloudapi/v3/images/img-2",
+ "href": "/cloudapi/v4/images/img-2",
"metadata": {
"createdDate": "2016-06-02T11:33:49Z",
"createdBy": "System",
@@ -32,13 +32,14 @@
"discScsiHotUnplug": false,
"licenceType": "LINUX",
"imageType": "CDROM",
+ "imageAliases": [ ],
"public": false
}
},
{
"id": "img-1",
"type": "image",
- "href": "/cloudapi/v3/images/img-1",
+ "href": "/cloudapi/v4/images/img-1",
"metadata": {
"createdDate": "2014-11-14T15:22:19Z",
"createdBy": "System",
@@ -64,13 +65,14 @@
"discScsiHotUnplug": false,
"licenceType": "OTHER",
"imageType": "CDROM",
+ "imageAliases": [ ],
"public": true
}
},
{
"id": "62c525d9-b2cf-11e5-afa0-52540066fee9",
"type": "image",
- "href": "/cloudapi/v3/images/62c525d9-b2cf-11e5-afa0-52540066fee9",
+ "href": "/cloudapi/v4/images/62c525d9-b2cf-11e5-afa0-52540066fee9",
"metadata": {
"createdDate": "2016-01-04T10:39:08Z",
"createdBy": "System",
@@ -82,7 +84,7 @@
"properties": {
"name": "Test-Image-Three-CDROM",
"description": "",
- "location": "de/fkb",
+ "location": "us/las",
"size": 0.37,
"cpuHotPlug": true,
"cpuHotUnplug": false,
@@ -96,13 +98,14 @@
"discScsiHotUnplug": false,
"licenceType": "LINUX",
"imageType": "CDROM",
+ "imageAliases": [ ],
"public": true
}
},
{
"id": "e2c323ba-3c6d-11e6-9336-52540005ab80",
"type": "image",
- "href": "/cloudapi/v3/images/e2c323ba-3c6d-11e6-9336-52540005ab80",
+ "href": "/cloudapi/v4/images/e2c323ba-3c6d-11e6-9336-52540005ab80",
"metadata": {
"createdDate": "2016-06-27T13:48:53Z",
"createdBy": "System",
@@ -114,7 +117,7 @@
"properties": {
"name": "Test-Image-Four-HDD",
"description": "",
- "location": "de/fkb",
+ "location": "us/las",
"size": 0.28,
"cpuHotPlug": false,
"cpuHotUnplug": false,
@@ -128,13 +131,14 @@
"discScsiHotUnplug": false,
"licenceType": "OTHER",
"imageType": "HDD",
+ "imageAliases": [ ],
"public": false
}
},
{
"id": "f1d2be4a-7937-11e4-8053-52540066fee9",
"type": "image",
- "href": "/cloudapi/v3/images/f1d2be4a-7937-11e4-8053-52540066fee9",
+ "href": "/cloudapi/v4/images/f1d2be4a-7937-11e4-8053-52540066fee9",
"metadata": {
"createdDate": "2014-12-01T08:56:31Z",
"createdBy": "System",
@@ -146,7 +150,7 @@
"properties": {
"name": "Test-Image-Two-HDD",
"description": "",
- "location": "de/fkb",
+ "location": "us/las",
"size": 0.45,
"cpuHotPlug": false,
"cpuHotUnplug": false,
@@ -160,13 +164,14 @@
"discScsiHotUnplug": false,
"licenceType": "LINUX",
"imageType": "HDD",
+ "imageAliases": [ ],
"public": true
}
},
{
"id": "dfa08a48-7937-11e4-8053-52540066fee9",
"type": "image",
- "href": "/cloudapi/v3/images/dfa08a48-7937-11e4-8053-52540066fee9",
+ "href": "/cloudapi/v4/images/dfa08a48-7937-11e4-8053-52540066fee9",
"metadata": {
"createdDate": "2014-12-01T08:56:00Z",
"createdBy": "System",
@@ -192,6 +197,7 @@
"discScsiHotUnplug": false,
"licenceType": "LINUX",
"imageType": "HDD",
+ "imageAliases": [ ],
"public": true
}
}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/list_locations.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/list_locations.json b/libcloud/test/compute/fixtures/profitbricks/list_locations.json
index 7694c22..0e1fdde 100644
--- a/libcloud/test/compute/fixtures/profitbricks/list_locations.json
+++ b/libcloud/test/compute/fixtures/profitbricks/list_locations.json
@@ -1,43 +1,42 @@
{
- "id": "locations",
- "type": "collection",
- "href": "/cloudapi/v3/locations",
- "items": [
- {
- "id": "de/fkb",
- "type": "location",
- "href": "/cloudapi/v3/locations/de/fkb",
- "properties": {
- "name": "karlsruhe",
- "features": [
- "SSD",
- "MULTIPLE_CPU"
- ]
- }
- },
- {
- "id": "de/fra",
- "type": "location",
- "href": "/cloudapi/v3/locations/de/fra",
- "properties": {
- "name": "frankfurt",
- "features": [
- "SSD",
- "MULTIPLE_CPU"
- ]
- }
- },
- {
- "id": "us/las",
- "type": "location",
- "href": "/cloudapi/v3/locations/us/las",
- "properties": {
- "name": "lasvegas",
- "features": [
- "SSD",
- "MULTIPLE_CPU"
- ]
- }
- }
- ]
-}
\ No newline at end of file
+ "id" : "locations",
+ "type" : "collection",
+ "href" : "https://api.profitbricks.com/cloudapi/v4/locations",
+ "items" : [ {
+ "id" : "us/las",
+ "type" : "location",
+ "href" : "https://api.profitbricks.com/cloudapi/v4/locations/de/fkb",
+ "properties" : {
+ "name" : "karlsruhe",
+ "features" : [ "SSD", "MULTIPLE_CPU" ],
+ "imageAliases" : [ "centos:6_iso", "opensuse:latest", "opensuse:42.3_iso", "centos:7_iso", "clearos:latest_iso", "debian:8_iso", "clonezilla:latest_iso", "windows:latest", "centos:7", "debian:7", "fedora:25_iso", "gparted:latest_iso", "grml:latest_iso", "opensuse:13.2_iso", "opensuse:42.1_iso", "opensuse:42.2_iso", "ubuntu:14.04_iso", "ubuntu:16.04_iso", "ubuntu:17.04_iso", "zenloadbalancer:latest_iso", "mssql:2012_trial_iso", "windows:virtiodriver_iso", "windows:2008r2_iso", "windows:2012r2_iso", "windows:2013_recovery_iso", "windows:2016_iso", "windows:2008r2", "windows:2012r2", "centos:6", "debian:9", "debian:latest", "ubuntu:16.04", "windows:2016", "centos:latest", "debian:8", "debian:testing", "fedora:25", "fedora:latest", "ubuntu:14.04", "ubuntu:latest", "debian:9_iso", "fedora:26_iso", "opensuse:13.2" ]
+ }
+ }, {
+ "id" : "de/fra",
+ "type" : "location",
+ "href" : "https://api.profitbricks.com/cloudapi/v4/locations/de/fra",
+ "properties" : {
+ "name" : "frankfurt",
+ "features" : [ "SSD", "MULTIPLE_CPU" ],
+ "imageAliases" : [ "centos:6_iso", "opensuse:42.3_iso", "windows:2012r2", "centos:7_iso", "clearos:latest_iso", "windows:latest", "clonezilla:latest_iso", "debian:7", "debian:9", "fedora:25_iso", "gparted:latest_iso", "grml:latest_iso", "opensuse:13.2_iso", "ubuntu:16.04", "opensuse:42.1_iso", "opensuse:42.2_iso", "windows:2016", "ubuntu:14.04_iso", "ubuntu:16.04_iso", "ubuntu:17.04_iso", "zenloadbalancer:latest_iso", "mssql:2012_trial_iso", "windows:virtiodriver_iso", "windows:2008r2_iso", "windows:2012r2_iso", "windows:2013_recovery_iso", "windows:2016_iso", "centos:6", "debian:latest", "fedora:latest", "ubuntu:14.04", "windows:2008r2", "centos:7", "centos:latest", "debian:8", "debian:testing", "fedora:25", "ubuntu:latest", "debian:8_iso", "debian:9_iso", "fedora:26_iso", "opensuse:13.2", "opensuse:latest" ]
+ }
+ }, {
+ "id" : "us/las",
+ "type" : "location",
+ "href" : "https://api.profitbricks.com/cloudapi/v4/locations/us/las",
+ "properties" : {
+ "name" : "lasvegas",
+ "features" : [ "SSD", "MULTIPLE_CPU" ],
+ "imageAliases" : [ "centos:6_iso", "opensuse:latest", "opensuse:42.3_iso", "windows:2016", "centos:7_iso", "clearos:latest_iso", "windows:latest", "clonezilla:latest_iso", "centos:7", "centos:latest", "debian:latest", "fedora:25_iso", "gparted:latest_iso", "grml:latest_iso", "opensuse:13.2_iso", "ubuntu:latest", "opensuse:42.1_iso", "opensuse:42.2_iso", "windows:2008r2", "opensuse:13.2", "ubuntu:14.04_iso", "ubuntu:16.04_iso", "ubuntu:17.04_iso", "zenloadbalancer:latest_iso", "mssql:2012_trial_iso", "windows:virtiodriver_iso", "windows:2008r2_iso", "windows:2012r2_iso", "windows:2013_recovery_iso", "windows:2016_iso", "debian:9", "debian:testing", "ubuntu:16.04", "windows:2012r2", "centos:6", "debian:7", "debian:8", "fedora:25", "fedora:latest", "ubuntu:14.04", "debian:8_iso", "debian:9_iso", "fedora:26_iso" ]
+ }
+ }, {
+ "id" : "us/ewr",
+ "type" : "location",
+ "href" : "https://api.profitbricks.com/cloudapi/v4/locations/us/ewr",
+ "properties" : {
+ "name" : "newark",
+ "features" : [ "SSD", "MULTIPLE_CPU" ],
+ "imageAliases" : [ "centos:6_iso", "opensuse:13.2", "opensuse:latest", "opensuse:42.3_iso", "windows:2008r2", "centos:7_iso", "clearos:latest_iso", "debian:9_iso", "fedora:26_iso", "clonezilla:latest_iso", "windows:2012r2", "windows:2016", "windows:latest", "centos:6", "centos:7", "centos:latest", "debian:latest", "fedora:25_iso", "gparted:latest_iso", "grml:latest_iso", "opensuse:13.2_iso", "fedora:latest", "ubuntu:14.04", "ubuntu:16.04", "opensuse:42.1_iso", "opensuse:42.2_iso", "ubuntu:14.04_iso", "ubuntu:16.04_iso", "ubuntu:17.04_iso", "zenloadbalancer:latest_iso", "mssql:2012_trial_iso", "windows:virtiodriver_iso", "windows:2008r2_iso", "windows:2012r2_iso", "windows:2013_recovery_iso", "windows:2016_iso", "debian:testing", "fedora:25", "debian:7", "debian:8", "debian:9", "ubuntu:latest", "debian:8_iso" ]
+ }
+ } ]
+}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/list_nodes.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/list_nodes.json b/libcloud/test/compute/fixtures/profitbricks/list_nodes.json
index 1f30a8c..553b2f5 100644
--- a/libcloud/test/compute/fixtures/profitbricks/list_nodes.json
+++ b/libcloud/test/compute/fixtures/profitbricks/list_nodes.json
@@ -1,12 +1,12 @@
{
"id": "dc-1/servers",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/9e9cb896-e8e7-4f52-a808-ac808baac814/servers",
+ "href": "/cloudapi/v4/datacenters/9e9cb896-e8e7-4f52-a808-ac808baac814/servers",
"items": [
{
"id": "srv-1",
"type": "server",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1",
"metadata": {
"createdDate": "2016-10-18T07:28:05Z",
"createdBy": "test@test.te",
@@ -16,16 +16,16 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Test Node.",
- "cores": 2,
- "ram": 4096,
+ "name": "libcloud Test",
+ "cores": 1,
+ "ram": 1024,
"availabilityZone": "AUTO",
"vmState": "RUNNING",
"bootCdrom": null,
"bootVolume": {
"id": "bvol-1",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/bvol-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/bvol-1",
"metadata": {
"createdDate": "2016-10-18T07:20:41Z",
"createdBy": "matfin@stackpointcloud.com",
@@ -35,9 +35,9 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Test Node Volume",
+ "name": "libcloud Test",
"type": "HDD",
- "size": 10,
+ "size": 2,
"image": "bvol-img",
"imagePassword": null,
"bus": "VIRTIO",
@@ -61,25 +61,25 @@
"cdroms": {
"id": "srv-1/cdroms",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1/cdroms",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1/cdroms",
"items": []
},
"volumes": {
"id": "srv-1/volumes",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1/volumes",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1/volumes",
"items": [
{
"id": "bvol-1",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/bvol-1"
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/bvol-1"
}
]
},
"nics": {
"id": "srv-1/nics",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1/nics",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1/nics",
"items": []
}
}
@@ -87,7 +87,7 @@
{
"id": "srv-1",
"type": "server",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1",
"metadata": {
"createdDate": "2016-10-18T07:28:05Z",
"createdBy": "test@test.te",
@@ -97,16 +97,16 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Test Node.",
- "cores": 2,
- "ram": 4096,
+ "name": "libcloud Test",
+ "cores": 1,
+ "ram": 1024,
"availabilityZone": "AUTO",
"vmState": "RUNNING",
"bootCdrom": null,
"bootVolume": {
"id": "bvol-1",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/bvol-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/bvol-1",
"metadata": {
"createdDate": "2016-10-18T07:20:41Z",
"createdBy": "matfin@stackpointcloud.com",
@@ -116,9 +116,9 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Test Node Volume",
+ "name": "libcloud Test",
"type": "HDD",
- "size": 10,
+ "size": 2,
"image": "bvol-img",
"imagePassword": null,
"bus": "VIRTIO",
@@ -142,25 +142,25 @@
"cdroms": {
"id": "srv-1/cdroms",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1/cdroms",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1/cdroms",
"items": []
},
"volumes": {
"id": "srv-1/volumes",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1/volumes",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1/volumes",
"items": [
{
"id": "bvol-1",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/bvol-1"
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/bvol-1"
}
]
},
"nics": {
"id": "srv-1/nics",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/servers/srv-1/nics",
+ "href": "/cloudapi/v4/datacenters/dc-1/servers/srv-1/nics",
"items": []
}
}
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/list_snapshots.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/list_snapshots.json b/libcloud/test/compute/fixtures/profitbricks/list_snapshots.json
index 615dcb4..6902477 100644
--- a/libcloud/test/compute/fixtures/profitbricks/list_snapshots.json
+++ b/libcloud/test/compute/fixtures/profitbricks/list_snapshots.json
@@ -1,12 +1,12 @@
{
"id": "snapshots",
"type": "collection",
- "href": "/cloudapi/v3/snapshots",
+ "href": "/cloudapi/v4/snapshots",
"items": [
{
"id": "sshot",
"type": "snapshot",
- "href": "/cloudapi/v3/snapshots/sshot",
+ "href": "/cloudapi/v4/snapshots/sshot",
"metadata": {
"createdDate": "2016-10-26T11:38:45Z",
"createdBy": "test@test.te",
http://git-wip-us.apache.org/repos/asf/libcloud/blob/01ce1d5c/libcloud/test/compute/fixtures/profitbricks/list_volumes.json
----------------------------------------------------------------------
diff --git a/libcloud/test/compute/fixtures/profitbricks/list_volumes.json b/libcloud/test/compute/fixtures/profitbricks/list_volumes.json
index 6111ca1..7866ed8 100644
--- a/libcloud/test/compute/fixtures/profitbricks/list_volumes.json
+++ b/libcloud/test/compute/fixtures/profitbricks/list_volumes.json
@@ -1,12 +1,12 @@
{
"id": "dc-1/volumes",
"type": "collection",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes",
"items": [
{
"id": "bvol-1",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/bvol-1",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/bvol-1",
"metadata": {
"createdDate": "2016-10-18T07:20:41Z",
"createdBy": "test@test.test",
@@ -16,7 +16,7 @@
"state": "AVAILABLE"
},
"properties": {
- "name": "Test Volume",
+ "name": "Test",
"type": "HDD",
"size": 10,
"availabilityZone": "AUTO",
@@ -41,7 +41,7 @@
{
"id": "d6688ced-700d-4c9c-a3a7-9f7170c5edc3",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/d6688ced-700d-4c9c-a3a7-9f7170c5edc3",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/d6688ced-700d-4c9c-a3a7-9f7170c5edc3",
"metadata": {
"createdDate": "2016-10-17T13:13:36Z",
"createdBy": "test@test.test",
@@ -76,7 +76,7 @@
{
"id": "21d7e7de-5054-4041-b691-717aa8b3c799",
"type": "volume",
- "href": "/cloudapi/v3/datacenters/dc-1/volumes/21d7e7de-5054-4041-b691-717aa8b3c799",
+ "href": "/cloudapi/v4/datacenters/dc-1/volumes/21d7e7de-5054-4041-b691-717aa8b3c799",
"metadata": {
"createdDate": "2016-10-17T11:33:20Z",
"createdBy": "test@test.test",