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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +50 -0
- data/README.md +61 -15
- data/Rakefile +39 -1
- data/lib/oneview-sdk.rb +38 -3
- data/lib/oneview-sdk/cli.rb +85 -30
- data/lib/oneview-sdk/client.rb +21 -18
- data/lib/oneview-sdk/config_loader.rb +1 -1
- data/lib/oneview-sdk/resource.rb +44 -36
- data/lib/oneview-sdk/resource/api200.rb +34 -0
- data/lib/oneview-sdk/resource/api200/connection_template.rb +52 -0
- data/lib/oneview-sdk/resource/api200/datacenter.rb +81 -0
- data/lib/oneview-sdk/resource/api200/enclosure.rb +203 -0
- data/lib/oneview-sdk/resource/api200/enclosure_group.rb +86 -0
- data/lib/oneview-sdk/resource/api200/ethernet_network.rb +60 -0
- data/lib/oneview-sdk/resource/api200/fabric.rb +45 -0
- data/lib/oneview-sdk/resource/api200/fc_network.rb +34 -0
- data/lib/oneview-sdk/resource/api200/fcoe_network.rb +32 -0
- data/lib/oneview-sdk/resource/api200/firmware_bundle.rb +56 -0
- data/lib/oneview-sdk/resource/{fcoe_network.rb → api200/firmware_driver.rb} +21 -12
- data/lib/oneview-sdk/resource/api200/interconnect.rb +112 -0
- data/lib/oneview-sdk/resource/api200/lig_uplink_set.rb +84 -0
- data/lib/oneview-sdk/resource/api200/logical_downlink.rb +57 -0
- data/lib/oneview-sdk/resource/api200/logical_enclosure.rb +88 -0
- data/lib/oneview-sdk/resource/api200/logical_interconnect.rb +251 -0
- data/lib/oneview-sdk/resource/api200/logical_interconnect_group.rb +116 -0
- data/lib/oneview-sdk/resource/api200/logical_switch.rb +188 -0
- data/lib/oneview-sdk/resource/api200/logical_switch_group.rb +70 -0
- data/lib/oneview-sdk/resource/api200/managed_san.rb +83 -0
- data/lib/oneview-sdk/resource/api200/network_set.rb +68 -0
- data/lib/oneview-sdk/resource/api200/power_device.rb +178 -0
- data/lib/oneview-sdk/resource/api200/rack.rb +88 -0
- data/lib/oneview-sdk/resource/api200/resource.rb +18 -0
- data/lib/oneview-sdk/resource/api200/san_manager.rb +92 -0
- data/lib/oneview-sdk/resource/api200/server_hardware.rb +244 -0
- data/lib/oneview-sdk/resource/api200/server_hardware_type.rb +61 -0
- data/lib/oneview-sdk/resource/api200/server_profile.rb +385 -0
- data/lib/oneview-sdk/resource/api200/server_profile_template.rb +217 -0
- data/lib/oneview-sdk/resource/api200/storage_pool.rb +92 -0
- data/lib/oneview-sdk/resource/api200/storage_system.rb +157 -0
- data/lib/oneview-sdk/resource/api200/switch.rb +91 -0
- data/lib/oneview-sdk/resource/api200/unmanaged_device.rb +59 -0
- data/lib/oneview-sdk/resource/api200/uplink_set.rb +83 -0
- data/lib/oneview-sdk/resource/api200/volume.rb +192 -0
- data/lib/oneview-sdk/resource/api200/volume_attachment.rb +83 -0
- data/lib/oneview-sdk/resource/api200/volume_snapshot.rb +50 -0
- data/lib/oneview-sdk/resource/api200/volume_template.rb +99 -0
- data/lib/oneview-sdk/resource/api300.rb +66 -0
- data/lib/oneview-sdk/resource/api300/c7000.rb +27 -0
- data/lib/oneview-sdk/resource/api300/c7000/connection_template.rb +30 -0
- data/lib/oneview-sdk/resource/api300/c7000/datacenter.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/enclosure.rb +48 -0
- data/lib/oneview-sdk/resource/api300/c7000/enclosure_group.rb +37 -0
- data/lib/oneview-sdk/resource/api300/c7000/ethernet_network.rb +35 -0
- data/lib/oneview-sdk/resource/api300/c7000/fabric.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/fc_network.rb +37 -0
- data/lib/oneview-sdk/resource/api300/c7000/fcoe_network.rb +35 -0
- data/lib/oneview-sdk/resource/api300/c7000/firmware_bundle.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/interconnect.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_downlink.rb +34 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_enclosure.rb +35 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_interconnect.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_interconnect_group.rb +33 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_switch.rb +51 -0
- data/lib/oneview-sdk/resource/api300/c7000/logical_switch_group.rb +33 -0
- data/lib/oneview-sdk/resource/api300/c7000/managed_san.rb +36 -0
- data/lib/oneview-sdk/resource/api300/c7000/network_set.rb +37 -0
- data/lib/oneview-sdk/resource/api300/c7000/power_device.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/rack.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/resource.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/san_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/server_hardware.rb +93 -0
- data/lib/oneview-sdk/resource/api300/c7000/server_hardware_type.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/server_profile.rb +33 -0
- data/lib/oneview-sdk/resource/api300/c7000/server_profile_template.rb +50 -0
- data/lib/oneview-sdk/resource/api300/c7000/storage_pool.rb +29 -0
- data/lib/oneview-sdk/resource/api300/c7000/storage_system.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/switch.rb +31 -0
- data/lib/oneview-sdk/resource/api300/c7000/unmanaged_device.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api300/c7000/volume_attachment.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/volume_snapshot.rb +21 -0
- data/lib/oneview-sdk/resource/api300/c7000/volume_template.rb +32 -0
- data/lib/oneview-sdk/resource/api300/synergy.rb +27 -0
- data/lib/oneview-sdk/resource/api300/synergy/connection_template.rb +30 -0
- data/lib/oneview-sdk/resource/api300/synergy/datacenter.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/drive_enclosure.rb +71 -0
- data/lib/oneview-sdk/resource/api300/synergy/enclosure.rb +110 -0
- data/lib/oneview-sdk/resource/api300/synergy/enclosure_group.rb +43 -0
- data/lib/oneview-sdk/resource/api300/synergy/ethernet_network.rb +35 -0
- data/lib/oneview-sdk/resource/api300/synergy/fabric.rb +46 -0
- data/lib/oneview-sdk/resource/api300/synergy/fc_network.rb +37 -0
- data/lib/oneview-sdk/resource/api300/synergy/fcoe_network.rb +35 -0
- data/lib/oneview-sdk/resource/api300/synergy/firmware_bundle.rb +21 -0
- data/lib/oneview-sdk/resource/api300/synergy/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/interconnect.rb +43 -0
- data/lib/oneview-sdk/resource/api300/synergy/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api300/synergy/logical_downlink.rb +34 -0
- data/lib/oneview-sdk/resource/api300/synergy/logical_enclosure.rb +59 -0
- data/lib/oneview-sdk/resource/api300/synergy/logical_interconnect.rb +21 -0
- data/lib/oneview-sdk/resource/api300/synergy/logical_interconnect_group.rb +119 -0
- data/lib/oneview-sdk/resource/api300/synergy/logical_switch.rb +33 -0
- data/lib/oneview-sdk/resource/api300/synergy/logical_switch_group.rb +45 -0
- data/lib/oneview-sdk/resource/{firmware_driver.rb → api300/synergy/managed_san.rb} +7 -17
- data/lib/oneview-sdk/resource/api300/synergy/network_set.rb +37 -0
- data/lib/oneview-sdk/resource/api300/synergy/power_device.rb +21 -0
- data/lib/oneview-sdk/resource/api300/synergy/rack.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/resource.rb +21 -0
- data/lib/oneview-sdk/resource/api300/synergy/san_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/sas_interconnect.rb +87 -0
- data/lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect.rb +110 -0
- data/lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect_group.rb +87 -0
- data/lib/oneview-sdk/resource/api300/synergy/server_hardware.rb +30 -0
- data/lib/oneview-sdk/resource/api300/synergy/server_hardware_type.rb +21 -0
- data/lib/oneview-sdk/resource/api300/synergy/server_profile.rb +78 -0
- data/lib/oneview-sdk/resource/api300/synergy/server_profile_template.rb +34 -0
- data/lib/oneview-sdk/resource/api300/synergy/storage_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/storage_system.rb +21 -0
- data/lib/oneview-sdk/resource/api300/synergy/switch.rb +37 -0
- data/lib/oneview-sdk/resource/api300/synergy/unmanaged_device.rb +21 -0
- data/lib/oneview-sdk/resource/api300/synergy/uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api300/synergy/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/volume_attachment.rb +21 -0
- data/lib/oneview-sdk/resource/api300/synergy/volume_snapshot.rb +21 -0
- data/lib/oneview-sdk/resource/api300/synergy/volume_template.rb +32 -0
- data/lib/oneview-sdk/rest.rb +7 -10
- data/lib/oneview-sdk/ssl_helper.rb +3 -3
- data/lib/oneview-sdk/version.rb +1 -1
- data/oneview-sdk.gemspec +5 -5
- metadata +126 -47
- data/.gitattributes +0 -2
- data/.gitignore +0 -29
- data/.rubocop.yml +0 -80
- data/.travis.yml +0 -12
- data/lib/oneview-sdk/resource/connection_template.rb +0 -48
- data/lib/oneview-sdk/resource/datacenter.rb +0 -77
- data/lib/oneview-sdk/resource/enclosure.rb +0 -191
- data/lib/oneview-sdk/resource/enclosure_group.rb +0 -82
- data/lib/oneview-sdk/resource/ethernet_network.rb +0 -56
- data/lib/oneview-sdk/resource/fabric.rb +0 -41
- data/lib/oneview-sdk/resource/fc_network.rb +0 -30
- data/lib/oneview-sdk/resource/firmware_bundle.rb +0 -50
- data/lib/oneview-sdk/resource/interconnect.rb +0 -107
- data/lib/oneview-sdk/resource/lig_uplink_set.rb +0 -80
- data/lib/oneview-sdk/resource/logical_downlink.rb +0 -53
- data/lib/oneview-sdk/resource/logical_enclosure.rb +0 -86
- data/lib/oneview-sdk/resource/logical_interconnect.rb +0 -247
- data/lib/oneview-sdk/resource/logical_interconnect_group.rb +0 -112
- data/lib/oneview-sdk/resource/logical_switch.rb +0 -184
- data/lib/oneview-sdk/resource/logical_switch_group.rb +0 -66
- data/lib/oneview-sdk/resource/managed_san.rb +0 -79
- data/lib/oneview-sdk/resource/network_set.rb +0 -64
- data/lib/oneview-sdk/resource/power_device.rb +0 -174
- data/lib/oneview-sdk/resource/rack.rb +0 -83
- data/lib/oneview-sdk/resource/san_manager.rb +0 -88
- data/lib/oneview-sdk/resource/server_hardware.rb +0 -209
- data/lib/oneview-sdk/resource/server_hardware_type.rb +0 -58
- data/lib/oneview-sdk/resource/server_profile.rb +0 -380
- data/lib/oneview-sdk/resource/server_profile_template.rb +0 -213
- data/lib/oneview-sdk/resource/storage_pool.rb +0 -63
- data/lib/oneview-sdk/resource/storage_system.rb +0 -113
- data/lib/oneview-sdk/resource/switch.rb +0 -86
- data/lib/oneview-sdk/resource/unmanaged_device.rb +0 -55
- data/lib/oneview-sdk/resource/uplink_set.rb +0 -79
- data/lib/oneview-sdk/resource/volume.rb +0 -188
- data/lib/oneview-sdk/resource/volume_attachment.rb +0 -79
- data/lib/oneview-sdk/resource/volume_snapshot.rb +0 -46
- data/lib/oneview-sdk/resource/volume_template.rb +0 -95
@@ -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 C7000
|
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 C7000
|
17
|
+
# Rack resource implementation for API300 C7000
|
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 C7000
|
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 C7000
|
17
|
+
# SAN manager resource implementation for API300 C7000
|
18
|
+
class SANManager < OneviewSDK::API200::SANManager
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,93 @@
|
|
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/server_hardware'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module C7000
|
17
|
+
# Server Hardware resource implementation on API300 C7000
|
18
|
+
class ServerHardware < OneviewSDK::API200::ServerHardware
|
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['type'] ||= 'server-hardware-5'
|
28
|
+
super
|
29
|
+
end
|
30
|
+
|
31
|
+
# Get the firmware inventory of a server.
|
32
|
+
# @return [Hash] Contains all firmware information
|
33
|
+
def get_firmware_by_id
|
34
|
+
ensure_client && ensure_uri
|
35
|
+
response = @client.rest_get(@data['uri'] + '/firmware')
|
36
|
+
@client.response_handler(response)
|
37
|
+
end
|
38
|
+
|
39
|
+
# Gets a list of firmware inventory across all servers
|
40
|
+
# @param [Array] Array with parameters
|
41
|
+
# @return [Array] Array of firmware inventory
|
42
|
+
def get_firmwares(filters = [])
|
43
|
+
ensure_client
|
44
|
+
results = []
|
45
|
+
uri = self.class::BASE_URI + '/*/firmware'
|
46
|
+
uri_generate(uri, filters) unless filters.empty?
|
47
|
+
response = @client.rest_get(uri)
|
48
|
+
body = @client.response_handler(response)
|
49
|
+
|
50
|
+
loop do
|
51
|
+
members = body['members']
|
52
|
+
members.each do |member|
|
53
|
+
results.push(member)
|
54
|
+
end
|
55
|
+
break unless body['nextPageUri']
|
56
|
+
uri = body['nextPageUri']
|
57
|
+
end
|
58
|
+
results
|
59
|
+
end
|
60
|
+
|
61
|
+
# Performs a specific patch operation for the given server.
|
62
|
+
# If the server supports the particular operation, the operation is performed
|
63
|
+
# and a response is returned to the caller with the results.
|
64
|
+
# @param [String] operation The operation to be performed
|
65
|
+
# @param [String] path The path of operation
|
66
|
+
# @param [String] value The value
|
67
|
+
def patch(operation, path, value = nil)
|
68
|
+
ensure_client && ensure_uri
|
69
|
+
body = if value
|
70
|
+
{ op: operation, path: path, value: value }
|
71
|
+
else
|
72
|
+
{ op: operation, path: path }
|
73
|
+
end
|
74
|
+
response = @client.rest_patch(@data['uri'], { 'body' => [body] }, @api_version)
|
75
|
+
@client.response_handler(response)
|
76
|
+
end
|
77
|
+
|
78
|
+
private
|
79
|
+
|
80
|
+
def uri_generate(uri, filters)
|
81
|
+
uri << '?'
|
82
|
+
filters.each_with_index do |filter, i|
|
83
|
+
operation = filter[:operation]
|
84
|
+
operation = " #{operation} " if operation != '='
|
85
|
+
filter_string = "filter=#{filter[:name]}#{operation}'#{filter[:value]}'"
|
86
|
+
uri << filter_string
|
87
|
+
uri << '&' if i < (filters.size - 1)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
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/server_hardware_type'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module C7000
|
17
|
+
class ServerHardwareType < OneviewSDK::API200::ServerHardwareType
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,33 @@
|
|
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/server_profile'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module C7000
|
17
|
+
# Server profile resource implementation
|
18
|
+
class ServerProfile < OneviewSDK::API200::ServerProfile
|
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 interacting with this resource.
|
24
|
+
def initialize(client, params = {}, api_ver = nil)
|
25
|
+
@data ||= {}
|
26
|
+
# Default values
|
27
|
+
@data['type'] ||= 'ServerProfileV6'
|
28
|
+
super
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,50 @@
|
|
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/server_profile_template'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module C7000
|
17
|
+
# Server Profile Template resource implementation on API300 C7000
|
18
|
+
class ServerProfileTemplate < OneviewSDK::API200::ServerProfileTemplate
|
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['type'] ||= 'ServerProfileTemplateV2'
|
28
|
+
super
|
29
|
+
end
|
30
|
+
|
31
|
+
# Transforms an existing profile template by supplying a new server hardware type and/or enclosure group.
|
32
|
+
# A profile template will be returned with a new configuration based on the capabilities of the supplied
|
33
|
+
# server hardware type and/or enclosure group. All configured connections will have their port assignment set to 'Auto'.
|
34
|
+
# The new profile template can subsequently be used for the PUT https://{appl}/rest/server-profile-templates/{id}
|
35
|
+
# API but is not guaranteed to pass validation. Any incompatibilities will be flagged
|
36
|
+
# when the transformed server profile template is submitted.
|
37
|
+
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
38
|
+
# @param [Hash] query Query parameters
|
39
|
+
# @option query [OneviewSDK::EnclosureGroup] 'enclosure_group' Enclosure Group associated with the resource
|
40
|
+
# @option query [OneviewSDK::ServerHardwareType] 'server_hardware_type' The server hardware type associated with the resource
|
41
|
+
# @return [Hash] Hash containing the required information
|
42
|
+
def get_transformation(client, query = nil)
|
43
|
+
query_uri = OneviewSDK::Resource.build_query(query) if query
|
44
|
+
response = client.rest_get("#{@data['uri']}/transformation#{query_uri}")
|
45
|
+
client.response_handler(response)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,29 @@
|
|
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/storage_pool'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module C7000
|
17
|
+
# Storage pool resource implementation for C7000
|
18
|
+
class StoragePool < OneviewSDK::API200::StoragePool
|
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
|
+
super
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
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/storage_system'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module C7000
|
17
|
+
class StorageSystem < OneviewSDK::API200::StorageSystem
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,31 @@
|
|
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/switch'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module C7000
|
17
|
+
# Switch resource implementation
|
18
|
+
class Switch < OneviewSDK::API200::Switch
|
19
|
+
|
20
|
+
# Updates the scope URIs of a specific switch
|
21
|
+
# @param [Array] scope_uris Array of scope uri strings
|
22
|
+
def set_scope_uris(scope_uris)
|
23
|
+
ensure_client && ensure_uri
|
24
|
+
body = { op: 'replace', path: '/scopeUris', value: scope_uris }
|
25
|
+
response = @client.rest_patch(@data['uri'], { 'body' => [body] }, @api_version)
|
26
|
+
@client.response_handler(response)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
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/unmanaged_device'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module C7000
|
17
|
+
class UnmanagedDevice < OneviewSDK::API200::UnmanagedDevice
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
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/uplink_set'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module C7000
|
17
|
+
class UplinkSet < OneviewSDK::API200::UplinkSet
|
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/volume'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module C7000
|
17
|
+
# Volume resource implementation on API300 C7000
|
18
|
+
class Volume < OneviewSDK::API200::Volume
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|