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,30 @@
|
|
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 '../c7000/server_hardware'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module Synergy
|
17
|
+
# Server Hardware resource implementation on API300 Synergy
|
18
|
+
class ServerHardware < OneviewSDK::API300::C7000::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
|
+
super
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
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 Synergy
|
17
|
+
class ServerHardwareType < OneviewSDK::API200::ServerHardwareType
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,78 @@
|
|
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 Synergy
|
17
|
+
# Server profile resource implementation
|
18
|
+
class ServerProfile < OneviewSDK::API200::ServerProfile
|
19
|
+
LOGICAL_JBOD_URI = '/rest/sas-logical-jbods'.freeze
|
20
|
+
ATTACHMENT_URI = '/rest/sas-logical-jbod-attachments'.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 interacting with this resource.
|
26
|
+
def initialize(client, params = {}, api_ver = nil)
|
27
|
+
@data ||= {}
|
28
|
+
# Default values
|
29
|
+
@data['type'] ||= 'ServerProfileV6'
|
30
|
+
super
|
31
|
+
end
|
32
|
+
|
33
|
+
# Retrieves all SAS Logical JBOD
|
34
|
+
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
35
|
+
def self.get_sas_logical_jbods(client)
|
36
|
+
response = client.rest_get(LOGICAL_JBOD_URI)
|
37
|
+
response = client.response_handler(response)
|
38
|
+
response['members']
|
39
|
+
end
|
40
|
+
|
41
|
+
# Retrieves a SAS Logical JBOD by name
|
42
|
+
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
43
|
+
# @param [String] name SAS Logical JBOD name
|
44
|
+
# @return [Array] SAS Logical JBOD
|
45
|
+
def self.get_sas_logical_jbod(client, name)
|
46
|
+
results = get_sas_logical_jbods(client)
|
47
|
+
results.find { |item| item['name'] == name }
|
48
|
+
end
|
49
|
+
|
50
|
+
# Retrieves drives by SAS Logical JBOD name
|
51
|
+
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
52
|
+
# @param [String] name SAS Logical JBOD name
|
53
|
+
def self.get_sas_logical_jbod_drives(client, name)
|
54
|
+
item = get_sas_logical_jbod(client, name)
|
55
|
+
response = client.rest_get(item['uri'] + '/drives')
|
56
|
+
client.response_handler(response)
|
57
|
+
end
|
58
|
+
|
59
|
+
# Retrieves all SAS Logical JBOD Attachments
|
60
|
+
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
61
|
+
def self.get_sas_logical_jbod_attachments(client)
|
62
|
+
response = client.rest_get(ATTACHMENT_URI)
|
63
|
+
response = client.response_handler(response)
|
64
|
+
response['members']
|
65
|
+
end
|
66
|
+
|
67
|
+
# Retrieves a SAS Logical JBOD Attachment by name
|
68
|
+
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
69
|
+
# @param [String] name SAS Logical JBOD Attachment name
|
70
|
+
# @return [Array] SAS Logical JBOD Attachment
|
71
|
+
def self.get_sas_logical_jbod_attachment(client, name)
|
72
|
+
results = get_sas_logical_jbod_attachments(client)
|
73
|
+
results.find { |attachment| attachment['name'] == name }
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,34 @@
|
|
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 '../c7000/server_profile_template'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module Synergy
|
17
|
+
# Server Profile Template resource implementation on API300 Synergy
|
18
|
+
class ServerProfileTemplate < OneviewSDK::API300::C7000::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
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
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/storage_pool'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module Synergy
|
17
|
+
# Storage pool resource implementation for Synergy
|
18
|
+
class StoragePool < OneviewSDK::API200::StoragePool
|
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 '../../api200/storage_system'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module Synergy
|
17
|
+
class StorageSystem < OneviewSDK::API200::StorageSystem
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
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/switch'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module Synergy
|
17
|
+
# Switch resource implementation
|
18
|
+
class Switch
|
19
|
+
|
20
|
+
# Retrieves the switch types
|
21
|
+
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
22
|
+
# @return [Array] All the Switch types
|
23
|
+
def self.get_types(client)
|
24
|
+
OneviewSDK::API200::Switch.get_types(client)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Retrieves the switch type with the name
|
28
|
+
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
29
|
+
# @param [String] name Switch type name
|
30
|
+
# @return [Array] Switch type
|
31
|
+
def self.get_type(client, name)
|
32
|
+
OneviewSDK::API200::Switch.get_type(client, name)
|
33
|
+
end
|
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/unmanaged_device'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module Synergy
|
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 Synergy
|
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 Synergy
|
17
|
+
# Volume resource implementation on API300 Synergy
|
18
|
+
class Volume < OneviewSDK::API200::Volume
|
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 '../../api200/volume_attachment'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module Synergy
|
17
|
+
class VolumeAttachment < OneviewSDK::API200::VolumeAttachment
|
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/volume_snapshot'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module Synergy
|
17
|
+
class VolumeSnapshot < OneviewSDK::API200::VolumeSnapshot
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,32 @@
|
|
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_template'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module Synergy
|
17
|
+
# Volume Template resource implementation for API300 Synergy
|
18
|
+
class VolumeTemplate < OneviewSDK::API200::VolumeTemplate
|
19
|
+
# Create the client object, establishes connection, and set up the logging and api version.
|
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
|
+
# Defaults to client.api_version if exists, or OneviewSDK::Client::DEFAULT_API_VERSION.
|
24
|
+
# Defaults type to StorageVolumeTemplate when API version is 120
|
25
|
+
# Defaults type to StorageVolumeTemplateV3 when API version is 200
|
26
|
+
def initialize(client, params = {}, api_ver = nil)
|
27
|
+
super
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/oneview-sdk/rest.rb
CHANGED
@@ -30,7 +30,7 @@ module OneviewSDK
|
|
30
30
|
# @return [NetHTTPResponse] Response object
|
31
31
|
def rest_api(type, path, options = {}, api_ver = @api_version)
|
32
32
|
@logger.debug "Making :#{type} rest call to #{@url}#{path}"
|
33
|
-
|
33
|
+
raise InvalidRequest, 'Must specify path' unless path
|
34
34
|
|
35
35
|
uri = URI.parse(URI.escape(@url + path))
|
36
36
|
http = Net::HTTP.new(uri.host, uri.port)
|
@@ -153,13 +153,13 @@ module OneviewSDK
|
|
153
153
|
when RESPONSE_CODE_NO_CONTENT # Synchronous delete
|
154
154
|
return {}
|
155
155
|
when RESPONSE_CODE_BAD_REQUEST
|
156
|
-
|
156
|
+
raise BadRequest, "400 BAD REQUEST #{response.body}"
|
157
157
|
when RESPONSE_CODE_UNAUTHORIZED
|
158
|
-
|
158
|
+
raise Unauthorized, "401 UNAUTHORIZED #{response.body}"
|
159
159
|
when RESPONSE_CODE_NOT_FOUND
|
160
|
-
|
160
|
+
raise NotFound, "404 NOT FOUND #{response.body}"
|
161
161
|
else
|
162
|
-
|
162
|
+
raise RequestError, "#{response.code} #{response.body}"
|
163
163
|
end
|
164
164
|
end
|
165
165
|
|
@@ -180,7 +180,7 @@ module OneviewSDK
|
|
180
180
|
when :delete
|
181
181
|
request = Net::HTTP::Delete.new(uri.request_uri)
|
182
182
|
else
|
183
|
-
|
183
|
+
raise InvalidRequest, "Invalid rest method: #{type}. Valid methods are: get, post, put, patch, delete"
|
184
184
|
end
|
185
185
|
|
186
186
|
options['X-API-Version'] ||= api_ver
|
@@ -197,10 +197,7 @@ module OneviewSDK
|
|
197
197
|
end
|
198
198
|
end
|
199
199
|
|
200
|
-
|
201
|
-
filtered_options.gsub!(@password, 'filtered') if @password
|
202
|
-
filtered_options.gsub!(@token, 'filtered') if @token
|
203
|
-
@logger.debug " Options: #{filtered_options}"
|
200
|
+
@logger.debug " Options: #{options}" # Warning: This may include passwords and tokens
|
204
201
|
|
205
202
|
request
|
206
203
|
end
|