fog-openstack 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fog/openstack/version.rb +1 -1
- data/lib/fog/storage/openstack/requests/copy_object.rb +1 -1
- data/lib/fog/storage/openstack/requests/put_object.rb +1 -1
- data/lib/fog/volume/openstack/requests/update_volume.rb +1 -12
- data/lib/fog/volume/openstack/v1/models/volume.rb +2 -1
- data/lib/fog/volume/openstack/v1/requests/update_volume.rb +17 -0
- data/lib/fog/volume/openstack/v2/models/volume.rb +1 -1
- data/lib/fog/volume/openstack/v2/requests/update_volume.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 051a0ad3e3a78f20fd942c90011fd5bce4798ccfbfe36a7b7f0e063e033d473c
|
4
|
+
data.tar.gz: 258c191d94c95a896d9d0d2a8bac64f9c8583e83e9d8913fe10a4dbf936db9e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c32d11143fa95c41d7502067fbc3f3acf818a836b115fbf942f80ac5107c832cf18a2f11afbe669a20973921b177e18cb39749d7984452f7f9f1db7f2c23bd5
|
7
|
+
data.tar.gz: b9a9b2a0509d98e6e6cfd1f1e6c0ab2e429a3f477f52081249c8a1ba5eeb745a84495e1784e66d86009e07aa42a12430d62f094432f23b09c6f7709247613717
|
@@ -12,7 +12,7 @@ module Fog
|
|
12
12
|
# * options<~Hash> - Additional headers
|
13
13
|
def copy_object(source_container_name, source_object_name, target_container_name, target_object_name, options = {})
|
14
14
|
headers = {'X-Copy-From' => "/#{source_container_name}/#{source_object_name}"}.merge(options)
|
15
|
-
request(:expects => 201,
|
15
|
+
request(:expects => [201, 202],
|
16
16
|
:headers => headers,
|
17
17
|
:method => 'PUT',
|
18
18
|
:path => "#{Fog::OpenStack.escape(target_container_name)}/#{Fog::OpenStack.escape(target_object_name)}")
|
@@ -1,18 +1,7 @@
|
|
1
1
|
module Fog
|
2
2
|
module Volume
|
3
3
|
class OpenStack
|
4
|
-
|
5
|
-
def update_volume(volume_id, data = {})
|
6
|
-
request(
|
7
|
-
:body => Fog::JSON.encode('volume' => data),
|
8
|
-
:expects => 200,
|
9
|
-
:method => 'PUT',
|
10
|
-
:path => "volumes/#{volume_id}"
|
11
|
-
)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
module Mock
|
4
|
+
module Mock
|
16
5
|
def update_volume(volume_id, data = {})
|
17
6
|
response = Excon::Response.new
|
18
7
|
response.status = 200
|
@@ -17,7 +17,8 @@ module Fog
|
|
17
17
|
data = if id.nil?
|
18
18
|
service.create_volume(display_name, display_description, size, attributes)
|
19
19
|
else
|
20
|
-
|
20
|
+
attrib = attributes.select { |key| %i(display_name display_description metadata).include?(key) }
|
21
|
+
service.update_volume(id, attrib)
|
21
22
|
end
|
22
23
|
merge_attributes(data.body['volume'])
|
23
24
|
true
|
@@ -1,2 +1,19 @@
|
|
1
1
|
require 'fog/volume/openstack/requests/update_volume'
|
2
2
|
require 'fog/volume/openstack/v1/requests/real'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Volume
|
6
|
+
class OpenStack
|
7
|
+
module Real
|
8
|
+
def update_volume(volume_id, data = {})
|
9
|
+
request(
|
10
|
+
:body => Fog::JSON.encode('volume' => data),
|
11
|
+
:expects => 200,
|
12
|
+
:method => 'PUT',
|
13
|
+
:path => "volumes/#{volume_id}"
|
14
|
+
)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -17,7 +17,7 @@ module Fog
|
|
17
17
|
data = if id.nil?
|
18
18
|
service.create_volume(name, description, size, attributes)
|
19
19
|
else
|
20
|
-
service.update_volume(id, attributes.
|
20
|
+
service.update_volume(id, attributes.select { |key| %i(name description metadata).include?(key) })
|
21
21
|
end
|
22
22
|
merge_attributes(data.body['volume'])
|
23
23
|
true
|
@@ -1,2 +1,20 @@
|
|
1
1
|
require 'fog/volume/openstack/requests/update_volume'
|
2
2
|
require 'fog/volume/openstack/v2/requests/real'
|
3
|
+
|
4
|
+
module Fog
|
5
|
+
module Volume
|
6
|
+
class OpenStack
|
7
|
+
module Real
|
8
|
+
def update_volume(volume_id, data = {})
|
9
|
+
data = data.select { |key| key == :name || key == :description || key == :metadata }
|
10
|
+
request(
|
11
|
+
:body => Fog::JSON.encode('volume' => data),
|
12
|
+
:expects => 200,
|
13
|
+
:method => 'PUT',
|
14
|
+
:path => "volumes/#{volume_id}"
|
15
|
+
)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-openstack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Darby
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|