oneview-sdk 5.3.0 → 5.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +43 -0
  3. data/README.md +7 -2
  4. data/bin/oneview-sdk-ruby +0 -0
  5. data/endpoints-support.md +296 -288
  6. data/lib/oneview-sdk.rb +1 -1
  7. data/lib/oneview-sdk/image-streamer/resource/api500.rb +39 -0
  8. data/lib/oneview-sdk/image-streamer/resource/api500/plan_script.rb +22 -0
  9. data/lib/oneview-sdk/image-streamer/resource/api600.rb +39 -0
  10. data/lib/oneview-sdk/image-streamer/resource/api600/plan_script.rb +31 -0
  11. data/lib/oneview-sdk/image_streamer.rb +1 -1
  12. data/lib/oneview-sdk/resource.rb +11 -0
  13. data/lib/oneview-sdk/resource/api600.rb +66 -0
  14. data/lib/oneview-sdk/resource/api600/c7000.rb +27 -0
  15. data/lib/oneview-sdk/resource/api600/c7000/client_certificate.rb +22 -0
  16. data/lib/oneview-sdk/resource/api600/c7000/connection_template.rb +22 -0
  17. data/lib/oneview-sdk/resource/api600/c7000/datacenter.rb +22 -0
  18. data/lib/oneview-sdk/resource/api600/c7000/enclosure.rb +71 -0
  19. data/lib/oneview-sdk/resource/api600/c7000/enclosure_group.rb +39 -0
  20. data/lib/oneview-sdk/resource/api600/c7000/ethernet_network.rb +47 -0
  21. data/lib/oneview-sdk/resource/api600/c7000/event.rb +22 -0
  22. data/lib/oneview-sdk/resource/api600/c7000/fabric.rb +22 -0
  23. data/lib/oneview-sdk/resource/api600/c7000/fc_network.rb +35 -0
  24. data/lib/oneview-sdk/resource/api600/c7000/fcoe_network.rb +33 -0
  25. data/lib/oneview-sdk/resource/api600/c7000/firmware_bundle.rb +21 -0
  26. data/lib/oneview-sdk/resource/api600/c7000/firmware_driver.rb +22 -0
  27. data/lib/oneview-sdk/resource/api600/c7000/id_pool.rb +22 -0
  28. data/lib/oneview-sdk/resource/api600/c7000/interconnect.rb +34 -0
  29. data/lib/oneview-sdk/resource/api600/c7000/internal_link_set.rb +22 -0
  30. data/lib/oneview-sdk/resource/api600/c7000/lig_uplink_set.rb +21 -0
  31. data/lib/oneview-sdk/resource/api600/c7000/logical_downlink.rb +22 -0
  32. data/lib/oneview-sdk/resource/api600/c7000/logical_enclosure.rb +22 -0
  33. data/lib/oneview-sdk/resource/api600/c7000/logical_interconnect.rb +39 -0
  34. data/lib/oneview-sdk/resource/api600/c7000/logical_interconnect_group.rb +33 -0
  35. data/lib/oneview-sdk/resource/api600/c7000/logical_switch.rb +32 -0
  36. data/lib/oneview-sdk/resource/api600/c7000/logical_switch_group.rb +32 -0
  37. data/lib/oneview-sdk/resource/api600/c7000/login_detail.rb +23 -0
  38. data/lib/oneview-sdk/resource/api600/c7000/managed_san.rb +22 -0
  39. data/lib/oneview-sdk/resource/api600/c7000/network_set.rb +32 -0
  40. data/lib/oneview-sdk/resource/api600/c7000/power_device.rb +21 -0
  41. data/lib/oneview-sdk/resource/api600/c7000/rack.rb +22 -0
  42. data/lib/oneview-sdk/resource/api600/c7000/resource.rb +21 -0
  43. data/lib/oneview-sdk/resource/api600/c7000/san_manager.rb +22 -0
  44. data/lib/oneview-sdk/resource/api600/c7000/scope.rb +92 -0
  45. data/lib/oneview-sdk/resource/api600/c7000/server_hardware.rb +44 -0
  46. data/lib/oneview-sdk/resource/api600/c7000/server_hardware_type.rb +22 -0
  47. data/lib/oneview-sdk/resource/api600/c7000/server_profile.rb +50 -0
  48. data/lib/oneview-sdk/resource/api600/c7000/server_profile_template.rb +49 -0
  49. data/lib/oneview-sdk/resource/api600/c7000/storage_pool.rb +32 -0
  50. data/lib/oneview-sdk/resource/api600/c7000/storage_system.rb +22 -0
  51. data/lib/oneview-sdk/resource/api600/c7000/switch.rb +22 -0
  52. data/lib/oneview-sdk/resource/api600/c7000/unmanaged_device.rb +22 -0
  53. data/lib/oneview-sdk/resource/api600/c7000/uplink_set.rb +33 -0
  54. data/lib/oneview-sdk/resource/api600/c7000/user.rb +22 -0
  55. data/lib/oneview-sdk/resource/api600/c7000/version.rb +23 -0
  56. data/lib/oneview-sdk/resource/api600/c7000/volume.rb +22 -0
  57. data/lib/oneview-sdk/resource/api600/c7000/volume_attachment.rb +45 -0
  58. data/lib/oneview-sdk/resource/api600/c7000/volume_snapshot.rb +32 -0
  59. data/lib/oneview-sdk/resource/api600/c7000/volume_template.rb +34 -0
  60. data/lib/oneview-sdk/resource/api600/c7000/web_server_certificate.rb +22 -0
  61. data/lib/oneview-sdk/resource/api600/synergy.rb +27 -0
  62. data/lib/oneview-sdk/resource/api600/synergy/client_certificate.rb +22 -0
  63. data/lib/oneview-sdk/resource/api600/synergy/connection_template.rb +22 -0
  64. data/lib/oneview-sdk/resource/api600/synergy/datacenter.rb +22 -0
  65. data/lib/oneview-sdk/resource/api600/synergy/drive_enclosure.rb +22 -0
  66. data/lib/oneview-sdk/resource/api600/synergy/enclosure.rb +71 -0
  67. data/lib/oneview-sdk/resource/api600/synergy/enclosure_group.rb +41 -0
  68. data/lib/oneview-sdk/resource/api600/synergy/ethernet_network.rb +47 -0
  69. data/lib/oneview-sdk/resource/api600/synergy/event.rb +22 -0
  70. data/lib/oneview-sdk/resource/api600/synergy/fabric.rb +22 -0
  71. data/lib/oneview-sdk/resource/api600/synergy/fc_network.rb +35 -0
  72. data/lib/oneview-sdk/resource/api600/synergy/fcoe_network.rb +33 -0
  73. data/lib/oneview-sdk/resource/api600/synergy/firmware_bundle.rb +21 -0
  74. data/lib/oneview-sdk/resource/api600/synergy/firmware_driver.rb +22 -0
  75. data/lib/oneview-sdk/resource/api600/synergy/id_pool.rb +22 -0
  76. data/lib/oneview-sdk/resource/api600/synergy/interconnect.rb +23 -0
  77. data/lib/oneview-sdk/resource/api600/synergy/internal_link_set.rb +22 -0
  78. data/lib/oneview-sdk/resource/api600/synergy/lig_uplink_set.rb +21 -0
  79. data/lib/oneview-sdk/resource/api600/synergy/logical_downlink.rb +22 -0
  80. data/lib/oneview-sdk/resource/api600/synergy/logical_enclosure.rb +22 -0
  81. data/lib/oneview-sdk/resource/api600/synergy/logical_interconnect.rb +39 -0
  82. data/lib/oneview-sdk/resource/api600/synergy/logical_interconnect_group.rb +22 -0
  83. data/lib/oneview-sdk/resource/api600/synergy/login_detail.rb +23 -0
  84. data/lib/oneview-sdk/resource/api600/synergy/managed_san.rb +22 -0
  85. data/lib/oneview-sdk/resource/api600/synergy/network_set.rb +22 -0
  86. data/lib/oneview-sdk/resource/api600/synergy/os_deployment_plan.rb +22 -0
  87. data/lib/oneview-sdk/resource/api600/synergy/power_device.rb +21 -0
  88. data/lib/oneview-sdk/resource/api600/synergy/rack.rb +22 -0
  89. data/lib/oneview-sdk/resource/api600/synergy/resource.rb +21 -0
  90. data/lib/oneview-sdk/resource/api600/synergy/san_manager.rb +22 -0
  91. data/lib/oneview-sdk/resource/api600/synergy/sas_interconnect.rb +22 -0
  92. data/lib/oneview-sdk/resource/api600/synergy/sas_logical_interconnect.rb +22 -0
  93. data/lib/oneview-sdk/resource/api600/synergy/sas_logical_interconnect_group.rb +33 -0
  94. data/lib/oneview-sdk/resource/api600/synergy/scope.rb +22 -0
  95. data/lib/oneview-sdk/resource/api600/synergy/server_hardware.rb +33 -0
  96. data/lib/oneview-sdk/resource/api600/synergy/server_hardware_type.rb +22 -0
  97. data/lib/oneview-sdk/resource/api600/synergy/server_profile.rb +25 -0
  98. data/lib/oneview-sdk/resource/api600/synergy/server_profile_template.rb +22 -0
  99. data/lib/oneview-sdk/resource/api600/synergy/storage_pool.rb +22 -0
  100. data/lib/oneview-sdk/resource/api600/synergy/storage_system.rb +22 -0
  101. data/lib/oneview-sdk/resource/api600/synergy/switch.rb +22 -0
  102. data/lib/oneview-sdk/resource/api600/synergy/unmanaged_device.rb +22 -0
  103. data/lib/oneview-sdk/resource/api600/synergy/uplink_set.rb +33 -0
  104. data/lib/oneview-sdk/resource/api600/synergy/user.rb +22 -0
  105. data/lib/oneview-sdk/resource/api600/synergy/version.rb +23 -0
  106. data/lib/oneview-sdk/resource/api600/synergy/volume.rb +22 -0
  107. data/lib/oneview-sdk/resource/api600/synergy/volume_attachment.rb +22 -0
  108. data/lib/oneview-sdk/resource/api600/synergy/volume_snapshot.rb +22 -0
  109. data/lib/oneview-sdk/resource/api600/synergy/volume_template.rb +22 -0
  110. data/lib/oneview-sdk/resource/api600/synergy/web_server_certificate.rb +22 -0
  111. data/lib/oneview-sdk/version.rb +1 -1
  112. metadata +105 -3
data/lib/oneview-sdk.rb CHANGED
@@ -26,7 +26,7 @@ module OneviewSDK
26
26
  env_i3s = %w[I3S_URL I3S_SSL_ENABLED]
27
27
  ENV_VARS = env_sdk.concat(env_i3s).freeze
28
28
 
29
- SUPPORTED_API_VERSIONS = [200, 300, 500].freeze
29
+ SUPPORTED_API_VERSIONS = [200, 300, 500, 600].freeze
30
30
  DEFAULT_API_VERSION = 200
31
31
  @api_version = DEFAULT_API_VERSION
32
32
  @api_version_updated = false # Whether or not the API version has been set by the user
@@ -0,0 +1,39 @@
1
+ # (c) Copyright 2018 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 Image Streamer
16
+ module ImageStreamer
17
+ # Module API 500
18
+ module API500
19
+ # Get resource class that matches the type given
20
+ # @param [String] type Name of the desired class type
21
+ # @param [String] variant There is only 1 variant for this module, so this is not used.
22
+ # It exists only so that the parameters match API modules that do have multiple variants.
23
+ # @return [Class] Resource class or nil if not found
24
+ def self.resource_named(type, _variant = nil)
25
+ new_type = type.to_s.downcase.gsub(/[ -_]/, '')
26
+ constants.each do |c|
27
+ klass = const_get(c)
28
+ next unless klass.is_a?(Class) && klass < OneviewSDK::Resource
29
+ name = klass.name.split('::').last.downcase.delete('_').delete('-')
30
+ return klass if new_type =~ /^#{name}[s]?$/
31
+ end
32
+ nil
33
+ end
34
+ end
35
+ end
36
+ end
37
+
38
+ # Load all API-specific resources:
39
+ Dir[File.dirname(__FILE__) + '/api500/*.rb'].each { |file| require file }
@@ -0,0 +1,22 @@
1
+ # (C) Copyright 2018 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 '../api300/plan_script'
13
+
14
+ module OneviewSDK
15
+ module ImageStreamer
16
+ module API500
17
+ # Plan Script resource implementation for Image Streamer
18
+ class PlanScript < OneviewSDK::ImageStreamer::API300::PlanScript
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,39 @@
1
+ # (c) Copyright 2018 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 Image Streamer
16
+ module ImageStreamer
17
+ # Module API 600
18
+ module API600
19
+ # Get resource class that matches the type given
20
+ # @param [String] type Name of the desired class type
21
+ # @param [String] variant There is only 1 variant for this module, so this is not used.
22
+ # It exists only so that the parameters match API modules that do have multiple variants.
23
+ # @return [Class] Resource class or nil if not found
24
+ def self.resource_named(type, _variant = nil)
25
+ new_type = type.to_s.downcase.gsub(/[ -_]/, '')
26
+ constants.each do |c|
27
+ klass = const_get(c)
28
+ next unless klass.is_a?(Class) && klass < OneviewSDK::Resource
29
+ name = klass.name.split('::').last.downcase.delete('_').delete('-')
30
+ return klass if new_type =~ /^#{name}[s]?$/
31
+ end
32
+ nil
33
+ end
34
+ end
35
+ end
36
+ end
37
+
38
+ # Load all API-specific resources:
39
+ Dir[File.dirname(__FILE__) + '/api600/*.rb'].each { |file| require file }
@@ -0,0 +1,31 @@
1
+ # (C) Copyright 2018 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 '../api500/plan_script'
13
+
14
+ module OneviewSDK
15
+ module ImageStreamer
16
+ module API600
17
+ # Plan Script resource implementation for Image Streamer
18
+ class PlanScript < OneviewSDK::ImageStreamer::API500::PlanScript
19
+
20
+ # Retrieves the read only artifacts of the selected Plan Script as per the selected attributes.
21
+ # @return [Hash] The readonly artifacts of the selected Plan Script.
22
+ def retrieve_read_only
23
+ ensure_client && ensure_uri
24
+ path = "#{BASE_URI}/#{@data['uri'].split('/').last}/usedby/readonly"
25
+ response = @client.rest_get(path, { 'Content-Type' => 'none' }, @api_version)
26
+ @client.response_handler(response)
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -19,7 +19,7 @@ Dir[File.dirname(__FILE__) + '/image-streamer/resource/*.rb'].each { |file| requ
19
19
  module OneviewSDK
20
20
  # Module for interacting with the Image Streamer
21
21
  module ImageStreamer
22
- SUPPORTED_API_VERSIONS = [300].freeze
22
+ SUPPORTED_API_VERSIONS = [300, 500, 600].freeze
23
23
  DEFAULT_API_VERSION = 300
24
24
  @api_version = DEFAULT_API_VERSION
25
25
  @api_version_updated = false # Whether or not the API version has been set by the user
@@ -341,6 +341,7 @@ module OneviewSDK
341
341
  words.map!(&:capitalize!)
342
342
  words[0] = words.first.downcase
343
343
  new_key = words.join
344
+ v = "'" + v.join(',') + "'" if v.is_a?(Array) && v.any?
344
345
  v.retrieve! if v.respond_to?(:retrieve!) && !v['uri']
345
346
  if v.class <= OneviewSDK::Resource
346
347
  new_key = new_key.concat('Uri')
@@ -351,6 +352,16 @@ module OneviewSDK
351
352
  query_path.sub('?&', '?')
352
353
  end
353
354
 
355
+ # Make a GET request to the resource base uri, query parameters and returns an array with all objects of this type
356
+ # @param [OneviewSDK::Client] client The client object for the OneView appliance
357
+ # @param [Hash] query The query options for the request (key-value pairs)
358
+ # @param [Hash] header The header options for the request (key-value pairs)
359
+ # @return [Array<Resource>] Results
360
+ def self.get_all_with_query(client, query = nil)
361
+ query_uri = build_query(query) if query
362
+ find_with_pagination(client, "#{self::BASE_URI}/#{query_uri}")
363
+ end
364
+
354
365
  protected
355
366
 
356
367
  # Fail unless @client is set for this resource.
@@ -0,0 +1,66 @@
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
+ module OneviewSDK
13
+ # Module for API v600
14
+ module API600
15
+ SUPPORTED_VARIANTS = %w[C7000 Synergy].freeze
16
+ DEFAULT_VARIANT = 'C7000'.freeze
17
+ @variant = DEFAULT_VARIANT
18
+ @variant_updated = false # Whether or not the API variant has been set by the user
19
+
20
+ # Get resource class that matches the type given
21
+ # @param [String] type Name of the desired class type
22
+ # @param [String] variant Variant (C7000 or Synergy)
23
+ # @return [Class] Resource class or nil if not found
24
+ def self.resource_named(type, variant = @variant)
25
+ raise "API600 variant '#{variant}' is not supported! Try one of #{SUPPORTED_VARIANTS}" unless SUPPORTED_VARIANTS.include?(variant.to_s)
26
+ new_type = type.to_s.downcase.gsub(/[ -_]/, '')
27
+ api_module = OneviewSDK::API600.const_get(variant)
28
+ api_module.constants.each do |c|
29
+ klass = api_module.const_get(c)
30
+ next unless klass.is_a?(Class)
31
+ name = klass.name.split('::').last.downcase.delete('_').delete('-')
32
+ return klass if new_type =~ /^#{name}[s]?$/
33
+ end
34
+ nil
35
+ end
36
+
37
+ # Get the current API600 variant
38
+ def self.variant
39
+ @variant
40
+ end
41
+
42
+ # Has the API600 variant been set by the user?
43
+ # @return [TrueClass, FalseClass]
44
+ def self.variant_updated?
45
+ @variant_updated
46
+ end
47
+
48
+ # Sets the API600 variant
49
+ def self.variant=(variant)
50
+ raise "API600 variant '#{variant}' is not supported! Try one of #{SUPPORTED_VARIANTS}" unless SUPPORTED_VARIANTS.include?(variant)
51
+ @variant_updated = true
52
+ @variant = variant
53
+ end
54
+
55
+ # Helps redirect resources to the correct API600 variant
56
+ def self.const_missing(const)
57
+ api600_module = OneviewSDK::API600.const_get(@variant.to_s)
58
+ api600_module.const_get(const)
59
+ rescue NameError
60
+ raise NameError, "The #{const} method or resource does not exist for OneView API600 variant #{@variant}."
61
+ end
62
+ end
63
+ end
64
+
65
+ # Load all API600-specific resources:
66
+ Dir[File.dirname(__FILE__) + '/api600/*.rb'].each { |file| require file }
@@ -0,0 +1,27 @@
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
+ module OneviewSDK
13
+ module API600
14
+ # Module for API600 C7000
15
+ module C7000
16
+ # Get resource class that matches the type given
17
+ # @param [String] type Name of the desired class type
18
+ # @return [Class] Resource class or nil if not found
19
+ def self.resource_named(type)
20
+ OneviewSDK::API600.resource_named(type, 'C7000')
21
+ end
22
+ end
23
+ end
24
+ end
25
+
26
+ # Load all API-specific resources:
27
+ Dir[File.dirname(__FILE__) + '/c7000/*.rb'].each { |file| require file }
@@ -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 '../../api300/c7000/client_certificate'
13
+
14
+ module OneviewSDK
15
+ module API600
16
+ module C7000
17
+ # Client certificate resource implementation for API600 C7000
18
+ class ClientCertificate < OneviewSDK::API300::C7000::ClientCertificate
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 '../../api500/c7000/connection_template'
13
+
14
+ module OneviewSDK
15
+ module API600
16
+ module C7000
17
+ # Connection template resource implementation for API600 C7000
18
+ class ConnectionTemplate < OneviewSDK::API500::C7000::ConnectionTemplate
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 '../../api300/c7000/datacenter'
13
+
14
+ module OneviewSDK
15
+ module API600
16
+ module C7000
17
+ # Datacenter resource implementation for API600 C7000
18
+ class Datacenter < OneviewSDK::API300::C7000::Datacenter
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,71 @@
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 '../../api500/c7000/enclosure'
13
+
14
+ module OneviewSDK
15
+ module API600
16
+ module C7000
17
+ # Enclosure resource implementation for API600 C7000
18
+ class Enclosure < OneviewSDK::API500::C7000::Enclosure
19
+ # Create a resource object, associate it with a client, and set its properties.
20
+ # @param [OneviewSDK::Client] client The client object for the OneView appliance
21
+ # @param [Hash] params The options for this resource (key-value pairs)
22
+ # @param [Integer] api_ver The api version to use when interracting with this resource.
23
+ def initialize(client, params = {}, api_ver = nil)
24
+ @data ||= {}
25
+ # Default values:
26
+ @data['type'] ||= 'EnclosureListV7'
27
+ super
28
+ end
29
+
30
+ # Generate certificate signing request for the logical enclosure
31
+ # @raise [OneviewSDK::IncompleteResource] if the client is not set
32
+ # @raise [OneviewSDK::IncompleteResource] if the uri is not set
33
+ # @raise [StandardError] if the reapply fails
34
+ # @return [OneviewSDK::LogicalEnclosure] response
35
+ def create_csr_request(options, bay_number = nil)
36
+ ensure_client && ensure_uri
37
+ uri = "#{@data['uri']}/https/certificaterequest"
38
+ uri += "?bayNumber=#{bay_number}" if bay_number
39
+ response = @client.rest_post(uri, { 'body' => options }, @api_version)
40
+ @client.response_handler(response)
41
+ end
42
+
43
+ # Retrieve certificate signing request for the enclosure
44
+ # @raise [OneviewSDK::IncompleteResource] if the client is not set
45
+ # @raise [OneviewSDK::IncompleteResource] if the uri is not set
46
+ # @raise [StandardError] if the reapply fails
47
+ # @return [OneviewSDK::LogicalEnclosure] response
48
+ def get_csr_request(bay_number = nil)
49
+ ensure_client && ensure_uri
50
+ uri = "#{@data['uri']}/https/certificaterequest"
51
+ uri += "?bayNumber=#{bay_number}" if bay_number
52
+ response = @client.rest_get(uri, {}, @api_version)
53
+ @client.response_handler(response)
54
+ end
55
+
56
+ # Import certificate into the logical enclosure
57
+ # @raise [OneviewSDK::IncompleteResource] if the client is not set
58
+ # @raise [OneviewSDK::IncompleteResource] if the uri is not set
59
+ # @raise [StandardError] if the reapply fails
60
+ # @return [OneviewSDK::LogicalEnclosure] response
61
+ def import_certificate(options, bay_number = nil)
62
+ ensure_client && ensure_uri
63
+ uri = "#{@data['uri']}/https/certificaterequest"
64
+ uri += "?bayNumber=#{bay_number}" if bay_number
65
+ response = @client.rest_put(uri, options, @api_version)
66
+ @client.response_handler(response)
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,39 @@
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 '../../api500/c7000/enclosure_group'
13
+
14
+ module OneviewSDK
15
+ module API600
16
+ module C7000
17
+ # Enclosure group resource implementation on API600 C7000
18
+ class EnclosureGroup < OneviewSDK::API500::C7000::EnclosureGroup
19
+ # Create a resource object, associate it with a client, and set its properties.
20
+ # @param [OneviewSDK::Client] client The client object for the OneView appliance
21
+ # @param [Hash] params The options for this resource (key-value pairs)
22
+ # @param [Integer] api_ver The api version to use when interracting with this resource.
23
+ def initialize(client, params = {}, api_ver = nil)
24
+ @data ||= {}
25
+ super
26
+ @data.delete('type')
27
+ @data.delete('interconnectBayMappingCount')
28
+ @data.delete('stackingMode')
29
+ end
30
+
31
+ def update(attributes = {})
32
+ @data['type'] ||= 'EnclosureGroupV7'
33
+ @data['stackingMode'] ||= 'Enclosure'
34
+ super
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end