oneview-sdk 5.0.4 → 5.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/oneview-sdk/resource/api500/c7000/volume.rb +28 -0
- data/lib/oneview-sdk/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91b7cf426e8de07259908123559cb374c63c79ea
|
4
|
+
data.tar.gz: 62f35419a3b9d80c0f0144efb26e0d0884e280dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41146ff0c8599d2d5b769814cb1dedcd7abdefa994a1ff03399088af3b942cb6bc1328c0c0ca9a9786f914cac12634f978c102669ca75088f1da5fa40fb38af2
|
7
|
+
data.tar.gz: 045e6e936994e3af5de1fafe09703cb5d3e50640829da6966945a7717ecfc2a1cadc231eebd543f6317bb5f2f32fc0c2edec54d6c1946db05457490ba6bd6d75
|
data/CHANGELOG.md
CHANGED
@@ -127,6 +127,25 @@ module OneviewSDK
|
|
127
127
|
new(client, client.response_handler(response))
|
128
128
|
end
|
129
129
|
|
130
|
+
# Retrieve resource details based on this resource's name or URI.
|
131
|
+
# @note one of the UNIQUE_IDENTIFIERS, e.g. name or uri or properties['name'], must be specified in the resource
|
132
|
+
# @return [Boolean] Whether or not retrieve was successful
|
133
|
+
def retrieve!
|
134
|
+
return super unless @data['properties']
|
135
|
+
results = find_by_name_in_properties
|
136
|
+
return false unless results.size == 1
|
137
|
+
set_all(results.first.data)
|
138
|
+
true
|
139
|
+
end
|
140
|
+
|
141
|
+
# Check if a resource exists
|
142
|
+
# @note one of the UNIQUE_IDENTIFIERS, e.g. name or uri or properties['name'], must be specified in the resource
|
143
|
+
# @return [Boolean] Whether or not resource exists
|
144
|
+
def exists?
|
145
|
+
return super unless @data['properties']
|
146
|
+
find_by_name_in_properties.size == 1
|
147
|
+
end
|
148
|
+
|
130
149
|
private
|
131
150
|
|
132
151
|
# Gets the storage volume template URI
|
@@ -151,6 +170,15 @@ module OneviewSDK
|
|
151
170
|
def generate_snapshot_data(name, description = nil)
|
152
171
|
{ description: description, name: name }
|
153
172
|
end
|
173
|
+
|
174
|
+
# Gets the volume
|
175
|
+
# @raise [OneviewSDK::IncompleteResource] if the name parameter is not set
|
176
|
+
# @return [Array] the array of volumes
|
177
|
+
def find_by_name_in_properties
|
178
|
+
name = @data['properties']['name'] || @data['properties'][:name]
|
179
|
+
raise IncompleteResource, 'Must set resource name within the properties before trying to retrieve!' unless name
|
180
|
+
self.class.find_by(@client, 'name' => name)
|
181
|
+
end
|
154
182
|
end
|
155
183
|
end
|
156
184
|
end
|
data/lib/oneview-sdk/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oneview-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henrique Diomede
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2017-09-
|
14
|
+
date: 2017-09-28 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: thor
|