oneview-sdk 2.2.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +50 -0
  3. data/README.md +61 -15
  4. data/Rakefile +39 -1
  5. data/lib/oneview-sdk.rb +38 -3
  6. data/lib/oneview-sdk/cli.rb +85 -30
  7. data/lib/oneview-sdk/client.rb +21 -18
  8. data/lib/oneview-sdk/config_loader.rb +1 -1
  9. data/lib/oneview-sdk/resource.rb +44 -36
  10. data/lib/oneview-sdk/resource/api200.rb +34 -0
  11. data/lib/oneview-sdk/resource/api200/connection_template.rb +52 -0
  12. data/lib/oneview-sdk/resource/api200/datacenter.rb +81 -0
  13. data/lib/oneview-sdk/resource/api200/enclosure.rb +203 -0
  14. data/lib/oneview-sdk/resource/api200/enclosure_group.rb +86 -0
  15. data/lib/oneview-sdk/resource/api200/ethernet_network.rb +60 -0
  16. data/lib/oneview-sdk/resource/api200/fabric.rb +45 -0
  17. data/lib/oneview-sdk/resource/api200/fc_network.rb +34 -0
  18. data/lib/oneview-sdk/resource/api200/fcoe_network.rb +32 -0
  19. data/lib/oneview-sdk/resource/api200/firmware_bundle.rb +56 -0
  20. data/lib/oneview-sdk/resource/{fcoe_network.rb → api200/firmware_driver.rb} +21 -12
  21. data/lib/oneview-sdk/resource/api200/interconnect.rb +112 -0
  22. data/lib/oneview-sdk/resource/api200/lig_uplink_set.rb +84 -0
  23. data/lib/oneview-sdk/resource/api200/logical_downlink.rb +57 -0
  24. data/lib/oneview-sdk/resource/api200/logical_enclosure.rb +88 -0
  25. data/lib/oneview-sdk/resource/api200/logical_interconnect.rb +251 -0
  26. data/lib/oneview-sdk/resource/api200/logical_interconnect_group.rb +116 -0
  27. data/lib/oneview-sdk/resource/api200/logical_switch.rb +188 -0
  28. data/lib/oneview-sdk/resource/api200/logical_switch_group.rb +70 -0
  29. data/lib/oneview-sdk/resource/api200/managed_san.rb +83 -0
  30. data/lib/oneview-sdk/resource/api200/network_set.rb +68 -0
  31. data/lib/oneview-sdk/resource/api200/power_device.rb +178 -0
  32. data/lib/oneview-sdk/resource/api200/rack.rb +88 -0
  33. data/lib/oneview-sdk/resource/api200/resource.rb +18 -0
  34. data/lib/oneview-sdk/resource/api200/san_manager.rb +92 -0
  35. data/lib/oneview-sdk/resource/api200/server_hardware.rb +244 -0
  36. data/lib/oneview-sdk/resource/api200/server_hardware_type.rb +61 -0
  37. data/lib/oneview-sdk/resource/api200/server_profile.rb +385 -0
  38. data/lib/oneview-sdk/resource/api200/server_profile_template.rb +217 -0
  39. data/lib/oneview-sdk/resource/api200/storage_pool.rb +92 -0
  40. data/lib/oneview-sdk/resource/api200/storage_system.rb +157 -0
  41. data/lib/oneview-sdk/resource/api200/switch.rb +91 -0
  42. data/lib/oneview-sdk/resource/api200/unmanaged_device.rb +59 -0
  43. data/lib/oneview-sdk/resource/api200/uplink_set.rb +83 -0
  44. data/lib/oneview-sdk/resource/api200/volume.rb +192 -0
  45. data/lib/oneview-sdk/resource/api200/volume_attachment.rb +83 -0
  46. data/lib/oneview-sdk/resource/api200/volume_snapshot.rb +50 -0
  47. data/lib/oneview-sdk/resource/api200/volume_template.rb +99 -0
  48. data/lib/oneview-sdk/resource/api300.rb +66 -0
  49. data/lib/oneview-sdk/resource/api300/c7000.rb +27 -0
  50. data/lib/oneview-sdk/resource/api300/c7000/connection_template.rb +30 -0
  51. data/lib/oneview-sdk/resource/api300/c7000/datacenter.rb +22 -0
  52. data/lib/oneview-sdk/resource/api300/c7000/enclosure.rb +48 -0
  53. data/lib/oneview-sdk/resource/api300/c7000/enclosure_group.rb +37 -0
  54. data/lib/oneview-sdk/resource/api300/c7000/ethernet_network.rb +35 -0
  55. data/lib/oneview-sdk/resource/api300/c7000/fabric.rb +22 -0
  56. data/lib/oneview-sdk/resource/api300/c7000/fc_network.rb +37 -0
  57. data/lib/oneview-sdk/resource/api300/c7000/fcoe_network.rb +35 -0
  58. data/lib/oneview-sdk/resource/api300/c7000/firmware_bundle.rb +21 -0
  59. data/lib/oneview-sdk/resource/api300/c7000/firmware_driver.rb +22 -0
  60. data/lib/oneview-sdk/resource/api300/c7000/interconnect.rb +21 -0
  61. data/lib/oneview-sdk/resource/api300/c7000/lig_uplink_set.rb +21 -0
  62. data/lib/oneview-sdk/resource/api300/c7000/logical_downlink.rb +34 -0
  63. data/lib/oneview-sdk/resource/api300/c7000/logical_enclosure.rb +35 -0
  64. data/lib/oneview-sdk/resource/api300/c7000/logical_interconnect.rb +21 -0
  65. data/lib/oneview-sdk/resource/api300/c7000/logical_interconnect_group.rb +33 -0
  66. data/lib/oneview-sdk/resource/api300/c7000/logical_switch.rb +51 -0
  67. data/lib/oneview-sdk/resource/api300/c7000/logical_switch_group.rb +33 -0
  68. data/lib/oneview-sdk/resource/api300/c7000/managed_san.rb +36 -0
  69. data/lib/oneview-sdk/resource/api300/c7000/network_set.rb +37 -0
  70. data/lib/oneview-sdk/resource/api300/c7000/power_device.rb +21 -0
  71. data/lib/oneview-sdk/resource/api300/c7000/rack.rb +22 -0
  72. data/lib/oneview-sdk/resource/api300/c7000/resource.rb +21 -0
  73. data/lib/oneview-sdk/resource/api300/c7000/san_manager.rb +22 -0
  74. data/lib/oneview-sdk/resource/api300/c7000/server_hardware.rb +93 -0
  75. data/lib/oneview-sdk/resource/api300/c7000/server_hardware_type.rb +21 -0
  76. data/lib/oneview-sdk/resource/api300/c7000/server_profile.rb +33 -0
  77. data/lib/oneview-sdk/resource/api300/c7000/server_profile_template.rb +50 -0
  78. data/lib/oneview-sdk/resource/api300/c7000/storage_pool.rb +29 -0
  79. data/lib/oneview-sdk/resource/api300/c7000/storage_system.rb +21 -0
  80. data/lib/oneview-sdk/resource/api300/c7000/switch.rb +31 -0
  81. data/lib/oneview-sdk/resource/api300/c7000/unmanaged_device.rb +21 -0
  82. data/lib/oneview-sdk/resource/api300/c7000/uplink_set.rb +21 -0
  83. data/lib/oneview-sdk/resource/api300/c7000/volume.rb +22 -0
  84. data/lib/oneview-sdk/resource/api300/c7000/volume_attachment.rb +21 -0
  85. data/lib/oneview-sdk/resource/api300/c7000/volume_snapshot.rb +21 -0
  86. data/lib/oneview-sdk/resource/api300/c7000/volume_template.rb +32 -0
  87. data/lib/oneview-sdk/resource/api300/synergy.rb +27 -0
  88. data/lib/oneview-sdk/resource/api300/synergy/connection_template.rb +30 -0
  89. data/lib/oneview-sdk/resource/api300/synergy/datacenter.rb +22 -0
  90. data/lib/oneview-sdk/resource/api300/synergy/drive_enclosure.rb +71 -0
  91. data/lib/oneview-sdk/resource/api300/synergy/enclosure.rb +110 -0
  92. data/lib/oneview-sdk/resource/api300/synergy/enclosure_group.rb +43 -0
  93. data/lib/oneview-sdk/resource/api300/synergy/ethernet_network.rb +35 -0
  94. data/lib/oneview-sdk/resource/api300/synergy/fabric.rb +46 -0
  95. data/lib/oneview-sdk/resource/api300/synergy/fc_network.rb +37 -0
  96. data/lib/oneview-sdk/resource/api300/synergy/fcoe_network.rb +35 -0
  97. data/lib/oneview-sdk/resource/api300/synergy/firmware_bundle.rb +21 -0
  98. data/lib/oneview-sdk/resource/api300/synergy/firmware_driver.rb +22 -0
  99. data/lib/oneview-sdk/resource/api300/synergy/interconnect.rb +43 -0
  100. data/lib/oneview-sdk/resource/api300/synergy/lig_uplink_set.rb +21 -0
  101. data/lib/oneview-sdk/resource/api300/synergy/logical_downlink.rb +34 -0
  102. data/lib/oneview-sdk/resource/api300/synergy/logical_enclosure.rb +59 -0
  103. data/lib/oneview-sdk/resource/api300/synergy/logical_interconnect.rb +21 -0
  104. data/lib/oneview-sdk/resource/api300/synergy/logical_interconnect_group.rb +119 -0
  105. data/lib/oneview-sdk/resource/api300/synergy/logical_switch.rb +33 -0
  106. data/lib/oneview-sdk/resource/api300/synergy/logical_switch_group.rb +45 -0
  107. data/lib/oneview-sdk/resource/{firmware_driver.rb → api300/synergy/managed_san.rb} +7 -17
  108. data/lib/oneview-sdk/resource/api300/synergy/network_set.rb +37 -0
  109. data/lib/oneview-sdk/resource/api300/synergy/power_device.rb +21 -0
  110. data/lib/oneview-sdk/resource/api300/synergy/rack.rb +22 -0
  111. data/lib/oneview-sdk/resource/api300/synergy/resource.rb +21 -0
  112. data/lib/oneview-sdk/resource/api300/synergy/san_manager.rb +22 -0
  113. data/lib/oneview-sdk/resource/api300/synergy/sas_interconnect.rb +87 -0
  114. data/lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect.rb +110 -0
  115. data/lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect_group.rb +87 -0
  116. data/lib/oneview-sdk/resource/api300/synergy/server_hardware.rb +30 -0
  117. data/lib/oneview-sdk/resource/api300/synergy/server_hardware_type.rb +21 -0
  118. data/lib/oneview-sdk/resource/api300/synergy/server_profile.rb +78 -0
  119. data/lib/oneview-sdk/resource/api300/synergy/server_profile_template.rb +34 -0
  120. data/lib/oneview-sdk/resource/api300/synergy/storage_pool.rb +22 -0
  121. data/lib/oneview-sdk/resource/api300/synergy/storage_system.rb +21 -0
  122. data/lib/oneview-sdk/resource/api300/synergy/switch.rb +37 -0
  123. data/lib/oneview-sdk/resource/api300/synergy/unmanaged_device.rb +21 -0
  124. data/lib/oneview-sdk/resource/api300/synergy/uplink_set.rb +21 -0
  125. data/lib/oneview-sdk/resource/api300/synergy/volume.rb +22 -0
  126. data/lib/oneview-sdk/resource/api300/synergy/volume_attachment.rb +21 -0
  127. data/lib/oneview-sdk/resource/api300/synergy/volume_snapshot.rb +21 -0
  128. data/lib/oneview-sdk/resource/api300/synergy/volume_template.rb +32 -0
  129. data/lib/oneview-sdk/rest.rb +7 -10
  130. data/lib/oneview-sdk/ssl_helper.rb +3 -3
  131. data/lib/oneview-sdk/version.rb +1 -1
  132. data/oneview-sdk.gemspec +5 -5
  133. metadata +126 -47
  134. data/.gitattributes +0 -2
  135. data/.gitignore +0 -29
  136. data/.rubocop.yml +0 -80
  137. data/.travis.yml +0 -12
  138. data/lib/oneview-sdk/resource/connection_template.rb +0 -48
  139. data/lib/oneview-sdk/resource/datacenter.rb +0 -77
  140. data/lib/oneview-sdk/resource/enclosure.rb +0 -191
  141. data/lib/oneview-sdk/resource/enclosure_group.rb +0 -82
  142. data/lib/oneview-sdk/resource/ethernet_network.rb +0 -56
  143. data/lib/oneview-sdk/resource/fabric.rb +0 -41
  144. data/lib/oneview-sdk/resource/fc_network.rb +0 -30
  145. data/lib/oneview-sdk/resource/firmware_bundle.rb +0 -50
  146. data/lib/oneview-sdk/resource/interconnect.rb +0 -107
  147. data/lib/oneview-sdk/resource/lig_uplink_set.rb +0 -80
  148. data/lib/oneview-sdk/resource/logical_downlink.rb +0 -53
  149. data/lib/oneview-sdk/resource/logical_enclosure.rb +0 -86
  150. data/lib/oneview-sdk/resource/logical_interconnect.rb +0 -247
  151. data/lib/oneview-sdk/resource/logical_interconnect_group.rb +0 -112
  152. data/lib/oneview-sdk/resource/logical_switch.rb +0 -184
  153. data/lib/oneview-sdk/resource/logical_switch_group.rb +0 -66
  154. data/lib/oneview-sdk/resource/managed_san.rb +0 -79
  155. data/lib/oneview-sdk/resource/network_set.rb +0 -64
  156. data/lib/oneview-sdk/resource/power_device.rb +0 -174
  157. data/lib/oneview-sdk/resource/rack.rb +0 -83
  158. data/lib/oneview-sdk/resource/san_manager.rb +0 -88
  159. data/lib/oneview-sdk/resource/server_hardware.rb +0 -209
  160. data/lib/oneview-sdk/resource/server_hardware_type.rb +0 -58
  161. data/lib/oneview-sdk/resource/server_profile.rb +0 -380
  162. data/lib/oneview-sdk/resource/server_profile_template.rb +0 -213
  163. data/lib/oneview-sdk/resource/storage_pool.rb +0 -63
  164. data/lib/oneview-sdk/resource/storage_system.rb +0 -113
  165. data/lib/oneview-sdk/resource/switch.rb +0 -86
  166. data/lib/oneview-sdk/resource/unmanaged_device.rb +0 -55
  167. data/lib/oneview-sdk/resource/uplink_set.rb +0 -79
  168. data/lib/oneview-sdk/resource/volume.rb +0 -188
  169. data/lib/oneview-sdk/resource/volume_attachment.rb +0 -79
  170. data/lib/oneview-sdk/resource/volume_snapshot.rb +0 -46
  171. data/lib/oneview-sdk/resource/volume_template.rb +0 -95
@@ -0,0 +1,45 @@
1
+ # (C) Copyright 2016 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/logical_switch_group'
13
+
14
+ module OneviewSDK
15
+ module API300
16
+ module Synergy
17
+ # Logical switch group resource implementation for API300 Synergy
18
+ class LogicalSwitchGroup < OneviewSDK::API200::LogicalSwitchGroup
19
+ # Method is not available
20
+ # @raise [OneviewSDK::MethodUnavailable] method is not available
21
+ def create
22
+ unavailable_method
23
+ end
24
+
25
+ # Method is not available
26
+ # @raise [OneviewSDK::MethodUnavailable] method is not available
27
+ def update
28
+ unavailable_method
29
+ end
30
+
31
+ # Method is not available
32
+ # @raise [OneviewSDK::MethodUnavailable] method is not available
33
+ def delete
34
+ unavailable_method
35
+ end
36
+
37
+ # Method is not available
38
+ # @raise [OneviewSDK::MethodUnavailable] method is not available
39
+ def set_grouping_parameters
40
+ unavailable_method
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -9,25 +9,15 @@
9
9
  # CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
10
10
  # language governing permissions and limitations under the License.
11
11
 
12
- module OneviewSDK
13
- # Firmware driver resource implementation
14
- class FirmwareDriver < Resource
15
- BASE_URI = '/rest/firmware-drivers'.freeze
16
-
17
- # Remove resource from OneView
18
- # @return [true] if resource was removed successfully
19
- alias remove delete
12
+ require_relative '../c7000/managed_san'
20
13
 
21
- # Method is not available
22
- # @raise [OneviewSDK::MethodUnavailable] method is not available
23
- def delete
24
- unavailable_method
25
- end
14
+ module OneviewSDK
15
+ module API300
16
+ module Synergy
17
+ # Managed SAN resource implementation for API300 Synergy
18
+ class ManagedSAN < OneviewSDK::API300::C7000::ManagedSAN
26
19
 
27
- # Method is not available
28
- # @raise [OneviewSDK::MethodUnavailable] method is not available
29
- def update
30
- unavailable_method
20
+ end
31
21
  end
32
22
  end
33
23
  end
@@ -0,0 +1,37 @@
1
+ # (C) Copyright 2016 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/network_set'
13
+
14
+ module OneviewSDK
15
+ module API300
16
+ module Synergy
17
+ # Network set resource implementation for API300 Synergy
18
+ class NetworkSet < OneviewSDK::API200::NetworkSet
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
+ @data ||= {}
26
+ # Default values:
27
+ @data['connectionTemplateUri'] ||= nil
28
+ @data['nativeNetworkUri'] ||= nil
29
+ @data['networkUris'] ||= []
30
+ @data['type'] ||= 'network-setV300'
31
+ super
32
+ end
33
+
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,21 @@
1
+ # (C) Copyright 2016 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/power_device'
13
+
14
+ module OneviewSDK
15
+ module API300
16
+ module Synergy
17
+ class PowerDevice < OneviewSDK::API200::PowerDevice
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,22 @@
1
+ # (C) Copyright 2016 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
10
+ # specific language governing permissions and limitations under the License.
11
+
12
+ require_relative '../../api200/rack'
13
+
14
+ module OneviewSDK
15
+ module API300
16
+ module Synergy
17
+ # Rack resource implementation for API300 Synergy
18
+ class Rack < OneviewSDK::API200::Rack
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,21 @@
1
+ # (c) Copyright 2016 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 API300
16
+ module Synergy
17
+ class Resource < OneviewSDK::Resource
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,22 @@
1
+ # (C) Copyright 2016 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/san_manager'
13
+
14
+ module OneviewSDK
15
+ module API300
16
+ module Synergy
17
+ # SAN manager resource implementation for API300 Synergy
18
+ class SANManager < OneviewSDK::API200::SANManager
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,87 @@
1
+ # (C) Copyright 2016 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 API300
16
+ module Synergy
17
+ # SAS Interconnect resource implementation
18
+ class SASInterconnect < Resource
19
+ BASE_URI = '/rest/sas-interconnects'.freeze
20
+ TYPE_URI = '/rest/sas-interconnect-types'.freeze
21
+
22
+ # Create a resource object, associate it with a client, and set its properties.
23
+ # @param [OneviewSDK::Client] client The client object for the OneView appliance
24
+ # @param [Hash] params The options for this resource (key-value pairs)
25
+ # @param [Integer] api_ver The api version to use when interracting with this resource.
26
+ def initialize(client, params = {}, api_ver = nil)
27
+ super
28
+ end
29
+
30
+ # Method is not available
31
+ # @raise [OneviewSDK::MethodUnavailable] method is not available
32
+ def create
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
+
42
+ # Method is not available
43
+ # @raise [OneviewSDK::MethodUnavailable] method is not available
44
+ def delete
45
+ unavailable_method
46
+ end
47
+
48
+ # Retrieves SAS interconnect types
49
+ # @param [OneviewSDK::Client] client The client object for the OneView appliance
50
+ def self.get_types(client)
51
+ response = client.rest_get(TYPE_URI)
52
+ response = client.response_handler(response)
53
+ response['members']
54
+ end
55
+
56
+ # Retrieves a SAS interconnect type by name
57
+ # @param [OneviewSDK::Client] client The client object for the OneView appliance
58
+ # @param [String] name Interconnect type name
59
+ # @return [Array] Interconnect type
60
+ def self.get_type(client, name)
61
+ results = get_types(client)
62
+ results.find { |interconnect_type| interconnect_type['name'] == name }
63
+ end
64
+
65
+ # Set refresh state for SAS Interconnect
66
+ # @param [String] state Desired refresh state
67
+ def set_refresh_state(state)
68
+ ensure_client && ensure_uri
69
+ response = @client.rest_put(@data['uri'] + '/refreshState', 'body' => { refreshState: state })
70
+ refreshed_data = @client.response_handler(response)
71
+ set_all(refreshed_data)
72
+ end
73
+
74
+ # Updates specific attributes for a given SAS interconnect
75
+ # @param [String] operation operation to be performed
76
+ # @param [String] path path
77
+ # @param [String] value value
78
+ def patch(operation, path, value)
79
+ ensure_client && ensure_uri
80
+ response = @client.rest_patch(@data['uri'], 'body' => [{ op: operation, path: path, value: value }])
81
+ patched_data = @client.response_handler(response)
82
+ set_all(patched_data)
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,110 @@
1
+ # (C) Copyright 2016 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 API300
16
+ module Synergy
17
+ # SAS logical interconnect resource implementation
18
+ class SASLogicalInterconnect < Resource
19
+ BASE_URI = '/rest/sas-logical-interconnects'.freeze
20
+
21
+ # Create a resource object, associate it with a client, and set its properties.
22
+ # @param [OneviewSDK::Client] client The client object for the OneView appliance
23
+ # @param [Hash] params The options for this resource (key-value pairs)
24
+ # @param [Integer] api_ver The api version to use when interracting with this resource.
25
+ def initialize(client, params = {}, api_ver = nil)
26
+ super
27
+ end
28
+
29
+ # Method is not available
30
+ # @raise [OneviewSDK::MethodUnavailable] method is not available
31
+ def create
32
+ unavailable_method
33
+ end
34
+
35
+ # Method is not available
36
+ # @raise [OneviewSDK::MethodUnavailable] method is not available
37
+ def delete
38
+ unavailable_method
39
+ end
40
+
41
+ # Returns SAS logical interconnects to a consistent state.
42
+ # The current SAS logical interconnect state is compared to the associated SAS logical interconnect group.
43
+ # @return returns the updated object
44
+ def compliance
45
+ ensure_client && ensure_uri
46
+ update_options = {
47
+ 'If-Match' => @data['eTag'],
48
+ 'body' => { 'type' => 'sas-logical-interconnect' }
49
+ }
50
+ response = @client.rest_put(@data['uri'] + '/compliance', update_options, @api_version)
51
+ body = @client.response_handler(response)
52
+ set_all(body)
53
+ end
54
+
55
+ # Gets the installed firmware for a SAS logical interconnect.
56
+ # @return [Hash] Contains all firmware information
57
+ def get_firmware
58
+ ensure_client && ensure_uri
59
+ response = @client.rest_get(@data['uri'] + '/firmware')
60
+ @client.response_handler(response)
61
+ end
62
+
63
+ # Update firmware
64
+ # @param [String] command
65
+ # @param [OneviewSDK::FirmwareDriver] firmware_driver
66
+ # @param [Hash] firmware_options
67
+ # @raise [OneviewSDK::IncompleteResource] if the client or uri is not set
68
+ def firmware_update(command, firmware_driver, firmware_options)
69
+ ensure_client && ensure_uri
70
+ firmware_options['command'] = command
71
+ firmware_options['sppUri'] = firmware_driver['uri']
72
+ firmware_options['sppName'] = firmware_driver['name']
73
+ update_json = {
74
+ 'If-Match' => '*',
75
+ 'body' => firmware_options
76
+ }
77
+ response = @client.rest_put(@data['uri'] + '/firmware', update_json)
78
+ @client.response_handler(response)
79
+ end
80
+
81
+ # Initiates the replacement operation after a drive enclosure has been physically replaced.
82
+ # @param [String] old_serial_number
83
+ # @param [String] new_serial_number
84
+ # @raise [OneviewSDK::IncompleteResource] if the client or uri is not set
85
+ def replace_drive_enclosure(old_serial_number, new_serial_number)
86
+ ensure_client && ensure_uri
87
+ drive_enclosure_options = {
88
+ 'oldSerialNumber' => old_serial_number,
89
+ 'newSerialNumber' => new_serial_number
90
+ }
91
+ update_json = {
92
+ 'If-Match' => '*',
93
+ 'body' => drive_enclosure_options
94
+ }
95
+ response = @client.rest_post(@data['uri'] + '/replaceDriveEnclosure', update_json)
96
+ @client.response_handler(response)
97
+ 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
+ end
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,87 @@
1
+ # (C) Copyright 2016 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 API300
16
+ module Synergy
17
+ # SAS Logical interconnect group resource implementation
18
+ class SASLogicalInterconnectGroup < Resource
19
+ BASE_URI = '/rest/sas-logical-interconnect-groups'.freeze
20
+
21
+ attr_reader :bay_count
22
+
23
+ # Create a resource object, associate it with a client, and set its properties.
24
+ # @param [OneviewSDK::Client] client The client object for the OneView appliance
25
+ # @param [Hash] params The options for this resource (key-value pairs)
26
+ # @param [Integer] api_ver The api version to use when interracting with this resource.
27
+ def initialize(client, params = {}, api_ver = nil)
28
+ super
29
+ # Default values:
30
+ @data['enclosureType'] ||= 'SY12000'
31
+ @data['enclosureIndexes'] ||= [1]
32
+ @data['state'] ||= 'Active'
33
+ @data['type'] ||= 'sas-logical-interconnect-group'
34
+ @data['interconnectBaySet'] ||= 1
35
+ @data['interconnectMapTemplate'] ||= {}
36
+ @data['interconnectMapTemplate']['interconnectMapEntryTemplates'] ||= []
37
+ end
38
+
39
+ # Adds an interconnect
40
+ # @param [Fixnum] bay Bay number
41
+ # @param [String] type Interconnect type
42
+ # @raise [StandardError] if a invalid type is given then raises an error
43
+ def add_interconnect(bay, type, enclosure_index = 1)
44
+ parse_interconnect_map_template(bay, enclosure_index)
45
+ @data['interconnectMapTemplate']['interconnectMapEntryTemplates'].each do |entry|
46
+ entry['logicalLocation']['locationEntries'].each do |location|
47
+ if location['type'] == 'Bay' && location['relativeValue'] == bay
48
+ entry['permittedInterconnectTypeUri'] = OneviewSDK::API300::Synergy::SASInterconnect.get_type(@client, type)['uri']
49
+ end
50
+ end
51
+ end
52
+ rescue StandardError
53
+ list = OneviewSDK::API300::Synergy::SASInterconnect.get_types(@client).map { |t| t['name'] }
54
+ raise "SAS Interconnect type '#{type}' not found! Supported types: #{list}"
55
+ end
56
+
57
+ private
58
+
59
+ # Parse interconnect map template structure for specified bay
60
+ def parse_interconnect_map_template(bay, enclosure_index)
61
+ entry = {
62
+ 'logicalLocation' => {
63
+ 'locationEntries' => [
64
+ { 'relativeValue' => bay, 'type' => 'Bay' },
65
+ { 'relativeValue' => 1, 'type' => 'Enclosure' }
66
+ ]
67
+ },
68
+ 'enclosureIndex' => enclosure_index,
69
+ 'permittedInterconnectTypeUri' => nil
70
+ }
71
+
72
+ # If no interconnect map entry templates exist yet, add the specified entry
73
+ first_run = @data['interconnectMapTemplate']['interconnectMapEntryTemplates'].empty?
74
+ return @data['interconnectMapTemplate']['interconnectMapEntryTemplates'] << entry if first_run
75
+
76
+ # Verifies if the bay specified in the entry is already added, otherwise adds it
77
+ @data['interconnectMapTemplate']['interconnectMapEntryTemplates'].each do |single_entry|
78
+ single_entry['logicalLocation']['locationEntries'].each do |location|
79
+ return true if location['type'] == 'Bay' && location['relativeValue'] == bay
80
+ end
81
+ end
82
+ @data['interconnectMapTemplate']['interconnectMapEntryTemplates'] << entry
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end