fog-profitbricks 2.0.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -0
  3. data/.travis.yml +11 -4
  4. data/README.md +8 -5
  5. data/Rakefile +1 -1
  6. data/examples/pb_demo.rb +49 -49
  7. data/fog-profitbricks.gemspec +4 -5
  8. data/gemfiles/Gemfile.1.9.2+ +1 -0
  9. data/lib/fog/bin/profitbricks.rb +5 -5
  10. data/lib/fog/profitbricks.rb +3 -3
  11. data/lib/fog/profitbricks/compute.rb +209 -204
  12. data/lib/fog/profitbricks/helpers/compute/data_helper.rb +1 -1
  13. data/lib/fog/profitbricks/models/compute/datacenter.rb +1 -1
  14. data/lib/fog/profitbricks/models/compute/datacenters.rb +6 -7
  15. data/lib/fog/profitbricks/models/compute/firewall_rule.rb +2 -2
  16. data/lib/fog/profitbricks/models/compute/firewall_rules.rb +5 -8
  17. data/lib/fog/profitbricks/models/compute/flavors.rb +1 -4
  18. data/lib/fog/profitbricks/models/compute/image.rb +4 -0
  19. data/lib/fog/profitbricks/models/compute/images.rb +2 -5
  20. data/lib/fog/profitbricks/models/compute/ip_block.rb +1 -1
  21. data/lib/fog/profitbricks/models/compute/ip_blocks.rb +3 -8
  22. data/lib/fog/profitbricks/models/compute/lan.rb +1 -1
  23. data/lib/fog/profitbricks/models/compute/lans.rb +4 -7
  24. data/lib/fog/profitbricks/models/compute/load_balancer.rb +6 -7
  25. data/lib/fog/profitbricks/models/compute/load_balancers.rb +5 -9
  26. data/lib/fog/profitbricks/models/compute/locations.rb +2 -5
  27. data/lib/fog/profitbricks/models/compute/nic.rb +6 -3
  28. data/lib/fog/profitbricks/models/compute/nics.rb +2 -5
  29. data/lib/fog/profitbricks/models/compute/regions.rb +1 -4
  30. data/lib/fog/profitbricks/models/compute/request.rb +0 -1
  31. data/lib/fog/profitbricks/models/compute/requests.rb +2 -4
  32. data/lib/fog/profitbricks/models/compute/server.rb +10 -13
  33. data/lib/fog/profitbricks/models/compute/servers.rb +3 -6
  34. data/lib/fog/profitbricks/models/compute/snapshot.rb +2 -2
  35. data/lib/fog/profitbricks/models/compute/snapshots.rb +3 -6
  36. data/lib/fog/profitbricks/models/compute/volume.rb +11 -9
  37. data/lib/fog/profitbricks/models/compute/volumes.rb +3 -6
  38. data/lib/fog/profitbricks/requests/compute/associate_nic_to_load_balancer.rb +26 -13
  39. data/lib/fog/profitbricks/requests/compute/attach_cdrom.rb +25 -16
  40. data/lib/fog/profitbricks/requests/compute/attach_volume.rb +25 -16
  41. data/lib/fog/profitbricks/requests/compute/create_datacenter.rb +22 -23
  42. data/lib/fog/profitbricks/requests/compute/create_firewall_rule.rb +24 -26
  43. data/lib/fog/profitbricks/requests/compute/create_flavor.rb +34 -34
  44. data/lib/fog/profitbricks/requests/compute/create_ip_block.rb +18 -20
  45. data/lib/fog/profitbricks/requests/compute/create_lan.rb +151 -150
  46. data/lib/fog/profitbricks/requests/compute/create_load_balancer.rb +67 -26
  47. data/lib/fog/profitbricks/requests/compute/create_nic.rb +24 -26
  48. data/lib/fog/profitbricks/requests/compute/create_server.rb +70 -61
  49. data/lib/fog/profitbricks/requests/compute/create_volume.rb +122 -122
  50. data/lib/fog/profitbricks/requests/compute/create_volume_snapshot.rb +42 -45
  51. data/lib/fog/profitbricks/requests/compute/delete_datacenter.rb +34 -36
  52. data/lib/fog/profitbricks/requests/compute/delete_firewall_rule.rb +8 -11
  53. data/lib/fog/profitbricks/requests/compute/delete_image.rb +7 -9
  54. data/lib/fog/profitbricks/requests/compute/delete_ip_block.rb +8 -10
  55. data/lib/fog/profitbricks/requests/compute/delete_lan.rb +7 -9
  56. data/lib/fog/profitbricks/requests/compute/delete_load_balancer.rb +8 -10
  57. data/lib/fog/profitbricks/requests/compute/delete_nic.rb +7 -10
  58. data/lib/fog/profitbricks/requests/compute/delete_server.rb +6 -10
  59. data/lib/fog/profitbricks/requests/compute/delete_snapshot.rb +7 -10
  60. data/lib/fog/profitbricks/requests/compute/delete_volume.rb +36 -38
  61. data/lib/fog/profitbricks/requests/compute/detach_cdrom.rb +11 -13
  62. data/lib/fog/profitbricks/requests/compute/detach_volume.rb +16 -13
  63. data/lib/fog/profitbricks/requests/compute/get_all_datacenters.rb +1 -1
  64. data/lib/fog/profitbricks/requests/compute/get_all_firewall_rules.rb +6 -7
  65. data/lib/fog/profitbricks/requests/compute/get_all_flavors.rb +72 -72
  66. data/lib/fog/profitbricks/requests/compute/get_all_images.rb +62 -62
  67. data/lib/fog/profitbricks/requests/compute/get_all_ip_blocks.rb +5 -5
  68. data/lib/fog/profitbricks/requests/compute/get_all_lans.rb +113 -113
  69. data/lib/fog/profitbricks/requests/compute/get_all_load_balanced_nics.rb +15 -9
  70. data/lib/fog/profitbricks/requests/compute/get_all_load_balancers.rb +9 -9
  71. data/lib/fog/profitbricks/requests/compute/get_all_locations.rb +6 -6
  72. data/lib/fog/profitbricks/requests/compute/get_all_nic.rb +94 -94
  73. data/lib/fog/profitbricks/requests/compute/get_all_requests.rb +38 -38
  74. data/lib/fog/profitbricks/requests/compute/get_all_servers.rb +8 -9
  75. data/lib/fog/profitbricks/requests/compute/get_all_snapshots.rb +4 -4
  76. data/lib/fog/profitbricks/requests/compute/get_all_volumes.rb +71 -71
  77. data/lib/fog/profitbricks/requests/compute/get_attached_cdrom.rb +11 -11
  78. data/lib/fog/profitbricks/requests/compute/get_attached_volume.rb +16 -11
  79. data/lib/fog/profitbricks/requests/compute/get_datacenter.rb +4 -6
  80. data/lib/fog/profitbricks/requests/compute/get_firewall_rule.rb +8 -11
  81. data/lib/fog/profitbricks/requests/compute/get_flavor.rb +9 -9
  82. data/lib/fog/profitbricks/requests/compute/get_image.rb +7 -9
  83. data/lib/fog/profitbricks/requests/compute/get_ip_block.rb +8 -10
  84. data/lib/fog/profitbricks/requests/compute/get_lan.rb +7 -10
  85. data/lib/fog/profitbricks/requests/compute/get_load_balanced_nic.rb +16 -12
  86. data/lib/fog/profitbricks/requests/compute/get_load_balancer.rb +7 -9
  87. data/lib/fog/profitbricks/requests/compute/get_location.rb +7 -9
  88. data/lib/fog/profitbricks/requests/compute/get_nic.rb +8 -11
  89. data/lib/fog/profitbricks/requests/compute/get_request.rb +55 -57
  90. data/lib/fog/profitbricks/requests/compute/get_request_status.rb +44 -46
  91. data/lib/fog/profitbricks/requests/compute/get_server.rb +7 -10
  92. data/lib/fog/profitbricks/requests/compute/get_snapshot.rb +7 -9
  93. data/lib/fog/profitbricks/requests/compute/get_volume.rb +7 -9
  94. data/lib/fog/profitbricks/requests/compute/list_attached_cdroms.rb +8 -8
  95. data/lib/fog/profitbricks/requests/compute/list_attached_volumes.rb +18 -8
  96. data/lib/fog/profitbricks/requests/compute/reboot_server.rb +7 -11
  97. data/lib/fog/profitbricks/requests/compute/remove_nic_association.rb +9 -11
  98. data/lib/fog/profitbricks/requests/compute/restore_volume_snapshot.rb +15 -17
  99. data/lib/fog/profitbricks/requests/compute/start_server.rb +7 -11
  100. data/lib/fog/profitbricks/requests/compute/stop_server.rb +7 -11
  101. data/lib/fog/profitbricks/requests/compute/update_datacenter.rb +20 -15
  102. data/lib/fog/profitbricks/requests/compute/update_firewall_rule.rb +9 -11
  103. data/lib/fog/profitbricks/requests/compute/update_image.rb +15 -15
  104. data/lib/fog/profitbricks/requests/compute/update_lan.rb +6 -8
  105. data/lib/fog/profitbricks/requests/compute/update_load_balancer.rb +10 -12
  106. data/lib/fog/profitbricks/requests/compute/update_nic.rb +10 -12
  107. data/lib/fog/profitbricks/requests/compute/update_server.rb +10 -13
  108. data/lib/fog/profitbricks/requests/compute/update_snapshot.rb +10 -13
  109. data/lib/fog/profitbricks/requests/compute/update_volume.rb +10 -13
  110. data/lib/fog/profitbricks/version.rb +1 -1
  111. data/spec/minitest_helper.rb +1 -3
  112. data/tests/helpers/formats_helper.rb +8 -8
  113. data/tests/profitbricks/models/compute/compute_tests.rb +529 -0
  114. data/tests/profitbricks/requests/compute/composite_create_tests.rb +16 -83
  115. data/tests/profitbricks/requests/compute/flavor_tests.rb +1 -4
  116. data/tests/profitbricks/requests/compute/location_tests.rb +14 -17
  117. data/tests/profitbricks/requests/compute/nic_tests.rb +60 -70
  118. data/tests/profitbricks/requests/compute/request_tests.rb +1 -3
  119. data/tests/profitbricks/requests/compute/server_tests.rb +163 -161
  120. metadata +5 -18
@@ -1,44 +1,42 @@
1
1
  module Fog
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
- rescue => error
23
- Fog::Errors::NotFound.new(error)
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
- class Mock
28
- def delete_volume(datacenter_id, volume_id)
29
- response = Excon::Response.new
30
- response.status = 202
25
+ class Mock
26
+ def delete_volume(datacenter_id, volume_id)
27
+ response = Excon::Response.new
28
+ response.status = 202
31
29
 
32
- if vlm = self.data[:volumes]["items"].find {
33
- |volume| volume["id"] == volume_id && volume["datacenter_id"] == datacenter_id
34
- }
35
- else
36
- raise Fog::Errors::NotFound.new("The requested resource could not be found")
37
- end
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
- response
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
- :expects => [202],
20
- :method => 'DELETE',
21
- :path => "/datacenters/#{datacenter_id}/servers/#{server_id}/cdroms/#{cdrom_id}"
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 = self.data[:servers]['items'].find {
34
- |serv| serv['datacenter_id'] == datacenter_id && serv['id'] == server_id
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.new("The server resource could not be found")
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
- |cd| cd['id'] == cdrom_id
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.new("The attached volume resource could not be found")
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
- :expects => [202],
21
- :method => 'DELETE',
22
- :path => "/datacenters/#{datacenter_id}/servers/#{server_id}/volumes/#{volume_id}"
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 = self.data[:servers]['items'].find {
35
- |serv| serv['datacenter_id'] == datacenter_id && serv['id'] == server_id
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.new("The server resource could not be found")
36
+ raise Fog::Errors::NotFound, "The server resource could not be found"
39
37
  end
40
38
 
41
- if volume = server['entities']['volumes']['items'].find {
42
- |vlm| vlm['id'] == volume_id
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.new("The attached volume resource could not be found")
48
+ raise Fog::Errors::NotFound, "The attached volume resource could not be found"
46
49
  end
47
50
 
48
51
  response
@@ -50,7 +50,7 @@ module Fog
50
50
  def get_all_datacenters
51
51
  response = Excon::Response.new
52
52
  response.status = 200
53
- response.body = self.data[:datacenters]
53
+ response.body = data[:datacenters]
54
54
  response
55
55
  end
56
56
  end
@@ -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 = self.data[:firewall_rules]
56
+ firewall_rules = data[:firewall_rules]
58
57
 
59
- if nics = self.data[:firewall_rules]['items'].select {
60
- |attrib| attrib['datacenter_id'] == datacenter_id && attrib['server_id'] == server_id && attrib['nic_id'] == nic_id
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.new('The resource could not be found')
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
- 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' => 14336,
38
- 'cores' => 8
39
- },
40
- {
41
- 'flavorId' => '8b2b835d-be09-48cf-aae2-7e35aafe92d6',
42
- 'flavorName' => 'Memory Intensive Small',
43
- 'ram' => 16384,
44
- 'cores' => 2
45
- },
46
- {
47
- 'flavorId' => '45c28f8b-6a67-4f69-8c94-231d371da2b6',
48
- 'flavorName' => 'Memory Intensive Medium',
49
- 'ram' => 28672,
50
- 'cores' => 4
51
- },
52
- {
53
- 'flavorId' => '1d22436d-d958-4151-b144-43a8e180c4c4',
54
- 'flavorName' => 'Memory Intensive Large',
55
- 'ram' => 57344,
56
- 'cores' => 8
57
- },
58
- ]
59
- }
60
- response
61
- end
62
- end
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
- 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
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
- 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
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
- class Mock
57
- def get_all_images()
58
- response = Excon::Response.new
59
- response.status = 200
60
- response.body = self.data[:images]
61
- response
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