oneview-sdk 5.3.0 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +43 -0
- data/README.md +7 -2
- data/bin/oneview-sdk-ruby +0 -0
- data/endpoints-support.md +296 -288
- data/lib/oneview-sdk.rb +1 -1
- data/lib/oneview-sdk/image-streamer/resource/api500.rb +39 -0
- data/lib/oneview-sdk/image-streamer/resource/api500/plan_script.rb +22 -0
- data/lib/oneview-sdk/image-streamer/resource/api600.rb +39 -0
- data/lib/oneview-sdk/image-streamer/resource/api600/plan_script.rb +31 -0
- data/lib/oneview-sdk/image_streamer.rb +1 -1
- data/lib/oneview-sdk/resource.rb +11 -0
- data/lib/oneview-sdk/resource/api600.rb +66 -0
- data/lib/oneview-sdk/resource/api600/c7000.rb +27 -0
- data/lib/oneview-sdk/resource/api600/c7000/client_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/datacenter.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/enclosure.rb +71 -0
- data/lib/oneview-sdk/resource/api600/c7000/enclosure_group.rb +39 -0
- data/lib/oneview-sdk/resource/api600/c7000/ethernet_network.rb +47 -0
- data/lib/oneview-sdk/resource/api600/c7000/event.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/fabric.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/fc_network.rb +35 -0
- data/lib/oneview-sdk/resource/api600/c7000/fcoe_network.rb +33 -0
- data/lib/oneview-sdk/resource/api600/c7000/firmware_bundle.rb +21 -0
- data/lib/oneview-sdk/resource/api600/c7000/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/id_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/interconnect.rb +34 -0
- data/lib/oneview-sdk/resource/api600/c7000/internal_link_set.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api600/c7000/logical_downlink.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/logical_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/logical_interconnect.rb +39 -0
- data/lib/oneview-sdk/resource/api600/c7000/logical_interconnect_group.rb +33 -0
- data/lib/oneview-sdk/resource/api600/c7000/logical_switch.rb +32 -0
- data/lib/oneview-sdk/resource/api600/c7000/logical_switch_group.rb +32 -0
- data/lib/oneview-sdk/resource/api600/c7000/login_detail.rb +23 -0
- data/lib/oneview-sdk/resource/api600/c7000/managed_san.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/network_set.rb +32 -0
- data/lib/oneview-sdk/resource/api600/c7000/power_device.rb +21 -0
- data/lib/oneview-sdk/resource/api600/c7000/rack.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/resource.rb +21 -0
- data/lib/oneview-sdk/resource/api600/c7000/san_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/scope.rb +92 -0
- data/lib/oneview-sdk/resource/api600/c7000/server_hardware.rb +44 -0
- data/lib/oneview-sdk/resource/api600/c7000/server_hardware_type.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/server_profile.rb +50 -0
- data/lib/oneview-sdk/resource/api600/c7000/server_profile_template.rb +49 -0
- data/lib/oneview-sdk/resource/api600/c7000/storage_pool.rb +32 -0
- data/lib/oneview-sdk/resource/api600/c7000/storage_system.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/switch.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/unmanaged_device.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/uplink_set.rb +33 -0
- data/lib/oneview-sdk/resource/api600/c7000/user.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/version.rb +23 -0
- data/lib/oneview-sdk/resource/api600/c7000/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api600/c7000/volume_attachment.rb +45 -0
- data/lib/oneview-sdk/resource/api600/c7000/volume_snapshot.rb +32 -0
- data/lib/oneview-sdk/resource/api600/c7000/volume_template.rb +34 -0
- data/lib/oneview-sdk/resource/api600/c7000/web_server_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy.rb +27 -0
- data/lib/oneview-sdk/resource/api600/synergy/client_certificate.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/connection_template.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/datacenter.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/drive_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/enclosure.rb +71 -0
- data/lib/oneview-sdk/resource/api600/synergy/enclosure_group.rb +41 -0
- data/lib/oneview-sdk/resource/api600/synergy/ethernet_network.rb +47 -0
- data/lib/oneview-sdk/resource/api600/synergy/event.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/fabric.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/fc_network.rb +35 -0
- data/lib/oneview-sdk/resource/api600/synergy/fcoe_network.rb +33 -0
- data/lib/oneview-sdk/resource/api600/synergy/firmware_bundle.rb +21 -0
- data/lib/oneview-sdk/resource/api600/synergy/firmware_driver.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/id_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/interconnect.rb +23 -0
- data/lib/oneview-sdk/resource/api600/synergy/internal_link_set.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/lig_uplink_set.rb +21 -0
- data/lib/oneview-sdk/resource/api600/synergy/logical_downlink.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/logical_enclosure.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/logical_interconnect.rb +39 -0
- data/lib/oneview-sdk/resource/api600/synergy/logical_interconnect_group.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/login_detail.rb +23 -0
- data/lib/oneview-sdk/resource/api600/synergy/managed_san.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/network_set.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/os_deployment_plan.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/power_device.rb +21 -0
- data/lib/oneview-sdk/resource/api600/synergy/rack.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/resource.rb +21 -0
- data/lib/oneview-sdk/resource/api600/synergy/san_manager.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/sas_interconnect.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/sas_logical_interconnect.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/sas_logical_interconnect_group.rb +33 -0
- data/lib/oneview-sdk/resource/api600/synergy/scope.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/server_hardware.rb +33 -0
- data/lib/oneview-sdk/resource/api600/synergy/server_hardware_type.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/server_profile.rb +25 -0
- data/lib/oneview-sdk/resource/api600/synergy/server_profile_template.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/storage_pool.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/storage_system.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/switch.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/unmanaged_device.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/uplink_set.rb +33 -0
- data/lib/oneview-sdk/resource/api600/synergy/user.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/version.rb +23 -0
- data/lib/oneview-sdk/resource/api600/synergy/volume.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/volume_attachment.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/volume_snapshot.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/volume_template.rb +22 -0
- data/lib/oneview-sdk/resource/api600/synergy/web_server_certificate.rb +22 -0
- data/lib/oneview-sdk/version.rb +1 -1
- metadata +105 -3
|
@@ -0,0 +1,32 @@
|
|
|
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/logical_switch_group'
|
|
13
|
+
|
|
14
|
+
module OneviewSDK
|
|
15
|
+
module API600
|
|
16
|
+
module C7000
|
|
17
|
+
# Logical switch group resource implementation for API600 C7000
|
|
18
|
+
class LogicalSwitchGroup < OneviewSDK::API500::C7000::LogicalSwitchGroup
|
|
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'] ||= 'logical-switch-groupV4'
|
|
27
|
+
super
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
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/login_detail'
|
|
13
|
+
|
|
14
|
+
module OneviewSDK
|
|
15
|
+
module API600
|
|
16
|
+
module C7000
|
|
17
|
+
# login details resource implementation for API600 C7000
|
|
18
|
+
class LoginDetail < OneviewSDK::API300::C7000::LoginDetail
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
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/managed_san'
|
|
13
|
+
|
|
14
|
+
module OneviewSDK
|
|
15
|
+
module API600
|
|
16
|
+
module C7000
|
|
17
|
+
# Managed SAN resource implementation for API600 C7000
|
|
18
|
+
class ManagedSAN < OneviewSDK::API500::C7000::ManagedSAN
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
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/network_set'
|
|
13
|
+
|
|
14
|
+
module OneviewSDK
|
|
15
|
+
module API600
|
|
16
|
+
module C7000
|
|
17
|
+
# Network set resource implementation for API600 C7000
|
|
18
|
+
class NetworkSet < OneviewSDK::API500::C7000::NetworkSet
|
|
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
|
+
# Default values:
|
|
25
|
+
@data ||= {}
|
|
26
|
+
@data['type'] ||= 'network-setV4'
|
|
27
|
+
super
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
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/power_device'
|
|
13
|
+
|
|
14
|
+
module OneviewSDK
|
|
15
|
+
module API600
|
|
16
|
+
module C7000
|
|
17
|
+
class PowerDevice < OneviewSDK::API300::C7000::PowerDevice
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
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
|
|
10
|
+
# specific language governing permissions and limitations under the License.
|
|
11
|
+
|
|
12
|
+
require_relative '../../api300/c7000/rack'
|
|
13
|
+
|
|
14
|
+
module OneviewSDK
|
|
15
|
+
module API600
|
|
16
|
+
module C7000
|
|
17
|
+
# Rack resource implementation for API600 C7000
|
|
18
|
+
class Rack < OneviewSDK::API300::C7000::Rack
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
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/resource'
|
|
13
|
+
|
|
14
|
+
module OneviewSDK
|
|
15
|
+
module API600
|
|
16
|
+
module C7000
|
|
17
|
+
class Resource < OneviewSDK::API500::C7000::Resource
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
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/san_manager'
|
|
13
|
+
|
|
14
|
+
module OneviewSDK
|
|
15
|
+
module API600
|
|
16
|
+
module C7000
|
|
17
|
+
# SAN manager resource implementation for API600 C7000
|
|
18
|
+
class SANManager < OneviewSDK::API300::C7000::SANManager
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,92 @@
|
|
|
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/scope'
|
|
13
|
+
|
|
14
|
+
module OneviewSDK
|
|
15
|
+
module API600
|
|
16
|
+
module C7000
|
|
17
|
+
# Scope resource implementation for API600 C7000
|
|
18
|
+
class Scope < OneviewSDK::API500::C7000::Scope
|
|
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'] ||= 'ScopeV3'
|
|
28
|
+
super
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Gets a resource's scope, containing a list of the scopes to which
|
|
32
|
+
# the resource is assigned.
|
|
33
|
+
# @param [OneviewSDK::API600::C7000::Resource] resource Resource object
|
|
34
|
+
def get_resource_scopes(resource)
|
|
35
|
+
scopes_uri = resource['scopesUri']
|
|
36
|
+
response = @client.rest_get(scopes_uri)
|
|
37
|
+
@client.response_handler(response)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Replaces a resource's assigned scopes using the specified list of scope URIs.
|
|
41
|
+
# @param [OneviewSDK::API600::C7000::Resource] resource Resource object
|
|
42
|
+
# @param [Array<OneviewSDK::API600::C7000::Scope>] scopes Array of scopes objects
|
|
43
|
+
def replace_resource_assigned_scopes(resource, scopes: [])
|
|
44
|
+
resource_uri = resource['uri']
|
|
45
|
+
scope_uris = scopes.map { |scope| scope['uri'] }
|
|
46
|
+
scopes_uri = resource['scopesUri']
|
|
47
|
+
options = { 'Content-Type' => 'application/json-patch+json',
|
|
48
|
+
'If-Match' => '*',
|
|
49
|
+
'body' => { 'type' => 'ScopedResource',
|
|
50
|
+
'resourceUri' => resource_uri,
|
|
51
|
+
'scopeUris' => scope_uris } }
|
|
52
|
+
response = @client.rest_put(scopes_uri, options)
|
|
53
|
+
@client.response_handler(response)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Performs a specific patch operation.
|
|
57
|
+
# @param [String] scopes_uri resource's scopes uri
|
|
58
|
+
# @param [String] operation The operation to be performed
|
|
59
|
+
# @param [String] path The path of operation
|
|
60
|
+
# @param [String] value The value
|
|
61
|
+
def resource_patch(scopes_uri, operation, path, value = nil)
|
|
62
|
+
ensure_client && ensure_uri
|
|
63
|
+
body = { 'op' => operation,
|
|
64
|
+
'path' => path,
|
|
65
|
+
'value' => value }
|
|
66
|
+
options = { 'Content-Type' => 'application/json-patch+json',
|
|
67
|
+
'If-Match' => '*', 'body' => [body] }
|
|
68
|
+
response = @client.rest_patch(scopes_uri, options, @api_version)
|
|
69
|
+
@client.response_handler(response)
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Add a scope to resource's scope list
|
|
73
|
+
# @param [OneviewSDK::API600::C7000::Resource] resource Any resource object
|
|
74
|
+
# @param [OneviewSDK::API600::C7000::Scope] scope Scope object
|
|
75
|
+
def add_resource_scope(resource, scope)
|
|
76
|
+
scopes_uri = resource['scopesUri']
|
|
77
|
+
resource_patch(scopes_uri, 'add', '/scopeUris/-', scope['uri'])
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Remove a scope from resource's scope list.
|
|
81
|
+
# @param [OneviewSDK::API600::C7000::Resource] resource Any resource object
|
|
82
|
+
# @param [OneviewSDK::API600::C7000::Scope] scope Scope object
|
|
83
|
+
def remove_resource_scope(resource, scope)
|
|
84
|
+
scope_uris = get_resource_scopes(resource)['scopeUris']
|
|
85
|
+
scope_index = scope_uris.find_index { |uri| uri == scope['uri'] }
|
|
86
|
+
resource_uri = resource['scopesUri']
|
|
87
|
+
resource_patch(resource_uri, 'remove', "/scopeUris/#{scope_index}", nil)
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
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/server_hardware'
|
|
13
|
+
|
|
14
|
+
module OneviewSDK
|
|
15
|
+
module API600
|
|
16
|
+
module C7000
|
|
17
|
+
# Server Hardware resource implementation on API600 C7000
|
|
18
|
+
class ServerHardware < OneviewSDK::API500::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
|
+
@data ||= {}
|
|
26
|
+
# Default values:
|
|
27
|
+
@data['type'] ||= 'server-hardware-8'
|
|
28
|
+
super
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Adds multiple server hardware using the given data
|
|
32
|
+
def add_multiple_servers
|
|
33
|
+
ensure_client
|
|
34
|
+
required_attributes = %w[username password licensingIntent mpHostsAndRanges]
|
|
35
|
+
required_attributes.each { |k| raise IncompleteResource, "Missing required attribute: '#{k}'" unless @data.key?(k) }
|
|
36
|
+
|
|
37
|
+
optional_attrs = %w[configurationState force restore]
|
|
38
|
+
temp_data = @data.select { |k, _v| required_attributes.include?(k) || optional_attrs.include?(k) }
|
|
39
|
+
@client.rest_post('/rest/server-hardware' + '/discovery', { 'body' => temp_data }, @api_version)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
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/server_hardware_type'
|
|
13
|
+
|
|
14
|
+
module OneviewSDK
|
|
15
|
+
module API600
|
|
16
|
+
module C7000
|
|
17
|
+
# Server hardware type resource implementation for API600 C7000
|
|
18
|
+
class ServerHardwareType < OneviewSDK::API500::C7000::ServerHardwareType
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,50 @@
|
|
|
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/server_profile'
|
|
13
|
+
|
|
14
|
+
module OneviewSDK
|
|
15
|
+
module API600
|
|
16
|
+
module C7000
|
|
17
|
+
# Server Profile resource implementation on API600 C7000
|
|
18
|
+
class ServerProfile < OneviewSDK::API500::C7000::ServerProfile
|
|
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 interacting with this resource.
|
|
23
|
+
def initialize(client, params = {}, api_ver = nil)
|
|
24
|
+
@data ||= {}
|
|
25
|
+
# Default values
|
|
26
|
+
@data['type'] ||= 'ServerProfileV8'
|
|
27
|
+
super
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Method is not available
|
|
31
|
+
# @raise [OneviewSDK::MethodUnavailable] method is not available
|
|
32
|
+
def self.get_available_storage_system(*)
|
|
33
|
+
unavailable_method
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Method is not available
|
|
37
|
+
# @raise [OneviewSDK::MethodUnavailable] method is not available
|
|
38
|
+
def self.get_available_storage_systems(*)
|
|
39
|
+
unavailable_method
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Method is not available
|
|
43
|
+
# @raise [OneviewSDK::MethodUnavailable] method is not available
|
|
44
|
+
def get_messages(*)
|
|
45
|
+
unavailable_method
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
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/server_profile_template'
|
|
13
|
+
|
|
14
|
+
module OneviewSDK
|
|
15
|
+
module API600
|
|
16
|
+
module C7000
|
|
17
|
+
# Server Profile Template resource implementation on API600 C7000
|
|
18
|
+
class ServerProfileTemplate < OneviewSDK::API500::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'] ||= 'ServerProfileTemplateV4'
|
|
28
|
+
super
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Retrieves the list of Ethernet networks, Fibre channel networks and network sets
|
|
32
|
+
# that are available to a server profile template along with their respective ports.
|
|
33
|
+
# @param [OneviewSDK::Client] client The client object for the OneView appliance.
|
|
34
|
+
# @param [Hash] query Query paramaters
|
|
35
|
+
# @option query [String] 'enclosure_group_uri' Enclosure group URI
|
|
36
|
+
# @option query [String] 'server_hardware_type_uri' Server hardware type URI
|
|
37
|
+
# @option query [String] 'profile_template_uri' Server profile template URI
|
|
38
|
+
# @option query [String] 'scope_uris' An expression to restrict the resources returned according to the scopes to which they are assigned
|
|
39
|
+
# @option query [String] 'view' The FunctionType (Ethernet or FibreChannel) to filter the list of networks returned
|
|
40
|
+
# @return [Hash] Hash containing the required information
|
|
41
|
+
def get_available_networks(client, query = nil)
|
|
42
|
+
query_uri = OneviewSDK::Resource.build_query(query) if query
|
|
43
|
+
response = client.rest_get("#{BASE_URI}/available-networks#{query_uri}")
|
|
44
|
+
client.response_handler(response)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|