oneview-sdk 5.0.5 → 5.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91b7cf426e8de07259908123559cb374c63c79ea
4
- data.tar.gz: 62f35419a3b9d80c0f0144efb26e0d0884e280dc
3
+ metadata.gz: 26fdfbc6a1580a89ab455a59635308b016205719
4
+ data.tar.gz: 7a9a5db530abd27b0acb20ed62ec484392130405
5
5
  SHA512:
6
- metadata.gz: 41146ff0c8599d2d5b769814cb1dedcd7abdefa994a1ff03399088af3b942cb6bc1328c0c0ca9a9786f914cac12634f978c102669ca75088f1da5fa40fb38af2
7
- data.tar.gz: 045e6e936994e3af5de1fafe09703cb5d3e50640829da6966945a7717ecfc2a1cadc231eebd543f6317bb5f2f32fc0c2edec54d6c1946db05457490ba6bd6d75
6
+ metadata.gz: e4f28fecb1acc31b70a376c950395683d3ff8c46201997af4ff3753ef7352b00de859a4bc4302f94e5083b1e2cd7662cff91747219d9e4fe2a21e30838ff6a12
7
+ data.tar.gz: 524fdf8bf131b69b88a4839b198ceb6728faf369dfa38778acba0c62d9577f6760d82e50c76566d8247e246d3a656c6ca38f96297690199c1aa5ec8280edaf42
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # v5.1.0
2
+
3
+ #### Bug fixes & Enhancements
4
+ 1. The method `self.add` in the Volumes API 500 was deprecated, use the `add` method instead.
5
+ - [#275](https://github.com/HewlettPackard/oneview-sdk-ruby/issues/275) Method 'add' in Volume API 500 expects different arguments from usual 'add' implementations
6
+
1
7
  ## v5.0.5
2
8
 
3
9
  #### Bug fixes & Enhancements
data/README.md CHANGED
@@ -12,7 +12,7 @@ The OneView SDK provides a Ruby library to easily interact with HPE OneView and
12
12
  - Require the gem in your Gemfile:
13
13
 
14
14
  ```ruby
15
- gem 'oneview-sdk', '~> 5.0'
15
+ gem 'oneview-sdk', '~> 5.1'
16
16
  ```
17
17
 
18
18
  Then run `$ bundle install`
@@ -120,6 +120,7 @@ module OneviewSDK
120
120
  # @option options [String] :description The description for new volume.
121
121
  # @raise [OneviewSDK::IncompleteResource] if storage system is not found
122
122
  # @return [OneviewSDK::Volume] The volume imported.
123
+ # @deprecated Use {#add} instead.
123
124
  def self.add(client, storage_system, volume_name, is_shareable = false, options = {})
124
125
  raise IncompleteResource, 'Storage system not found!' unless storage_system.retrieve!
125
126
  data = options.merge('storageSystemUri' => storage_system['uri'], 'deviceVolumeName' => volume_name, 'isShareable' => is_shareable)
@@ -127,6 +128,20 @@ module OneviewSDK
127
128
  new(client, client.response_handler(response))
128
129
  end
129
130
 
131
+ # Initiates a process to import a volume (created external to OneView) for management by the appliance.
132
+ # @note Volumes can be added only on the storage system and storage pools managed by the appliance.
133
+ # @raise [OneviewSDK::IncompleteResource] if the client is not set or required attributes are missing
134
+ # @return [OneviewSDK::Volume] The volume imported.
135
+ def add
136
+ ensure_client
137
+ required_attributes = %w(deviceVolumeName isShareable storageSystemUri)
138
+ required_attributes.each { |k| raise IncompleteResource, "Missing required attribute: '#{k}'" unless @data.key?(k) || @data.key?(k.to_sym) }
139
+ @data['name'] ||= @data['deviceVolumeName']
140
+ response = @client.rest_post("#{BASE_URI}/from-existing", { 'body' => @data }, @api_version)
141
+ set_all(client.response_handler(response))
142
+ self
143
+ end
144
+
130
145
  # Retrieve resource details based on this resource's name or URI.
131
146
  # @note one of the UNIQUE_IDENTIFIERS, e.g. name or uri or properties['name'], must be specified in the resource
132
147
  # @return [Boolean] Whether or not retrieve was successful
@@ -11,5 +11,5 @@
11
11
 
12
12
  # Gem version defined here
13
13
  module OneviewSDK
14
- VERSION = '5.0.5'.freeze
14
+ VERSION = '5.1.0'.freeze
15
15
  end
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.5
4
+ version: 5.1.0
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-28 00:00:00.000000000 Z
14
+ date: 2017-10-03 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: thor