fog-profitbricks 2.0.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/.travis.yml +11 -4
- data/README.md +8 -5
- data/Rakefile +1 -1
- data/examples/pb_demo.rb +49 -49
- data/fog-profitbricks.gemspec +4 -5
- data/gemfiles/Gemfile.1.9.2+ +1 -0
- data/lib/fog/bin/profitbricks.rb +5 -5
- data/lib/fog/profitbricks.rb +3 -3
- data/lib/fog/profitbricks/compute.rb +209 -204
- data/lib/fog/profitbricks/helpers/compute/data_helper.rb +1 -1
- data/lib/fog/profitbricks/models/compute/datacenter.rb +1 -1
- data/lib/fog/profitbricks/models/compute/datacenters.rb +6 -7
- data/lib/fog/profitbricks/models/compute/firewall_rule.rb +2 -2
- data/lib/fog/profitbricks/models/compute/firewall_rules.rb +5 -8
- data/lib/fog/profitbricks/models/compute/flavors.rb +1 -4
- data/lib/fog/profitbricks/models/compute/image.rb +4 -0
- data/lib/fog/profitbricks/models/compute/images.rb +2 -5
- data/lib/fog/profitbricks/models/compute/ip_block.rb +1 -1
- data/lib/fog/profitbricks/models/compute/ip_blocks.rb +3 -8
- data/lib/fog/profitbricks/models/compute/lan.rb +1 -1
- data/lib/fog/profitbricks/models/compute/lans.rb +4 -7
- data/lib/fog/profitbricks/models/compute/load_balancer.rb +6 -7
- data/lib/fog/profitbricks/models/compute/load_balancers.rb +5 -9
- data/lib/fog/profitbricks/models/compute/locations.rb +2 -5
- data/lib/fog/profitbricks/models/compute/nic.rb +6 -3
- data/lib/fog/profitbricks/models/compute/nics.rb +2 -5
- data/lib/fog/profitbricks/models/compute/regions.rb +1 -4
- data/lib/fog/profitbricks/models/compute/request.rb +0 -1
- data/lib/fog/profitbricks/models/compute/requests.rb +2 -4
- data/lib/fog/profitbricks/models/compute/server.rb +10 -13
- data/lib/fog/profitbricks/models/compute/servers.rb +3 -6
- data/lib/fog/profitbricks/models/compute/snapshot.rb +2 -2
- data/lib/fog/profitbricks/models/compute/snapshots.rb +3 -6
- data/lib/fog/profitbricks/models/compute/volume.rb +11 -9
- data/lib/fog/profitbricks/models/compute/volumes.rb +3 -6
- data/lib/fog/profitbricks/requests/compute/associate_nic_to_load_balancer.rb +26 -13
- data/lib/fog/profitbricks/requests/compute/attach_cdrom.rb +25 -16
- data/lib/fog/profitbricks/requests/compute/attach_volume.rb +25 -16
- data/lib/fog/profitbricks/requests/compute/create_datacenter.rb +22 -23
- data/lib/fog/profitbricks/requests/compute/create_firewall_rule.rb +24 -26
- data/lib/fog/profitbricks/requests/compute/create_flavor.rb +34 -34
- data/lib/fog/profitbricks/requests/compute/create_ip_block.rb +18 -20
- data/lib/fog/profitbricks/requests/compute/create_lan.rb +151 -150
- data/lib/fog/profitbricks/requests/compute/create_load_balancer.rb +67 -26
- data/lib/fog/profitbricks/requests/compute/create_nic.rb +24 -26
- data/lib/fog/profitbricks/requests/compute/create_server.rb +70 -61
- data/lib/fog/profitbricks/requests/compute/create_volume.rb +122 -122
- data/lib/fog/profitbricks/requests/compute/create_volume_snapshot.rb +42 -45
- data/lib/fog/profitbricks/requests/compute/delete_datacenter.rb +34 -36
- data/lib/fog/profitbricks/requests/compute/delete_firewall_rule.rb +8 -11
- data/lib/fog/profitbricks/requests/compute/delete_image.rb +7 -9
- data/lib/fog/profitbricks/requests/compute/delete_ip_block.rb +8 -10
- data/lib/fog/profitbricks/requests/compute/delete_lan.rb +7 -9
- data/lib/fog/profitbricks/requests/compute/delete_load_balancer.rb +8 -10
- data/lib/fog/profitbricks/requests/compute/delete_nic.rb +7 -10
- data/lib/fog/profitbricks/requests/compute/delete_server.rb +6 -10
- data/lib/fog/profitbricks/requests/compute/delete_snapshot.rb +7 -10
- data/lib/fog/profitbricks/requests/compute/delete_volume.rb +36 -38
- data/lib/fog/profitbricks/requests/compute/detach_cdrom.rb +11 -13
- data/lib/fog/profitbricks/requests/compute/detach_volume.rb +16 -13
- data/lib/fog/profitbricks/requests/compute/get_all_datacenters.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/get_all_firewall_rules.rb +6 -7
- data/lib/fog/profitbricks/requests/compute/get_all_flavors.rb +72 -72
- data/lib/fog/profitbricks/requests/compute/get_all_images.rb +62 -62
- data/lib/fog/profitbricks/requests/compute/get_all_ip_blocks.rb +5 -5
- data/lib/fog/profitbricks/requests/compute/get_all_lans.rb +113 -113
- data/lib/fog/profitbricks/requests/compute/get_all_load_balanced_nics.rb +15 -9
- data/lib/fog/profitbricks/requests/compute/get_all_load_balancers.rb +9 -9
- data/lib/fog/profitbricks/requests/compute/get_all_locations.rb +6 -6
- data/lib/fog/profitbricks/requests/compute/get_all_nic.rb +94 -94
- data/lib/fog/profitbricks/requests/compute/get_all_requests.rb +38 -38
- data/lib/fog/profitbricks/requests/compute/get_all_servers.rb +8 -9
- data/lib/fog/profitbricks/requests/compute/get_all_snapshots.rb +4 -4
- data/lib/fog/profitbricks/requests/compute/get_all_volumes.rb +71 -71
- data/lib/fog/profitbricks/requests/compute/get_attached_cdrom.rb +11 -11
- data/lib/fog/profitbricks/requests/compute/get_attached_volume.rb +16 -11
- data/lib/fog/profitbricks/requests/compute/get_datacenter.rb +4 -6
- data/lib/fog/profitbricks/requests/compute/get_firewall_rule.rb +8 -11
- data/lib/fog/profitbricks/requests/compute/get_flavor.rb +9 -9
- data/lib/fog/profitbricks/requests/compute/get_image.rb +7 -9
- data/lib/fog/profitbricks/requests/compute/get_ip_block.rb +8 -10
- data/lib/fog/profitbricks/requests/compute/get_lan.rb +7 -10
- data/lib/fog/profitbricks/requests/compute/get_load_balanced_nic.rb +16 -12
- data/lib/fog/profitbricks/requests/compute/get_load_balancer.rb +7 -9
- data/lib/fog/profitbricks/requests/compute/get_location.rb +7 -9
- data/lib/fog/profitbricks/requests/compute/get_nic.rb +8 -11
- data/lib/fog/profitbricks/requests/compute/get_request.rb +55 -57
- data/lib/fog/profitbricks/requests/compute/get_request_status.rb +44 -46
- data/lib/fog/profitbricks/requests/compute/get_server.rb +7 -10
- data/lib/fog/profitbricks/requests/compute/get_snapshot.rb +7 -9
- data/lib/fog/profitbricks/requests/compute/get_volume.rb +7 -9
- data/lib/fog/profitbricks/requests/compute/list_attached_cdroms.rb +8 -8
- data/lib/fog/profitbricks/requests/compute/list_attached_volumes.rb +18 -8
- data/lib/fog/profitbricks/requests/compute/reboot_server.rb +7 -11
- data/lib/fog/profitbricks/requests/compute/remove_nic_association.rb +9 -11
- data/lib/fog/profitbricks/requests/compute/restore_volume_snapshot.rb +15 -17
- data/lib/fog/profitbricks/requests/compute/start_server.rb +7 -11
- data/lib/fog/profitbricks/requests/compute/stop_server.rb +7 -11
- data/lib/fog/profitbricks/requests/compute/update_datacenter.rb +20 -15
- data/lib/fog/profitbricks/requests/compute/update_firewall_rule.rb +9 -11
- data/lib/fog/profitbricks/requests/compute/update_image.rb +15 -15
- data/lib/fog/profitbricks/requests/compute/update_lan.rb +6 -8
- data/lib/fog/profitbricks/requests/compute/update_load_balancer.rb +10 -12
- data/lib/fog/profitbricks/requests/compute/update_nic.rb +10 -12
- data/lib/fog/profitbricks/requests/compute/update_server.rb +10 -13
- data/lib/fog/profitbricks/requests/compute/update_snapshot.rb +10 -13
- data/lib/fog/profitbricks/requests/compute/update_volume.rb +10 -13
- data/lib/fog/profitbricks/version.rb +1 -1
- data/spec/minitest_helper.rb +1 -3
- data/tests/helpers/formats_helper.rb +8 -8
- data/tests/profitbricks/models/compute/compute_tests.rb +529 -0
- data/tests/profitbricks/requests/compute/composite_create_tests.rb +16 -83
- data/tests/profitbricks/requests/compute/flavor_tests.rb +1 -4
- data/tests/profitbricks/requests/compute/location_tests.rb +14 -17
- data/tests/profitbricks/requests/compute/nic_tests.rb +60 -70
- data/tests/profitbricks/requests/compute/request_tests.rb +1 -3
- data/tests/profitbricks/requests/compute/server_tests.rb +163 -161
- metadata +5 -18
@@ -1,44 +1,42 @@
|
|
1
1
|
module Fog
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
2
|
+
module Compute
|
3
|
+
class ProfitBricks
|
4
|
+
class Real
|
5
|
+
# Deletes the specified volume
|
6
|
+
#
|
7
|
+
# ==== Parameters
|
8
|
+
# * datacenter_id<~String> - UUID of the data center
|
9
|
+
# * volume_id<~String> - UUID of the volume
|
10
|
+
#
|
11
|
+
# ==== Returns
|
12
|
+
# * response<~Excon::Response> - No response parameters
|
13
|
+
# (HTTP/1.1 202 Accepted)
|
14
|
+
#
|
15
|
+
# {ProfitBricks API Documentation}[https://devops.profitbricks.com/api/cloud/v2/#delete-volume]
|
16
|
+
def delete_volume(datacenter_id, volume_id)
|
17
|
+
request(
|
18
|
+
:expects => [202],
|
19
|
+
:method => 'DELETE',
|
20
|
+
:path => "/datacenters/#{datacenter_id}/volumes/#{volume_id}"
|
21
|
+
)
|
22
|
+
end
|
23
|
+
end
|
26
24
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
class Mock
|
26
|
+
def delete_volume(datacenter_id, volume_id)
|
27
|
+
response = Excon::Response.new
|
28
|
+
response.status = 202
|
31
29
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
30
|
+
if vlm = data[:volumes]["items"].find do |volume|
|
31
|
+
volume["id"] == volume_id && volume["datacenter_id"] == datacenter_id
|
32
|
+
end
|
33
|
+
else
|
34
|
+
raise Excon::Error::HTTPStatus, "The requested resource could not be found"
|
35
|
+
end
|
38
36
|
|
39
|
-
|
40
|
-
end
|
41
|
-
end
|
37
|
+
response
|
42
38
|
end
|
39
|
+
end
|
43
40
|
end
|
44
|
-
end
|
41
|
+
end
|
42
|
+
end
|
@@ -16,12 +16,10 @@ module Fog
|
|
16
16
|
# {ProfitBricks API Documentation}[https://devops.profitbricks.com/api/cloud/v2/#detach-a-cd-rom]
|
17
17
|
def detach_cdrom(datacenter_id, server_id, cdrom_id)
|
18
18
|
request(
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
:expects => [202],
|
20
|
+
:method => 'DELETE',
|
21
|
+
:path => "/datacenters/#{datacenter_id}/servers/#{server_id}/cdroms/#{cdrom_id}"
|
22
22
|
)
|
23
|
-
rescue => error
|
24
|
-
Fog::Errors::NotFound.new(error)
|
25
23
|
end
|
26
24
|
end
|
27
25
|
|
@@ -30,18 +28,18 @@ module Fog
|
|
30
28
|
response = Excon::Response.new
|
31
29
|
response.status = 202
|
32
30
|
|
33
|
-
if server =
|
34
|
-
|
35
|
-
|
31
|
+
if server = data[:servers]['items'].find do |serv|
|
32
|
+
serv['datacenter_id'] == datacenter_id && serv['id'] == server_id
|
33
|
+
end
|
36
34
|
else
|
37
|
-
raise Fog::Errors::NotFound
|
35
|
+
raise Fog::Errors::NotFound, "The server resource could not be found"
|
38
36
|
end
|
39
37
|
|
40
|
-
if cdrom = server['entities']['cdroms']['items'].find
|
41
|
-
|
42
|
-
|
38
|
+
if cdrom = server['entities']['cdroms']['items'].find do |cd|
|
39
|
+
cd['id'] == cdrom_id
|
40
|
+
end
|
43
41
|
else
|
44
|
-
raise Fog::Errors::NotFound
|
42
|
+
raise Fog::Errors::NotFound, "The attached volume resource could not be found"
|
45
43
|
end
|
46
44
|
|
47
45
|
response
|
@@ -17,12 +17,10 @@ module Fog
|
|
17
17
|
# {ProfitBricks API Documentation}[https://devops.profitbricks.com/api/cloud/v2/#detach-a-volume]
|
18
18
|
def detach_volume(datacenter_id, server_id, volume_id)
|
19
19
|
request(
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
:expects => [202],
|
21
|
+
:method => 'DELETE',
|
22
|
+
:path => "/datacenters/#{datacenter_id}/servers/#{server_id}/volumes/#{volume_id}"
|
23
23
|
)
|
24
|
-
rescue => error
|
25
|
-
Fog::Errors::NotFound.new(error)
|
26
24
|
end
|
27
25
|
end
|
28
26
|
|
@@ -31,18 +29,23 @@ module Fog
|
|
31
29
|
response = Excon::Response.new
|
32
30
|
response.status = 202
|
33
31
|
|
34
|
-
if server =
|
35
|
-
|
36
|
-
|
32
|
+
if server = data[:servers]['items'].find do |serv|
|
33
|
+
serv['datacenter_id'] == datacenter_id && serv['id'] == server_id
|
34
|
+
end
|
37
35
|
else
|
38
|
-
raise Fog::Errors::NotFound
|
36
|
+
raise Fog::Errors::NotFound, "The server resource could not be found"
|
39
37
|
end
|
40
38
|
|
41
|
-
if
|
42
|
-
|
43
|
-
|
39
|
+
if server['entities']
|
40
|
+
volume = server['entities']['volumes']['items'].find do |vlm|
|
41
|
+
vlm['id'] == volume_id
|
42
|
+
end
|
43
|
+
elsif server['volumes']
|
44
|
+
volume = server['volumes']['items'].find do |vlm|
|
45
|
+
vlm['id'] == volume_id
|
46
|
+
end
|
44
47
|
else
|
45
|
-
raise Fog::Errors::NotFound
|
48
|
+
raise Fog::Errors::NotFound, "The attached volume resource could not be found"
|
46
49
|
end
|
47
50
|
|
48
51
|
response
|
@@ -49,18 +49,17 @@ module Fog
|
|
49
49
|
:path => "/datacenters/#{datacenter_id}/servers/#{server_id}/nics/#{nic_id}/firewallrules?depth=5"
|
50
50
|
)
|
51
51
|
end
|
52
|
-
|
53
52
|
end
|
54
53
|
|
55
54
|
class Mock
|
56
55
|
def get_all_firewall_rules(datacenter_id, server_id, nic_id)
|
57
|
-
firewall_rules =
|
56
|
+
firewall_rules = data[:firewall_rules]
|
58
57
|
|
59
|
-
if nics =
|
60
|
-
|
61
|
-
|
58
|
+
if nics = data[:firewall_rules]['items'].select do |attrib|
|
59
|
+
attrib['datacenter_id'] == datacenter_id && attrib['server_id'] == server_id && attrib['nic_id'] == nic_id
|
60
|
+
end
|
62
61
|
else
|
63
|
-
raise Fog::Errors::NotFound
|
62
|
+
raise Fog::Errors::NotFound, 'The resource could not be found'
|
64
63
|
end
|
65
64
|
|
66
65
|
firewall_rules['items'] = nics
|
@@ -73,4 +72,4 @@ module Fog
|
|
73
72
|
end
|
74
73
|
end
|
75
74
|
end
|
76
|
-
end
|
75
|
+
end
|
@@ -1,77 +1,77 @@
|
|
1
1
|
module Fog
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
2
|
+
module Compute
|
3
|
+
class ProfitBricks
|
4
|
+
class Real
|
5
|
+
def get_all_flavors
|
6
|
+
response = Excon::Response.new
|
7
|
+
response.status = 200
|
8
|
+
response.body = {
|
9
|
+
'getAllFlavorsResponse' => [
|
10
|
+
{
|
11
|
+
'flavorId' => '00db4c8f-5e83-49b0-a70b-ac4aad786163',
|
12
|
+
'flavorName' => 'Micro',
|
13
|
+
'ram' => 1024,
|
14
|
+
'cores' => 1
|
15
|
+
},
|
16
|
+
{
|
17
|
+
'flavorId' => 'dc64957b-be9d-431e-91cd-9e217f94d3de',
|
18
|
+
'flavorName' => 'Small',
|
19
|
+
'ram' => 2048,
|
20
|
+
'cores' => 1
|
21
|
+
},
|
22
|
+
{
|
23
|
+
'flavorId' => 'b37d000e-b347-4592-b572-df13ef8f68e1',
|
24
|
+
'flavorName' => 'Medium',
|
25
|
+
'ram' => 4096,
|
26
|
+
'cores' => 2
|
27
|
+
},
|
28
|
+
{
|
29
|
+
'flavorId' => 'a5a4389f-54b6-4f47-b6e8-1c5c55976b94',
|
30
|
+
'flavorName' => 'Large',
|
31
|
+
'ram' => 7168,
|
32
|
+
'cores' => 4
|
33
|
+
},
|
34
|
+
{
|
35
|
+
'flavorId' => '0052db40-f1dd-4ecf-a711-5980081b7059',
|
36
|
+
'flavorName' => 'Extra Large',
|
37
|
+
'ram' => 14_336,
|
38
|
+
'cores' => 8
|
39
|
+
},
|
40
|
+
{
|
41
|
+
'flavorId' => '8b2b835d-be09-48cf-aae2-7e35aafe92d6',
|
42
|
+
'flavorName' => 'Memory Intensive Small',
|
43
|
+
'ram' => 16_384,
|
44
|
+
'cores' => 2
|
45
|
+
},
|
46
|
+
{
|
47
|
+
'flavorId' => '45c28f8b-6a67-4f69-8c94-231d371da2b6',
|
48
|
+
'flavorName' => 'Memory Intensive Medium',
|
49
|
+
'ram' => 28_672,
|
50
|
+
'cores' => 4
|
51
|
+
},
|
52
|
+
{
|
53
|
+
'flavorId' => '1d22436d-d958-4151-b144-43a8e180c4c4',
|
54
|
+
'flavorName' => 'Memory Intensive Large',
|
55
|
+
'ram' => 57_344,
|
56
|
+
'cores' => 8
|
57
|
+
}
|
58
|
+
]
|
59
|
+
}
|
60
|
+
response
|
61
|
+
end
|
62
|
+
end
|
63
63
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
end
|
74
|
-
end
|
64
|
+
class Mock
|
65
|
+
def get_all_flavors
|
66
|
+
data = self.data[:flavors]
|
67
|
+
response = Excon::Response.new
|
68
|
+
response.status = 200
|
69
|
+
response.body = {
|
70
|
+
'getAllFlavorsResponse' => self.data[:flavors]
|
71
|
+
}
|
72
|
+
response
|
75
73
|
end
|
74
|
+
end
|
76
75
|
end
|
76
|
+
end
|
77
77
|
end
|
@@ -1,66 +1,66 @@
|
|
1
1
|
module Fog
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
2
|
+
module Compute
|
3
|
+
class ProfitBricks
|
4
|
+
class Real
|
5
|
+
# Displays a list of all available images.
|
6
|
+
#
|
7
|
+
# ==== Parameters
|
8
|
+
# * N/A
|
9
|
+
#
|
10
|
+
# ==== Returns
|
11
|
+
# * response<~Excon::Response>:
|
12
|
+
# * body<~Hash>:
|
13
|
+
# * id<~String> - The resource's unique identifier
|
14
|
+
# * type<~String> - The type of the requested resource
|
15
|
+
# * href<~String> - URL to the object’s representation (absolute path)
|
16
|
+
# * items<~Array>
|
17
|
+
# * id<~String> - The resource's unique identifier
|
18
|
+
# * type<~String> - The type of the requested resource
|
19
|
+
# * href<~String> - URL to the object’s representation (absolute path)
|
20
|
+
# * metadata<~Hash> - Hash containing the image metadata
|
21
|
+
# * createdDate<~String> - The date the resource was created
|
22
|
+
# * createdBy<~String> - The user who created the resource
|
23
|
+
# * etag<~String> - The etag for the resource
|
24
|
+
# * lastModifiedDate<~String> - The last time the resource has been modified
|
25
|
+
# * lastModifiedBy<~String> - The user who last modified the resource
|
26
|
+
# * state<~String> - Volume state
|
27
|
+
# * properties<~Hash> - Hash containing the volume properties
|
28
|
+
# * name<~String> - The name of the image
|
29
|
+
# * description<~String> - The description of the image
|
30
|
+
# * location<~String> - The image's location
|
31
|
+
# * size<~Integer> - The size of the image in GB
|
32
|
+
# * cpuHotPlug<~Boolean> - This image is capable of CPU hot plug (no reboot required)
|
33
|
+
# * cpuHotUnplug<~Boolean> - This image is capable of CPU hot unplug (no reboot required)
|
34
|
+
# * ramHotPlug<~Boolean> - This image is capable of memory hot plug (no reboot required)
|
35
|
+
# * ramHotUnplug<~Boolean> - This image is capable of memory hot unplug (no reboot required)
|
36
|
+
# * nicHotPlug<~Boolean> - This image is capable of nic hot plug (no reboot required)
|
37
|
+
# * nicHotUnplug<~Boolean> - This image is capable of nic hot unplug (no reboot required)
|
38
|
+
# * discVirtioHotPlug<~Boolean> - This image is capable of Virt-IO drive hot plug (no reboot required)
|
39
|
+
# * discVirtioHotPlug<~Boolean> - This image is capable of Virt-IO drive hot unplug (no reboot required)
|
40
|
+
# * discScsiHotPlug<~Boolean> - This image is capable of Scsi drive hot plug (no reboot required)
|
41
|
+
# * discScsiHotUnplug<~Boolean> - This image is capable of Scsi drive hot unplug (no reboot required)
|
42
|
+
# * licenceType<~String> - The image's licence type: LINUX, WINDOWS, or UNKNOWN
|
43
|
+
# * imageType<~String> - The type of image: HDD, CDROM
|
44
|
+
# * public<~String> - Indicates if the image is part of the public repository or not
|
45
|
+
#
|
46
|
+
# {ProfitBricks API Documentation}[https://devops.profitbricks.com/api/cloud/v2/#list-images]
|
47
|
+
def get_all_images
|
48
|
+
request(
|
49
|
+
:expects => [200],
|
50
|
+
:method => 'GET',
|
51
|
+
:path => "/images?depth=5"
|
52
|
+
)
|
53
|
+
end
|
54
|
+
end
|
55
55
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
end
|
63
|
-
end
|
56
|
+
class Mock
|
57
|
+
def get_all_images
|
58
|
+
response = Excon::Response.new
|
59
|
+
response.status = 200
|
60
|
+
response.body = data[:images]
|
61
|
+
response
|
64
62
|
end
|
63
|
+
end
|
65
64
|
end
|
66
|
-
end
|
65
|
+
end
|
66
|
+
end
|