oneview-sdk 4.4.0 → 4.5.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: f612360de75ca04a4285a2c70fdd9b7312bf4d5f
4
- data.tar.gz: e19d35eb77ca7736fa771a9db6839506edbc1edf
3
+ metadata.gz: d330a16a6a84c68210fea84a700d43d409077e3d
4
+ data.tar.gz: aff1e0ad46101044e8b30fae1fda4dbe17c0aa88
5
5
  SHA512:
6
- metadata.gz: 600b8c1be525144a6e5d016445f9882c45c3ae720ece26df26717c6bfe6ee66894b8608264cd67944aba4929c8c1ea91e3972976fa51bea3e2d08ac83ce58386
7
- data.tar.gz: e77487b5c6dfab5c60638ca25934425d7761caac90a6f37129ae74711d48e4d14f7b54af1fff49bf0a2781f27eafb6b3a61d29e90d999262c174d1fd7e23e5c4
6
+ metadata.gz: b75d45d90e9a0f4bdd29753f210d6bf13ed8b3d9bd249b64ece801da25c3655634a5425a64d6eb36fe602d425b3b9fd3389308ccb47d1b1414a47d130962bcf0
7
+ data.tar.gz: b066b83e43e25b9fa05fc3f931a9e307614c25b4abc91369a5d9f6a20eae43899fc19c7ad508318935d6a7e73e9a7be23489db95faa1878d966efb46f26988a0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## v4.5.0
2
+
3
+ #### New Resources:
4
+ - Event
5
+ - ID Pools
6
+
7
+ #### Bug fixes & Enhancements
8
+ - [#235](https://github.com/HewlettPackard/oneview-sdk-ruby/issues/235) Example file for Synergy LIG fails with 'Interconnect type or Logical Downlink not found!'
9
+
10
+
1
11
  ## v4.4.0
2
12
 
3
13
  #### 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', '~> 4.4'
15
+ gem 'oneview-sdk', '~> 4.5'
16
16
  ```
17
17
 
18
18
  Then run `$ bundle install`
@@ -0,0 +1,43 @@
1
+ # (C) Copyright 2017 Hewlett Packard Enterprise Development LP
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # You may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software distributed
8
+ # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ # CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
10
+ # language governing permissions and limitations under the License.
11
+
12
+ require_relative 'resource'
13
+
14
+ module OneviewSDK
15
+ module API200
16
+ # Event resource implementation
17
+ class Event < Resource
18
+ BASE_URI = '/rest/events'.freeze
19
+
20
+ # Create a resource object, associate it with a client, and set its properties.
21
+ # @param [OneviewSDK::Client] client The client object for the OneView appliance
22
+ # @param [Hash] params The options for this resource (key-value pairs)
23
+ # @param [Integer] api_ver The api version to use when interracting with this resource.
24
+ def initialize(client, params = {}, api_ver = nil)
25
+ super
26
+ # Default values:
27
+ @data['type'] ||= 'EventResourceV3'
28
+ end
29
+
30
+ # Method is not available
31
+ # @raise [OneviewSDK::MethodUnavailable] method is not available
32
+ def delete(*)
33
+ unavailable_method
34
+ end
35
+
36
+ # Method is not available
37
+ # @raise [OneviewSDK::MethodUnavailable] method is not available
38
+ def update(*)
39
+ unavailable_method
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,122 @@
1
+ # (C) Copyright 2017 Hewlett Packard Enterprise Development LP
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # You may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software distributed
8
+ # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ # CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
10
+ # language governing permissions and limitations under the License.
11
+
12
+ require_relative 'resource'
13
+
14
+ module OneviewSDK
15
+ module API200
16
+ # Id pool resource implementation
17
+ class IDPool < Resource
18
+ BASE_URI = '/rest/id-pools'.freeze
19
+
20
+ # Method is not available
21
+ # @raise [OneviewSDK::MethodUnavailable] method is not available
22
+ def create(*)
23
+ unavailable_method
24
+ end
25
+
26
+ # Method is not available
27
+ # @raise [OneviewSDK::MethodUnavailable] method is not available
28
+ def delete(*)
29
+ unavailable_method
30
+ end
31
+
32
+ # Gets a pool along with the list of ranges present in it.
33
+ # @param [String] pool_type The type of the pool. Values: (ipv4, vmac, vsn, vwwn)
34
+ # @raise [OneviewSDK::IncompleteResource] if the client
35
+ # @return [OneviewSDK::API200::IDPool] The response with IDs list, count and if this is a valid allocator
36
+ def get_pool(pool_type)
37
+ ensure_client
38
+ response = @client.rest_get("#{BASE_URI}/#{pool_type}")
39
+ body = @client.response_handler(response)
40
+ set_all(body)
41
+ self
42
+ end
43
+
44
+ # Allocates one or more IDs from a according the amount informed
45
+ # @param [String] pool_type The type of the pool. Values: (ipv4, vmac, vsn, vwwn)
46
+ # @param [Array<String>] id_list The IDs list (or IDs separeted by comma)
47
+ # @return [Hash] The list of allocated IDs
48
+ # @note This API cannot be used to allocate IPv4 IDs. Allocation of IPv4 IDs is allowed only at the range level allocator.
49
+ def allocate_id_list(pool_type, *id_list)
50
+ allocate(pool_type, idList: id_list.flatten)
51
+ end
52
+
53
+ # Allocates a specific amount of IDs from a pool
54
+ # @param [String] pool_type The type of the pool. Values: (ipv4, vmac, vsn, vwwn)
55
+ # @param [Integer] count The amount of IDs to allocate
56
+ # @return [Hash] The list of allocated IDs
57
+ # @note This API cannot be used to allocate IPv4 IDs. Allocation of IPv4 IDs is allowed only at the range level allocator.
58
+ def allocate_count(pool_type, count)
59
+ allocate(pool_type, count: count)
60
+ end
61
+
62
+ # Checks the range availability in the ID pool
63
+ # @param [String] pool_type The type of the pool. Values: (ipv4, vmac, vsn, vwwn)
64
+ # @param [Array<String>] id_list The IDs list (or IDs separeted by comma)
65
+ # @raise [OneviewSDK::IncompleteResource] if the client is not set
66
+ # @return [Hash] The hash with eTag and list of ID's
67
+ def check_range_availability(pool_type, *id_list)
68
+ ensure_client
69
+ response = @client.rest_get("#{BASE_URI}/#{pool_type}/checkrangeavailability?idList=#{id_list.flatten.join('&idList=')}")
70
+ @client.response_handler(response)
71
+ end
72
+
73
+ # Collects one or more IDs to be returned to a pool
74
+ # @param [String] pool_type The type of the pool. Values: (ipv4, vmac, vsn, vwwn)
75
+ # @param [Array<String>] id_list The list of IDs (or IDs separeted by comma) to be collected
76
+ # @raise [OneviewSDK::IncompleteResource] if the client is not set
77
+ # @return [Hash] The list of IDs collected
78
+ def collect_ids(pool_type, *id_list)
79
+ ensure_client
80
+ response = @client.rest_put("#{BASE_URI}/#{pool_type}/collector", 'body' => { 'idList' => id_list.flatten })
81
+ @client.response_handler(response)
82
+ end
83
+
84
+ # Generates and returns a random range
85
+ # @param [String] pool_type The type of the pool. Values: (ipv4, vmac, vsn, vwwn)
86
+ # @raise [OneviewSDK::IncompleteResource] if the client is not set
87
+ # @return [Hash] A random range
88
+ # @note This API is not applicable for the IPv4 IDs.
89
+ def generate_random_range(pool_type)
90
+ ensure_client
91
+ response = @client.rest_get("#{BASE_URI}/#{pool_type}/generate")
92
+ @client.response_handler(response)
93
+ end
94
+
95
+ # Validates a set of user specified IDs to reserve in the pool
96
+ # @param [String] pool_type The type of the pool. Values: (ipv4, vmac, vsn, vwwn)
97
+ # @param [Array<String>] id_list The list of IDs (or IDs separeted by comma)
98
+ # @raise [OneviewSDK::IncompleteResource] if the client is not set
99
+ # @return [Boolean] Returns true if is valid
100
+ def validate_id_list(pool_type, *id_list)
101
+ ensure_client
102
+ response = @client.rest_put("#{BASE_URI}/#{pool_type}/validate", 'body' => { 'idList' => id_list.flatten })
103
+ body = @client.response_handler(response)
104
+ body['valid']
105
+ end
106
+
107
+ private
108
+
109
+ # Allocates one or more IDs from a pool
110
+ # @param [String] pool_type The type of the pool. Values: (ipv4, vmac, vsn, vwwn)
111
+ # @param [Hash] params The parameters used to allocate IDs
112
+ # @raise [OneviewSDK::IncompleteResource] if the client is not set
113
+ # @return [Hash] The list of allocated IDs
114
+ # @note This API cannot be used to allocate IPv4 IDs. Allocation of IPv4 IDs is allowed only at the range level allocator.
115
+ def allocate(pool_type, params)
116
+ ensure_client
117
+ response = @client.rest_put("#{BASE_URI}/#{pool_type}/allocator", 'body' => params)
118
+ @client.response_handler(response)
119
+ end
120
+ end
121
+ end
122
+ end
@@ -44,14 +44,14 @@ module OneviewSDK
44
44
  # @param [String] interconnect model name
45
45
  # @param [Fixnum] enclosure number for multi-frame configurations
46
46
  def add_uplink(bay, port, type = nil, enclosure_index = 1)
47
- enclosure_index = type && type.include?('Virtual Connect SE 16Gb FC Module') ? -1 : enclosure_index
48
- port =
49
- if type
50
- fetch_relative_value_of(port, type)
51
- else
52
- # Detect Integer port: for example 67 or '67'
53
- port.to_s == port.to_i.to_s ? port.to_i : relative_value_of(port)
54
- end
47
+ enclosure_index = type && type.include?('Virtual Connect SE 16Gb FC Module for Synergy') ? -1 : enclosure_index
48
+ port = if type
49
+ fetch_relative_value_of(port, type)
50
+ else
51
+ # Detect Integer port: for example 67 or '67'
52
+ port.to_s == port.to_i.to_s ? port.to_i : relative_value_of(port)
53
+ end
54
+
55
55
  entry = {
56
56
  'desiredSpeed' => 'Auto',
57
57
  'logicalLocation' => {
@@ -0,0 +1,22 @@
1
+ # (C) Copyright 2017 Hewlett Packard Enterprise Development LP
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # You may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software distributed
8
+ # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ # CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
10
+ # language governing permissions and limitations under the License.
11
+
12
+ require_relative '../../api200/event'
13
+
14
+ module OneviewSDK
15
+ module API300
16
+ module C7000
17
+ # Event resource implementation for API300 C7000
18
+ class Event < OneviewSDK::API200::Event
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # (C) Copyright 2017 Hewlett Packard Enterprise Development LP
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # You may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software distributed
8
+ # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ # CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
10
+ # language governing permissions and limitations under the License.
11
+
12
+ require_relative '../../api200/id_pool'
13
+
14
+ module OneviewSDK
15
+ module API300
16
+ module C7000
17
+ # IDPool resource implementation for API300 C7000
18
+ class IDPool < OneviewSDK::API200::IDPool
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # (C) Copyright 2017 Hewlett Packard Enterprise Development LP
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # You may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software distributed
8
+ # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ # CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
10
+ # language governing permissions and limitations under the License.
11
+
12
+ require_relative '../../api200/event'
13
+
14
+ module OneviewSDK
15
+ module API300
16
+ module Synergy
17
+ # Event resource implementation for API300 Synergy
18
+ class Event < OneviewSDK::API200::Event
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # (C) Copyright 2017 Hewlett Packard Enterprise Development LP
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # You may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software distributed
8
+ # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ # CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
10
+ # language governing permissions and limitations under the License.
11
+
12
+ require_relative '../../api200/id_pool'
13
+
14
+ module OneviewSDK
15
+ module API300
16
+ module Synergy
17
+ # IDPool resource implementation for API300 Synergy
18
+ class IDPool < OneviewSDK::API200::IDPool
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # (C) Copyright 2017 Hewlett Packard Enterprise Development LP
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # You may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software distributed
8
+ # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ # CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
10
+ # language governing permissions and limitations under the License.
11
+
12
+ require_relative '../../api200/event'
13
+
14
+ module OneviewSDK
15
+ module API500
16
+ module C7000
17
+ # Event resource implementation for API500 C7000
18
+ class Event < OneviewSDK::API200::Event
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ # (C) Copyright 2017 Hewlett Packard Enterprise Development LP
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # You may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software distributed
8
+ # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ # CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
10
+ # language governing permissions and limitations under the License.
11
+
12
+ require_relative '../../api200/event'
13
+
14
+ module OneviewSDK
15
+ module API500
16
+ module Synergy
17
+ # Event resource implementation for API500 Synergy
18
+ class Event < OneviewSDK::API200::Event
19
+ end
20
+ end
21
+ end
22
+ end
@@ -11,5 +11,5 @@
11
11
 
12
12
  # Gem version defined here
13
13
  module OneviewSDK
14
- VERSION = '4.4.0'.freeze
14
+ VERSION = '4.5.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: 4.4.0
4
+ version: 4.5.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-05-16 00:00:00.000000000 Z
14
+ date: 2017-06-13 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: thor
@@ -222,11 +222,13 @@ files:
222
222
  - lib/oneview-sdk/resource/api200/enclosure.rb
223
223
  - lib/oneview-sdk/resource/api200/enclosure_group.rb
224
224
  - lib/oneview-sdk/resource/api200/ethernet_network.rb
225
+ - lib/oneview-sdk/resource/api200/event.rb
225
226
  - lib/oneview-sdk/resource/api200/fabric.rb
226
227
  - lib/oneview-sdk/resource/api200/fc_network.rb
227
228
  - lib/oneview-sdk/resource/api200/fcoe_network.rb
228
229
  - lib/oneview-sdk/resource/api200/firmware_bundle.rb
229
230
  - lib/oneview-sdk/resource/api200/firmware_driver.rb
231
+ - lib/oneview-sdk/resource/api200/id_pool.rb
230
232
  - lib/oneview-sdk/resource/api200/interconnect.rb
231
233
  - lib/oneview-sdk/resource/api200/lig_uplink_set.rb
232
234
  - lib/oneview-sdk/resource/api200/logical_downlink.rb
@@ -262,11 +264,13 @@ files:
262
264
  - lib/oneview-sdk/resource/api300/c7000/enclosure.rb
263
265
  - lib/oneview-sdk/resource/api300/c7000/enclosure_group.rb
264
266
  - lib/oneview-sdk/resource/api300/c7000/ethernet_network.rb
267
+ - lib/oneview-sdk/resource/api300/c7000/event.rb
265
268
  - lib/oneview-sdk/resource/api300/c7000/fabric.rb
266
269
  - lib/oneview-sdk/resource/api300/c7000/fc_network.rb
267
270
  - lib/oneview-sdk/resource/api300/c7000/fcoe_network.rb
268
271
  - lib/oneview-sdk/resource/api300/c7000/firmware_bundle.rb
269
272
  - lib/oneview-sdk/resource/api300/c7000/firmware_driver.rb
273
+ - lib/oneview-sdk/resource/api300/c7000/id_pool.rb
270
274
  - lib/oneview-sdk/resource/api300/c7000/interconnect.rb
271
275
  - lib/oneview-sdk/resource/api300/c7000/lig_uplink_set.rb
272
276
  - lib/oneview-sdk/resource/api300/c7000/logical_downlink.rb
@@ -303,11 +307,13 @@ files:
303
307
  - lib/oneview-sdk/resource/api300/synergy/enclosure.rb
304
308
  - lib/oneview-sdk/resource/api300/synergy/enclosure_group.rb
305
309
  - lib/oneview-sdk/resource/api300/synergy/ethernet_network.rb
310
+ - lib/oneview-sdk/resource/api300/synergy/event.rb
306
311
  - lib/oneview-sdk/resource/api300/synergy/fabric.rb
307
312
  - lib/oneview-sdk/resource/api300/synergy/fc_network.rb
308
313
  - lib/oneview-sdk/resource/api300/synergy/fcoe_network.rb
309
314
  - lib/oneview-sdk/resource/api300/synergy/firmware_bundle.rb
310
315
  - lib/oneview-sdk/resource/api300/synergy/firmware_driver.rb
316
+ - lib/oneview-sdk/resource/api300/synergy/id_pool.rb
311
317
  - lib/oneview-sdk/resource/api300/synergy/interconnect.rb
312
318
  - lib/oneview-sdk/resource/api300/synergy/lig_uplink_set.rb
313
319
  - lib/oneview-sdk/resource/api300/synergy/logical_downlink.rb
@@ -347,6 +353,7 @@ files:
347
353
  - lib/oneview-sdk/resource/api500/c7000/enclosure.rb
348
354
  - lib/oneview-sdk/resource/api500/c7000/enclosure_group.rb
349
355
  - lib/oneview-sdk/resource/api500/c7000/ethernet_network.rb
356
+ - lib/oneview-sdk/resource/api500/c7000/event.rb
350
357
  - lib/oneview-sdk/resource/api500/c7000/fabric.rb
351
358
  - lib/oneview-sdk/resource/api500/c7000/fc_network.rb
352
359
  - lib/oneview-sdk/resource/api500/c7000/fcoe_network.rb
@@ -388,6 +395,7 @@ files:
388
395
  - lib/oneview-sdk/resource/api500/synergy/enclosure.rb
389
396
  - lib/oneview-sdk/resource/api500/synergy/enclosure_group.rb
390
397
  - lib/oneview-sdk/resource/api500/synergy/ethernet_network.rb
398
+ - lib/oneview-sdk/resource/api500/synergy/event.rb
391
399
  - lib/oneview-sdk/resource/api500/synergy/fabric.rb
392
400
  - lib/oneview-sdk/resource/api500/synergy/fc_network.rb
393
401
  - lib/oneview-sdk/resource/api500/synergy/fcoe_network.rb