oneview-sdk 5.1.2 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 899ba54ec47fe13bb589e3ceec403e36102afd59
4
- data.tar.gz: 69620d1543c21f1fdc1d18833771c17af436cc52
3
+ metadata.gz: 58b9a81d170cc1b91566d7d694cc01f803665c07
4
+ data.tar.gz: 6d09d8ba0c00feb06ac1f22439dc74d8d7ed7ede
5
5
  SHA512:
6
- metadata.gz: c99c3995a517c79210e4a95817bf8fb364ad34d4c14289960efff3346c7523e7b7fb40539b8086983ae28e707c9195f9fafc68178a08b33cbf9e27ae7fc7c80b
7
- data.tar.gz: a841438bc3b89dd8556cb52b908131c3d1adc7a85a9e721ddb7aa0feafbc89edc203bc63df2fbe85d8f963bb3580c4da670fecb0adc1927864e043143839953a
6
+ metadata.gz: fe28a4daee9ba088b9fc419d0f8dab782d3659fc9e5c8e6f6a295e9e020e27ee63a6c233574901836f131f1f7fab7df94a6393e61be02f5a45d2349f93328fd3
7
+ data.tar.gz: 5a627e7bfedb752ced67ccdf24ffc3c142e69cfffc14afcce12381a9ea8761a62356b850cbc05aeff588bacce5bc373dfbb333d03ed4458d26f48ec96328e3ed
@@ -1,3 +1,9 @@
1
+ ## v5.2.0
2
+
3
+ #### New Features:
4
+ - [#287](https://github.com/HewlettPackard/oneview-sdk-ruby/issues/287) Missing method to apply/reapply configuration to Interconnect of API500
5
+ - [#290](https://github.com/HewlettPackard/oneview-sdk-ruby/issues/290) Missing update ports method for Switch on API 300
6
+
1
7
  ## v5.1.2
2
8
  #### Notes
3
9
  This release adds the [endpoints-support.md](endpoints-support.md) file to the repository, in order to track implemented endpoints and what is in the scope of this SDK.
@@ -12,7 +18,7 @@ Also adds the [TESTING.md](TESTING.md) file to the repository, in order to guide
12
18
  #### Bug fixes & Enhancements
13
19
  - [#279](https://github.com/HewlettPackard/oneview-sdk-ruby/issues/279) Bug when setting the Storage Pool and Snapshot Pool when trying to make an update
14
20
 
15
- # v5.1.0
21
+ ## v5.1.0
16
22
 
17
23
  #### Bug fixes & Enhancements
18
24
  1. The method `self.add` in the Volumes API 500 was deprecated, use the `add` method instead.
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.1'
15
+ gem 'oneview-sdk', '~> 5.2'
16
16
  ```
17
17
 
18
18
  Then run `$ bundle install`
@@ -182,7 +182,7 @@ OneviewSDK::Datacenter.find_by(@client, width: 11000).map(&:remove)
182
182
  |<sub>/rest/interconnects</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
183
183
  |<sub>/rest/interconnects/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
184
184
  |<sub>/rest/interconnects/{id}</sub> | PATCH | :white_check_mark: | :white_check_mark: | :white_check_mark: |
185
- |<sub>/rest/interconnects/{id}/configuration</sub> | PUT | :heavy_minus_sign: | :heavy_minus_sign: | |
185
+ |<sub>/rest/interconnects/{id}/configuration</sub> | PUT | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: |
186
186
  |<sub>/rest/interconnects/{id}/pluggableModuleInformation</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: |
187
187
  |<sub>/rest/interconnects/{id}/ports</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
188
188
  |<sub>/rest/interconnects/{id}/ports</sub> | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: |
@@ -472,7 +472,7 @@ OneviewSDK::Datacenter.find_by(@client, width: 11000).map(&:remove)
472
472
  |<sub>/rest/switches/{id}/environmentalConfiguration</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
473
473
  |<sub>/rest/switches/{id}/statistics</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
474
474
  |<sub>/rest/switches/{id}/statistics/{portName:.+}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
475
- |<sub>/rest/switches/{id}/update-ports</sub> | PUT | :heavy_minus_sign: | | |
475
+ |<sub>/rest/switches/{id}/update-ports</sub> | PUT | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
476
476
  | **Switch Type** |
477
477
  |<sub>/rest/switch-types</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
478
478
  |<sub>/rest/switch-types/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
@@ -12,11 +12,14 @@
12
12
  require 'time'
13
13
  require 'date'
14
14
  require_relative 'resource'
15
+ require_relative '../../resource_helper'
15
16
 
16
17
  module OneviewSDK
17
18
  module API200
18
19
  # Enclosure resource implementation
19
20
  class Enclosure < Resource
21
+ include OneviewSDK::ResourceHelper::ConfigurationOperation
22
+
20
23
  BASE_URI = '/rest/enclosures'.freeze
21
24
  UNIQUE_IDENTIFIERS = %w(name uri serialNumber activeOaPreferredIP standbyOaPreferredIP).freeze
22
25
 
@@ -83,15 +86,6 @@ module OneviewSDK
83
86
  self
84
87
  end
85
88
 
86
- # Reapplies the enclosure configuration
87
- def configuration
88
- ensure_client && ensure_uri
89
- response = @client.rest_put(@data['uri'] + '/configuration', {}, @api_version)
90
- new_data = @client.response_handler(response)
91
- set_all(new_data)
92
- end
93
-
94
-
95
89
  # Refreshes the enclosure along with all of its components
96
90
  # @param [String] state NotRefreshing, RefreshFailed, RefreshPending, Refreshing
97
91
  # @param [Hash] options Optional force fields for refreshing the enclosure
@@ -10,11 +10,14 @@
10
10
  # language governing permissions and limitations under the License.
11
11
 
12
12
  require_relative 'resource'
13
+ require_relative '../../resource_helper'
13
14
 
14
15
  module OneviewSDK
15
16
  module API200
16
17
  # Logical interconnect resource implementation
17
18
  class LogicalInterconnect < Resource
19
+ include OneviewSDK::ResourceHelper::ConfigurationOperation
20
+
18
21
  BASE_URI = '/rest/logical-interconnects'.freeze
19
22
  LOCATION_URI = '/rest/logical-interconnects/locations/interconnects'.freeze
20
23
 
@@ -135,15 +138,6 @@ module OneviewSDK
135
138
  set_all(body)
136
139
  end
137
140
 
138
- # Asynchronously applies or re-applies the logical interconnect configuration to all managed interconnects
139
- # @return returns the updated object
140
- def configuration
141
- ensure_client && ensure_uri
142
- response = @client.rest_put(@data['uri'] + '/configuration', {}, @api_version)
143
- body = client.response_handler(response)
144
- set_all(body)
145
- end
146
-
147
141
  # Gets a collection of uplink ports from the member interconnects
148
142
  # which are eligible for assignment to an analyzer port.
149
143
  # @return [Hash] Hash of uplink ports eligibles for assignment to an analyzer port
@@ -16,7 +16,7 @@ module OneviewSDK
16
16
  module API200
17
17
  # Server profile resource implementation
18
18
  class ServerProfile < Resource
19
- include OneviewSDK::ResourceHelper
19
+ include OneviewSDK::ResourceHelper::PatchOperation
20
20
  BASE_URI = '/rest/server-profiles'.freeze
21
21
  UNIQUE_IDENTIFIERS = %w(name uri associatedServer serialNumber serverHardwareUri).freeze
22
22
 
@@ -17,7 +17,7 @@ module OneviewSDK
17
17
  module C7000
18
18
  # Logical Enclosure resource implementation on API300 C7000
19
19
  class LogicalEnclosure < OneviewSDK::API200::LogicalEnclosure
20
- include OneviewSDK::ResourceHelper
20
+ include OneviewSDK::ResourceHelper::PatchOperation
21
21
 
22
22
  def initialize(client, params = {}, api_ver = nil)
23
23
  super
@@ -25,6 +25,18 @@ module OneviewSDK
25
25
  def set_scope_uris(scope_uris)
26
26
  patch('replace', '/scopeUris', scope_uris)
27
27
  end
28
+
29
+ # Updates the switch ports
30
+ # @note Only the ports under the management of OneView and those that are unlinked are supported for update
31
+ # @param [String] portName port name
32
+ # @param [Hash] attributes hash with attributes and values to be changed
33
+ def update_port(portName, attributes)
34
+ ensure_uri
35
+ port = @data['ports'].find { |p| p['portName'] == portName }
36
+ attributes.each { |key, value| port[key.to_s] = value }
37
+ response = @client.rest_put(@data['uri'] + '/update-ports', 'body' => [port])
38
+ @client.response_handler(response)
39
+ end
28
40
  end
29
41
  end
30
42
  end
@@ -16,6 +16,8 @@ module OneviewSDK
16
16
  module Synergy
17
17
  # SAS logical interconnect resource implementation
18
18
  class SASLogicalInterconnect < Resource
19
+ include OneviewSDK::ResourceHelper::ConfigurationOperation
20
+
19
21
  BASE_URI = '/rest/sas-logical-interconnects'.freeze
20
22
 
21
23
  # Create a resource object, associate it with a client, and set its properties.
@@ -95,15 +97,6 @@ module OneviewSDK
95
97
  response = @client.rest_post(@data['uri'] + '/replaceDriveEnclosure', update_json)
96
98
  @client.response_handler(response)
97
99
  end
98
-
99
- # Asynchronously applies or re-applies the SAS logical interconnect configuration to all managed interconnects
100
- # @return returns the updated object
101
- def configuration
102
- ensure_client && ensure_uri
103
- response = @client.rest_put(@data['uri'] + '/configuration', {}, @api_version)
104
- body = client.response_handler(response)
105
- set_all(body)
106
- end
107
100
  end
108
101
  end
109
102
  end
@@ -16,6 +16,7 @@ module OneviewSDK
16
16
  module C7000
17
17
  # Interconnect resource implementation on API500 C7000
18
18
  class Interconnect < OneviewSDK::API300::C7000::Interconnect
19
+ include OneviewSDK::ResourceHelper::ConfigurationOperation
19
20
 
20
21
  # Gets all the Small Form-factor Pluggable (SFP) instances from an interconnect.
21
22
  # @return [Hash] hash The Small Form-factor Pluggable (SFP) instances of the interconnect
@@ -17,7 +17,7 @@ module OneviewSDK
17
17
  module C7000
18
18
  # Contains helper methods to include operation with firmware of a given logical enclosure resource
19
19
  module FirmwareHelper
20
- include ResourceHelper
20
+ include ResourceHelper::PatchOperation
21
21
 
22
22
  # Updates the firmware attributes of a given logical enclosure resource
23
23
  # @param [Hash] attributes Hash with firmware attributes
@@ -12,19 +12,33 @@
12
12
  module OneviewSDK
13
13
  # Contains helper methods to include certain functionalities on resources
14
14
  module ResourceHelper
15
- # Performs a specific patch operation for the given resource.
16
- # If the resource supports the particular operation, the operation is performed
17
- # and a response is returned to the caller with the results.
18
- # @param [String] operation The operation to be performed
19
- # @param [String] path The path of operation
20
- # @param [String] value The value
21
- # @note This attribute is subject to incompatible changes in future release versions, including redefinition or removal.
22
- def patch(operation, path, value = nil, header_options = {})
23
- ensure_client && ensure_uri
24
- options = { 'body' => [op: operation, path: path, value: value] }
25
- options = options.merge(header_options)
26
- response = @client.rest_patch(@data['uri'], options, @api_version)
27
- @client.response_handler(response)
15
+ # Contains helper method to call patch endpoint of resource
16
+ module PatchOperation
17
+ # Performs a specific patch operation for the given resource.
18
+ # If the resource supports the particular operation, the operation is performed
19
+ # and a response is returned to the caller with the results.
20
+ # @param [String] operation The operation to be performed
21
+ # @param [String] path The path of operation
22
+ # @param [String] value The value
23
+ # @note This attribute is subject to incompatible changes in future release versions, including redefinition or removal.
24
+ def patch(operation, path, value = nil, header_options = {})
25
+ ensure_client && ensure_uri
26
+ options = { 'body' => [op: operation, path: path, value: value] }
27
+ options = options.merge(header_options)
28
+ response = @client.rest_patch(@data['uri'], options, @api_version)
29
+ @client.response_handler(response)
30
+ end
31
+ end
32
+
33
+ # Contains helper method to call configuration endpoint of resource
34
+ module ConfigurationOperation
35
+ # Reapplies the configuration
36
+ def configuration
37
+ ensure_client && ensure_uri
38
+ response = @client.rest_put(@data['uri'] + '/configuration', {}, @api_version)
39
+ new_data = @client.response_handler(response)
40
+ set_all(new_data)
41
+ end
28
42
  end
29
43
  end
30
44
  end
@@ -11,5 +11,5 @@
11
11
 
12
12
  # Gem version defined here
13
13
  module OneviewSDK
14
- VERSION = '5.1.2'.freeze
14
+ VERSION = '5.2.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.1.2
4
+ version: 5.2.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-10-11 00:00:00.000000000 Z
14
+ date: 2017-10-19 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: thor