fog-profitbricks 4.0.0 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -3
- data/Rakefile +1 -1
- data/examples/pb_demo.rb +2 -8
- data/lib/fog/profitbricks/compute.rb +249 -105
- data/lib/fog/profitbricks/models/compute/datacenter.rb +63 -9
- data/lib/fog/profitbricks/models/compute/firewall_rule.rb +3 -1
- data/lib/fog/profitbricks/models/compute/group.rb +7 -4
- data/lib/fog/profitbricks/models/compute/image.rb +3 -0
- data/lib/fog/profitbricks/models/compute/ip_block.rb +2 -0
- data/lib/fog/profitbricks/models/compute/lan.rb +2 -1
- data/lib/fog/profitbricks/models/compute/load_balancer.rb +2 -0
- data/lib/fog/profitbricks/models/compute/location.rb +1 -0
- data/lib/fog/profitbricks/models/compute/nic.rb +2 -0
- data/lib/fog/profitbricks/models/compute/request.rb +1 -0
- data/lib/fog/profitbricks/models/compute/resource.rb +1 -0
- data/lib/fog/profitbricks/models/compute/server.rb +5 -1
- data/lib/fog/profitbricks/models/compute/share.rb +4 -2
- data/lib/fog/profitbricks/models/compute/snapshot.rb +2 -0
- data/lib/fog/profitbricks/models/compute/user.rb +4 -1
- data/lib/fog/profitbricks/requests/compute/add_share.rb +2 -2
- data/lib/fog/profitbricks/requests/compute/add_user_to_group.rb +4 -4
- data/lib/fog/profitbricks/requests/compute/associate_nic_to_load_balancer.rb +1 -3
- data/lib/fog/profitbricks/requests/compute/attach_cdrom.rb +18 -17
- data/lib/fog/profitbricks/requests/compute/attach_volume.rb +9 -2
- data/lib/fog/profitbricks/requests/compute/create_datacenter.rb +71 -25
- data/lib/fog/profitbricks/requests/compute/create_firewall_rule.rb +11 -4
- data/lib/fog/profitbricks/requests/compute/create_group.rb +22 -4
- data/lib/fog/profitbricks/requests/compute/create_ip_block.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/create_lan.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/create_load_balancer.rb +4 -43
- data/lib/fog/profitbricks/requests/compute/create_nic.rb +4 -0
- data/lib/fog/profitbricks/requests/compute/create_server.rb +6 -1
- data/lib/fog/profitbricks/requests/compute/create_user.rb +20 -1
- data/lib/fog/profitbricks/requests/compute/create_volume.rb +5 -1
- data/lib/fog/profitbricks/requests/compute/create_volume_snapshot.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/delete_group.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/delete_share.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/delete_user.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/detach_cdrom.rb +3 -3
- data/lib/fog/profitbricks/requests/compute/get_attached_cdrom.rb +3 -3
- data/lib/fog/profitbricks/requests/compute/get_datacenter.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/get_firewall_rule.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/get_group.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/get_image.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/get_ip_block.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/get_lan.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/get_load_balanced_nic.rb +7 -1
- data/lib/fog/profitbricks/requests/compute/get_load_balancer.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/get_location.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/get_nic.rb +2 -2
- data/lib/fog/profitbricks/requests/compute/get_request.rb +8 -1
- data/lib/fog/profitbricks/requests/compute/get_resource_by_type.rb +8 -1
- data/lib/fog/profitbricks/requests/compute/get_resources_by_type.rb +9 -3
- data/lib/fog/profitbricks/requests/compute/get_server.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/get_share.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/get_snapshot.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/get_user.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/get_volume.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/list_attached_cdroms.rb +3 -1
- data/lib/fog/profitbricks/requests/compute/list_attached_volumes.rb +3 -3
- data/lib/fog/profitbricks/requests/compute/remove_user_from_group.rb +2 -2
- data/lib/fog/profitbricks/requests/compute/update_datacenter.rb +3 -8
- data/lib/fog/profitbricks/requests/compute/update_firewall_rule.rb +1 -1
- data/lib/fog/profitbricks/requests/compute/update_group.rb +5 -5
- data/lib/fog/profitbricks/requests/compute/update_nic.rb +2 -4
- data/lib/fog/profitbricks/requests/compute/update_server.rb +3 -4
- data/lib/fog/profitbricks/requests/compute/update_share.rb +3 -3
- data/lib/fog/profitbricks/requests/compute/update_user.rb +2 -2
- data/lib/fog/profitbricks/version.rb +1 -1
- data/tests/profitbricks/models/compute/compute_tests.rb +1071 -267
- metadata +26 -33
- data/gemfiles/Gemfile.1.8.7 +0 -6
- data/tests/profitbricks/requests/compute/composite_create_tests.rb +0 -174
- data/tests/profitbricks/requests/compute/flavor_tests.rb +0 -40
- data/tests/profitbricks/requests/compute/location_tests.rb +0 -42
- data/tests/profitbricks/requests/compute/nic_tests.rb +0 -268
- data/tests/profitbricks/requests/compute/request_tests.rb +0 -50
- data/tests/profitbricks/requests/compute/server_tests.rb +0 -462
@@ -9,6 +9,10 @@ module Fog
|
|
9
9
|
# * name<~String> - The name of the data center
|
10
10
|
# * region<~String> - The physical location where the data center will be created ("de/fkb", "de/fra", or "us/las")
|
11
11
|
# * description<~String> - An optional description for the data center, e.g. staging, production.
|
12
|
+
# * servers<~Hash> - A collection of servers
|
13
|
+
# * volumes<~Hash> - A collection of volumes
|
14
|
+
# * loadbalancers<~Hash> - A collection of loadbalancers
|
15
|
+
# * lans<~Hash> - A collection of LANs in a data center
|
12
16
|
#
|
13
17
|
# ==== Returns
|
14
18
|
# * response<~Excon::Response>:
|
@@ -36,50 +40,92 @@ module Fog
|
|
36
40
|
# * lans<~Hash> - A collection that represents the LANs in a data center
|
37
41
|
#
|
38
42
|
# {ProfitBricks API Documentation}[https://devops.profitbricks.com/api/cloud/v2/#create-a-data-center]
|
39
|
-
def create_datacenter(options)
|
43
|
+
def create_datacenter(options, entities={})
|
40
44
|
datacenter = {
|
41
|
-
:properties => options
|
45
|
+
:properties => options,
|
46
|
+
:entities => entities
|
42
47
|
}
|
43
48
|
|
44
49
|
request(
|
45
|
-
:expects
|
46
|
-
:method
|
47
|
-
:path
|
48
|
-
:body
|
50
|
+
:expects => [202],
|
51
|
+
:method => 'POST',
|
52
|
+
:path => '/datacenters',
|
53
|
+
:body => Fog::JSON.encode(datacenter)
|
49
54
|
)
|
50
55
|
end
|
51
56
|
end
|
52
57
|
|
53
58
|
class Mock
|
54
|
-
def create_datacenter(
|
59
|
+
def create_datacenter(options, entities={})
|
60
|
+
dc = {
|
61
|
+
:properties => options,
|
62
|
+
:entities => entities
|
63
|
+
}
|
64
|
+
|
65
|
+
if dc[:properties][:location] == nil
|
66
|
+
raise Excon::Error::HTTPStatus, "Attribute 'location' is required"
|
67
|
+
end
|
68
|
+
|
55
69
|
dc_3_id = Fog::UUID.uuid
|
70
|
+
dc_4_id = Fog::UUID.uuid
|
56
71
|
datacenter = {
|
57
72
|
'id' => dc_3_id,
|
58
73
|
'type' => 'datacenter',
|
59
|
-
'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{dc_3_id}",
|
60
|
-
'metadata' => {
|
61
|
-
'createdDate' => '2016-07-31T15:41:27Z',
|
62
|
-
'createdBy' => 'test@stackpointcloud.com',
|
63
|
-
'etag' => '5b91832ee85a758568d4523a86bd8702',
|
64
|
-
'lastModifiedDate' => '2016-07-31T15:41:27Z',
|
65
|
-
'lastModifiedBy' => 'test@stackpointcloud.com',
|
66
|
-
'state' => 'AVAILABLE'
|
67
|
-
},
|
68
74
|
'properties' => {
|
69
|
-
'name' =>
|
70
|
-
'description' =>
|
71
|
-
'location' =>
|
72
|
-
'version' => 1
|
73
|
-
'features' => [
|
74
|
-
|
75
|
-
]
|
75
|
+
'name' => dc[:properties][:name],
|
76
|
+
'description' => dc[:properties][:description],
|
77
|
+
'location' => dc[:properties][:location],
|
78
|
+
'version' => 1
|
76
79
|
}
|
77
80
|
}
|
78
81
|
|
82
|
+
if entities != nil and entities != {}
|
83
|
+
datacenter = {
|
84
|
+
'id' => dc_4_id,
|
85
|
+
'type' => 'datacenter',
|
86
|
+
'properties' => {
|
87
|
+
'name' => dc[:properties][:name],
|
88
|
+
'description' => dc[:properties][:description],
|
89
|
+
'location' => dc[:properties][:location],
|
90
|
+
'version' => 1
|
91
|
+
},
|
92
|
+
'entities' => {
|
93
|
+
'volumes' => {
|
94
|
+
'items' =>
|
95
|
+
[
|
96
|
+
{
|
97
|
+
'type' => 'volume',
|
98
|
+
'properties' => {
|
99
|
+
'name' => dc[:entities][:volumes][:items][0][:properties][:name],
|
100
|
+
'type' => dc[:entities][:volumes][:items][0][:properties][:type],
|
101
|
+
'size' => dc[:entities][:volumes][:items][0][:properties][:size],
|
102
|
+
'bus' => dc[:entities][:volumes][:items][0][:properties][:bus],
|
103
|
+
'licenceType' => dc[:entities][:volumes][:items][0][:properties][:licenceType],
|
104
|
+
'availabilityZone' => dc[:entities][:volumes][:items][0][:properties][:availabilityZone]
|
105
|
+
}
|
106
|
+
}
|
107
|
+
]
|
108
|
+
},
|
109
|
+
'servers' => {
|
110
|
+
'items' =>
|
111
|
+
[
|
112
|
+
{
|
113
|
+
'properties' => {
|
114
|
+
'name' => dc[:entities][:servers][:items][0][:properties][:name],
|
115
|
+
'cores' => dc[:entities][:servers][:items][0][:properties][:cores],
|
116
|
+
'ram' => dc[:entities][:servers][:items][0][:properties][:ram]
|
117
|
+
}
|
118
|
+
}
|
119
|
+
]
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}
|
123
|
+
end
|
124
|
+
|
79
125
|
data[:datacenters]['items'] << datacenter
|
80
|
-
response
|
126
|
+
response = Excon::Response.new
|
81
127
|
response.status = 202
|
82
|
-
response.body
|
128
|
+
response.body = datacenter
|
83
129
|
response
|
84
130
|
end
|
85
131
|
end
|
@@ -71,10 +71,17 @@ module Fog
|
|
71
71
|
response = Excon::Response.new
|
72
72
|
response.status = 202
|
73
73
|
|
74
|
+
properties = {}
|
75
|
+
properties['name'] = options[:name]
|
76
|
+
properties['protocol'] = options[:protocol]
|
77
|
+
properties['source_mac'] = options[:sourceMac]
|
78
|
+
properties['port_range_start'] = options[:portRangeStart]
|
79
|
+
properties['port_range_end'] = options[:portRangeEnd]
|
80
|
+
|
74
81
|
firewall_rule_id = Fog::UUID.uuid
|
75
82
|
firewall_rule = {
|
76
83
|
'id' => firewall_rule_id,
|
77
|
-
'type' => '
|
84
|
+
'type' => 'firewall-rule',
|
78
85
|
'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{datacenter_id}/servers/#{server_id}/nics/#{nic_id}/firewallrules/#{firewall_rule_id}",
|
79
86
|
'metadata' => {
|
80
87
|
'createdDate' => '2015-03-18T19:00:51Z',
|
@@ -84,10 +91,10 @@ module Fog
|
|
84
91
|
'lastModifiedBy' => 'test@stackpointcloud.com',
|
85
92
|
'state' => 'AVAILABLE'
|
86
93
|
},
|
87
|
-
'properties' =>
|
94
|
+
'properties' => properties,
|
88
95
|
'datacenter_id' => datacenter_id,
|
89
|
-
'server_id'
|
90
|
-
'nic_id'
|
96
|
+
'server_id' => server_id,
|
97
|
+
'nic_id' => nic_id
|
91
98
|
}
|
92
99
|
|
93
100
|
data[:firewall_rules]['items'] << firewall_rule
|
@@ -56,6 +56,10 @@ module Fog
|
|
56
56
|
|
57
57
|
class Mock
|
58
58
|
def create_group(options = {})
|
59
|
+
if options[:name] == nil
|
60
|
+
raise Excon::Error::HTTPStatus, "Attribute 'name' is required"
|
61
|
+
end
|
62
|
+
|
59
63
|
response = Excon::Response.new
|
60
64
|
response.status = 202
|
61
65
|
|
@@ -67,10 +71,24 @@ module Fog
|
|
67
71
|
'href' => "https=>//api.profitbricks.com/rest/v4/um/groups/#{group_id}",
|
68
72
|
'properties' => {
|
69
73
|
'name' => options[:name],
|
70
|
-
'createDataCenter' => options[:
|
71
|
-
'createSnapshot' => options[:
|
72
|
-
'reserveIp' => options[:
|
73
|
-
'accessActivityLog' => options[:
|
74
|
+
'createDataCenter' => options[:createDataCenter],
|
75
|
+
'createSnapshot' => options[:createSnapshot],
|
76
|
+
'reserveIp' => options[:reserveIp],
|
77
|
+
'accessActivityLog' => options[:accessActivityLog]
|
78
|
+
},
|
79
|
+
'entities' => {
|
80
|
+
'users' => {
|
81
|
+
'id' => "#{group_id}/owns",
|
82
|
+
'type' => 'collection',
|
83
|
+
'href' => "https://api.profitbricks.com/cloudapi/v4/um/groups/#{group_id}/users",
|
84
|
+
'items' => []
|
85
|
+
},
|
86
|
+
'resources' => {
|
87
|
+
'id' => "#{group_id}/resources",
|
88
|
+
'type' => 'collection',
|
89
|
+
'href' => "https://api.profitbricks.com/cloudapi/v4/um/groups/#{group_id}/resources",
|
90
|
+
'items' => []
|
91
|
+
}
|
74
92
|
}
|
75
93
|
}
|
76
94
|
|
@@ -60,7 +60,7 @@ module Fog
|
|
60
60
|
'state' => 'AVAILABLE'
|
61
61
|
},
|
62
62
|
'properties' => {
|
63
|
-
'ips' => ["777.777.777.777", "888.888.888.888"
|
63
|
+
'ips' => ["777.777.777.777", "888.888.888.888"],
|
64
64
|
'location' => options[:location],
|
65
65
|
'size' => options[:size],
|
66
66
|
'name' => options[:name]
|
@@ -52,17 +52,18 @@ module Fog
|
|
52
52
|
end
|
53
53
|
|
54
54
|
class Mock
|
55
|
-
def create_load_balancer(datacenter_id, properties = {},
|
55
|
+
def create_load_balancer(datacenter_id, properties = {}, entities = {})
|
56
56
|
response = Excon::Response.new
|
57
57
|
response.status = 202
|
58
58
|
|
59
59
|
load_balancer_id = Fog::UUID.uuid
|
60
60
|
nic_1_id = Fog::UUID.uuid
|
61
61
|
serv_1_id = Fog::UUID.uuid
|
62
|
+
properties[:ip] = '123.456.789'
|
62
63
|
|
63
64
|
load_balancer = {
|
64
65
|
'id' => load_balancer_id,
|
65
|
-
'type' => '
|
66
|
+
'type' => 'loadbalancer',
|
66
67
|
'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{datacenter_id}/loadbalancers/#{load_balancer_id}",
|
67
68
|
'metadata' => {
|
68
69
|
'createdDate' => '2015-03-18T19:00:51Z',
|
@@ -73,47 +74,7 @@ module Fog
|
|
73
74
|
'state' => 'AVAILABLE'
|
74
75
|
},
|
75
76
|
'properties' => properties,
|
76
|
-
'entities' =>
|
77
|
-
'balancednics' => {
|
78
|
-
'id' => "#{load_balancer_id}/balancednics",
|
79
|
-
'type' => 'collection',
|
80
|
-
'href' => "https=>//api.profitbricks.com/rest/v2/datacenters/#{datacenter_id}/loadbalancers/#{load_balancer_id}/balancednics",
|
81
|
-
'items' =>
|
82
|
-
[
|
83
|
-
{
|
84
|
-
'id' => nic_1_id,
|
85
|
-
'type' => 'nic',
|
86
|
-
'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{datacenter_id}/servers/#{serv_1_id}/nics/#{nic_1_id}",
|
87
|
-
'metadata' => {
|
88
|
-
'createdDate' => '2015-03-18T19:00:51Z',
|
89
|
-
'createdBy' => 'test@stackpointcloud.com',
|
90
|
-
'etag' => 'faa67fbacb1c0e2e02cf9650657251f1',
|
91
|
-
'lastModifiedDate' => '2015-03-18T19:00:51Z',
|
92
|
-
'lastModifiedBy' => 'test@stackpointcloud.com',
|
93
|
-
'state' => 'AVAILABLE'
|
94
|
-
},
|
95
|
-
'properties' => {
|
96
|
-
'name' => 'FogTestLoadBalancedNIC_1',
|
97
|
-
'mac' => '02:01:36:5f:09:da',
|
98
|
-
'ips' => ['10.9.194.12'],
|
99
|
-
'dhcp' => 'true',
|
100
|
-
'lan' => 2,
|
101
|
-
'firewallActive' => 'false'
|
102
|
-
},
|
103
|
-
'entities' => {
|
104
|
-
'firewallrules' => {
|
105
|
-
'id' => "#{nic_1_id}/firewallrules",
|
106
|
-
'type' => 'collection',
|
107
|
-
'href' => "https://api.profitbricks.com/rest/v2/datacenters/#{datacenter_id}/servers/#{serv_1_id}/nics/#{nic_1_id}/firewallrules",
|
108
|
-
'items' => []
|
109
|
-
}
|
110
|
-
},
|
111
|
-
'datacenter_id' => datacenter_id,
|
112
|
-
'load_balancer_id' => load_balancer_id
|
113
|
-
}
|
114
|
-
]
|
115
|
-
}
|
116
|
-
},
|
77
|
+
'entities' => entities,
|
117
78
|
'datacenter_id' => datacenter_id
|
118
79
|
}
|
119
80
|
|
@@ -89,6 +89,10 @@ module Fog
|
|
89
89
|
|
90
90
|
class Mock
|
91
91
|
def create_nic(datacenter_id, server_id, options = {}, entities = {})
|
92
|
+
if options[:lan] == nil
|
93
|
+
raise Excon::Error::HTTPStatus, "Attribute 'lan' is required"
|
94
|
+
end
|
95
|
+
|
92
96
|
response = Excon::Response.new
|
93
97
|
response.status = 202
|
94
98
|
|
@@ -133,6 +133,10 @@ module Fog
|
|
133
133
|
|
134
134
|
class Mock
|
135
135
|
def create_server(datacenter_id, properties = {}, entities = {})
|
136
|
+
if properties[:cores] == nil
|
137
|
+
raise Excon::Error::HTTPStatus, "Attribute 'cores' is required"
|
138
|
+
end
|
139
|
+
|
136
140
|
server_id = Fog::UUID.uuid
|
137
141
|
|
138
142
|
volume_id = if entities[:volumes] && entities[:volumes]['items'] && entities[:volumes]['items'][0] && entities[:volumes]['items'][0]['id']
|
@@ -160,7 +164,8 @@ module Fog
|
|
160
164
|
'ram' => properties[:ram],
|
161
165
|
'availabilityZone' => properties[:availabilityZone],
|
162
166
|
'vmState' => 'RUNNING',
|
163
|
-
'cpuFamily' => properties[:cpuFamily]
|
167
|
+
'cpuFamily' => properties[:cpuFamily],
|
168
|
+
'bootVolume' => properties[:bootVolume]
|
164
169
|
}
|
165
170
|
}
|
166
171
|
|
@@ -48,6 +48,10 @@ module Fog
|
|
48
48
|
|
49
49
|
class Mock
|
50
50
|
def create_user(options = {})
|
51
|
+
if options[:email] == nil
|
52
|
+
raise Excon::Error::HTTPStatus, "Attribute 'email' is required"
|
53
|
+
end
|
54
|
+
|
51
55
|
response = Excon::Response.new
|
52
56
|
response.status = 202
|
53
57
|
|
@@ -68,7 +72,22 @@ module Fog
|
|
68
72
|
'email' => options[:email],
|
69
73
|
'password' => options[:password],
|
70
74
|
'administrator' => options[:administrator],
|
71
|
-
'forceSecAuth' => options[:force_sec_auth]
|
75
|
+
'forceSecAuth' => options[:force_sec_auth] || false,
|
76
|
+
'secAuthActive' => options[:sec_auth_active] || false
|
77
|
+
},
|
78
|
+
'entities' => {
|
79
|
+
'owns' => {
|
80
|
+
'id' => "#{user_id}/owns",
|
81
|
+
'type' => 'collection',
|
82
|
+
'href' => "https://api.profitbricks.com/cloudapi/v4/um/users/#{user_id}/owns",
|
83
|
+
'items' => []
|
84
|
+
},
|
85
|
+
'groups' => {
|
86
|
+
'id' => "#{user_id}/groups",
|
87
|
+
'type' => 'collection',
|
88
|
+
'href' => "https://api.profitbricks.com/cloudapi/v4/um/users/#{user_id}/groups",
|
89
|
+
'items' => []
|
90
|
+
}
|
72
91
|
}
|
73
92
|
}
|
74
93
|
|
@@ -77,13 +77,17 @@ module Fog
|
|
77
77
|
response = Excon::Response.new
|
78
78
|
response.status = 202
|
79
79
|
|
80
|
+
if options[:size] == nil
|
81
|
+
raise Excon::Error::HTTPStatus, "Attribute 'size' is required"
|
82
|
+
end
|
83
|
+
|
80
84
|
if datacenter = data[:datacenters]['items'].find do |attrib|
|
81
85
|
attrib['id'] == datacenter_id
|
82
86
|
end
|
83
87
|
|
84
88
|
datacenter['version'] += 1 if datacenter['version']
|
85
89
|
else
|
86
|
-
raise
|
90
|
+
raise Excon::Error::HTTPStatus, 'Resource does not exist'
|
87
91
|
end
|
88
92
|
|
89
93
|
volume_id = Fog::UUID.uuid
|
@@ -32,14 +32,14 @@ module Fog
|
|
32
32
|
serv['datacenter_id'] == datacenter_id && serv['id'] == server_id
|
33
33
|
end
|
34
34
|
else
|
35
|
-
raise
|
35
|
+
raise Excon::Error::HTTPStatus, "Resource does not exist"
|
36
36
|
end
|
37
37
|
|
38
|
-
if cdrom = server['
|
38
|
+
if cdrom = server['cdroms']['items'].find do |cd|
|
39
39
|
cd['id'] == cdrom_id
|
40
40
|
end
|
41
41
|
else
|
42
|
-
raise
|
42
|
+
raise Excon::Error::HTTPStatus, "Resource does not exist"
|
43
43
|
end
|
44
44
|
|
45
45
|
response
|
@@ -57,14 +57,14 @@ module Fog
|
|
57
57
|
serv['datacenter_id'] == datacenter_id && serv['id'] == server_id
|
58
58
|
end
|
59
59
|
else
|
60
|
-
raise
|
60
|
+
raise Excon::Error::HTTPStatus, "Resource does not exist"
|
61
61
|
end
|
62
62
|
|
63
|
-
if cdrom = server['
|
63
|
+
if cdrom = server['cdroms']['items'].find do |cd|
|
64
64
|
cd['id'] == cdrom_image_id
|
65
65
|
end
|
66
66
|
else
|
67
|
-
raise
|
67
|
+
raise Excon::Error::HTTPStatus, "Resource does not exist"
|
68
68
|
end
|
69
69
|
|
70
70
|
response = Excon::Response.new
|