oneview-sdk 3.1.0 → 4.0.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 +40 -8
- data/README.md +41 -11
- data/Rakefile +47 -0
- data/lib/oneview-sdk.rb +6 -1
- data/lib/oneview-sdk/cli.rb +21 -6
- data/lib/oneview-sdk/client.rb +23 -7
- data/lib/oneview-sdk/image-streamer/client.rb +96 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/artifacts_bundle.rb +26 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/build_plan.rb +26 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/deployment_plan.rb +26 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/golden_image.rb +26 -0
- data/lib/oneview-sdk/{resource/api300/synergy/logical_switch_group.rb → image-streamer/resource/api300/os_volume.rb} +17 -13
- data/lib/oneview-sdk/image-streamer/resource/api300/plan_script.rb +42 -0
- data/lib/oneview-sdk/image-streamer/resource/api300/resource.rb +21 -0
- data/lib/oneview-sdk/image-streamer/resource/api_300.rb +39 -0
- data/lib/oneview-sdk/image_streamer.rb +68 -0
- data/lib/oneview-sdk/resource.rb +13 -1
- data/lib/oneview-sdk/resource/api200/connection_template.rb +2 -2
- data/lib/oneview-sdk/resource/api200/datacenter.rb +2 -2
- data/lib/oneview-sdk/resource/api200/enclosure.rb +2 -2
- data/lib/oneview-sdk/resource/api200/enclosure_group.rb +6 -0
- data/lib/oneview-sdk/resource/api200/fabric.rb +4 -4
- data/lib/oneview-sdk/resource/api200/firmware_driver.rb +2 -2
- data/lib/oneview-sdk/resource/api200/interconnect.rb +3 -3
- data/lib/oneview-sdk/resource/api200/logical_downlink.rb +3 -3
- data/lib/oneview-sdk/resource/api200/logical_interconnect_group.rb +8 -8
- data/lib/oneview-sdk/resource/api200/logical_switch.rb +2 -4
- data/lib/oneview-sdk/resource/api200/managed_san.rb +3 -3
- data/lib/oneview-sdk/resource/api200/power_device.rb +2 -2
- data/lib/oneview-sdk/resource/api200/rack.rb +2 -2
- data/lib/oneview-sdk/resource/api200/san_manager.rb +2 -2
- data/lib/oneview-sdk/resource/api200/server_hardware.rb +2 -2
- data/lib/oneview-sdk/resource/api200/server_hardware_type.rb +2 -2
- data/lib/oneview-sdk/resource/api200/storage_pool.rb +3 -3
- data/lib/oneview-sdk/resource/api200/storage_system.rb +2 -2
- data/lib/oneview-sdk/resource/api200/switch.rb +4 -4
- data/lib/oneview-sdk/resource/api200/unmanaged_device.rb +2 -2
- data/lib/oneview-sdk/resource/api200/user.rb +79 -0
- data/lib/oneview-sdk/resource/api200/volume_attachment.rb +3 -3
- data/lib/oneview-sdk/resource/api200/volume_snapshot.rb +2 -2
- data/lib/oneview-sdk/resource/api300.rb +2 -2
- data/lib/oneview-sdk/resource/api300/c7000/enclosure.rb +3 -15
- data/lib/oneview-sdk/resource/api300/c7000/enclosure_group.rb +54 -1
- data/lib/oneview-sdk/resource/api300/c7000/logical_downlink.rb +2 -2
- data/lib/oneview-sdk/resource/api300/c7000/logical_switch.rb +4 -0
- data/lib/oneview-sdk/resource/api300/c7000/managed_san.rb +1 -1
- data/lib/oneview-sdk/resource/api300/c7000/scope.rb +142 -0
- data/lib/oneview-sdk/resource/api300/c7000/server_hardware.rb +3 -17
- data/lib/oneview-sdk/resource/api300/c7000/user.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/drive_enclosure.rb +3 -3
- data/lib/oneview-sdk/resource/api300/synergy/enclosure.rb +4 -31
- data/lib/oneview-sdk/resource/api300/synergy/enclosure_group.rb +3 -6
- data/lib/oneview-sdk/resource/api300/synergy/logical_downlink.rb +2 -2
- data/lib/oneview-sdk/resource/api300/synergy/logical_enclosure.rb +1 -1
- data/lib/oneview-sdk/resource/api300/synergy/logical_interconnect_group.rb +24 -23
- data/lib/oneview-sdk/resource/api300/synergy/logical_switch.rb +2 -0
- data/lib/oneview-sdk/resource/api300/synergy/sas_interconnect.rb +3 -3
- data/lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect.rb +2 -2
- data/lib/oneview-sdk/resource/api300/synergy/scope.rb +22 -0
- data/lib/oneview-sdk/resource/api300/synergy/user.rb +22 -0
- data/lib/oneview-sdk/rest.rb +7 -2
- data/lib/oneview-sdk/version.rb +2 -2
- data/oneview-sdk.gemspec +1 -0
- metadata +32 -4
@@ -22,7 +22,7 @@ module OneviewSDK
|
|
22
22
|
# @param [String] variant Variant (C7000 or Synergy)
|
23
23
|
# @return [Class] Resource class or nil if not found
|
24
24
|
def self.resource_named(type, variant = @variant)
|
25
|
-
raise "API300 variant #{variant} is not supported!" unless SUPPORTED_VARIANTS.include?(variant)
|
25
|
+
raise "API300 variant '#{variant}' is not supported! Try one of #{SUPPORTED_VARIANTS}" unless SUPPORTED_VARIANTS.include?(variant.to_s)
|
26
26
|
new_type = type.to_s.downcase.gsub(/[ -_]/, '')
|
27
27
|
api_module = OneviewSDK::API300.const_get(variant)
|
28
28
|
api_module.constants.each do |c|
|
@@ -47,7 +47,7 @@ module OneviewSDK
|
|
47
47
|
|
48
48
|
# Sets the API300 variant
|
49
49
|
def self.variant=(variant)
|
50
|
-
raise "API300 variant #{variant} is not supported!" unless SUPPORTED_VARIANTS.include?(variant)
|
50
|
+
raise "API300 variant '#{variant}' is not supported! Try one of #{SUPPORTED_VARIANTS}" unless SUPPORTED_VARIANTS.include?(variant)
|
51
51
|
@variant_updated = true
|
52
52
|
@variant = variant
|
53
53
|
end
|
@@ -10,12 +10,14 @@
|
|
10
10
|
# language governing permissions and limitations under the License.
|
11
11
|
|
12
12
|
require_relative '../../api200/enclosure'
|
13
|
+
require_relative 'scope'
|
13
14
|
|
14
15
|
module OneviewSDK
|
15
16
|
module API300
|
16
17
|
module C7000
|
17
18
|
# Enclosure resource implementation for API300 C7000
|
18
19
|
class Enclosure < OneviewSDK::API200::Enclosure
|
20
|
+
include OneviewSDK::API300::C7000::Scope::ScopeHelperMethods
|
19
21
|
|
20
22
|
# Create a resource object, associate it with a client, and set its properties.
|
21
23
|
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
@@ -25,23 +27,9 @@ module OneviewSDK
|
|
25
27
|
@data ||= {}
|
26
28
|
# Default values:
|
27
29
|
@data['type'] ||= 'EnclosureV300'
|
30
|
+
@data['scopeUris'] ||= []
|
28
31
|
super
|
29
32
|
end
|
30
|
-
|
31
|
-
# Update specific attributes of a given enclosure
|
32
|
-
# @param [String] operation Operation to be performed
|
33
|
-
# @param [String] path Path
|
34
|
-
# @param [String] value Value
|
35
|
-
def patch(operation, path, value = nil)
|
36
|
-
ensure_client && ensure_uri
|
37
|
-
body = if value
|
38
|
-
{ op: operation, path: path, value: value }
|
39
|
-
else
|
40
|
-
{ op: operation, path: path }
|
41
|
-
end
|
42
|
-
response = @client.rest_patch(@data['uri'], { 'body' => [body] }, @api_version)
|
43
|
-
@client.response_handler(response)
|
44
|
-
end
|
45
33
|
end
|
46
34
|
end
|
47
35
|
end
|
@@ -26,11 +26,64 @@ module OneviewSDK
|
|
26
26
|
# Default values:
|
27
27
|
@data['type'] ||= 'EnclosureGroupV300'
|
28
28
|
@data['stackingMode'] ||= 'Enclosure'
|
29
|
+
@data['enclosureCount'] ||= 1
|
29
30
|
@data['interconnectBayMappingCount'] ||= 8
|
30
|
-
create_interconnect_bay_mapping unless @data['interconnectBayMappings']
|
31
31
|
super
|
32
32
|
end
|
33
33
|
|
34
|
+
# Adds the logical interconnect group
|
35
|
+
# @param [OneviewSDK::LogicalInterconnectGroup] lig Logical Interconnect Group
|
36
|
+
# @param [Integer] enclosureIndex Enclosure index of bay to add LIG to. If nil, interconnects will be added for all enclosures
|
37
|
+
# @raise [OneviewSDK::NotFound] if the LIG uri is not set and cannot be retrieved
|
38
|
+
# @return [OneviewSDK::API300::C7000::EnclosureGroup] self
|
39
|
+
def add_logical_interconnect_group(lig, enclosureIndex = nil)
|
40
|
+
lig.retrieve! unless lig['uri']
|
41
|
+
raise(NotFound, "The logical interconnect group #{lig['name']} was not found") unless lig['uri']
|
42
|
+
lig['interconnectMapTemplate']['interconnectMapEntryTemplates'].each do |entry|
|
43
|
+
entry['logicalLocation']['locationEntries'].each do |location|
|
44
|
+
next unless location['type'] == 'Bay' && entry['permittedInterconnectTypeUri']
|
45
|
+
add_lig_to_bay(location['relativeValue'], lig, enclosureIndex)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
self
|
49
|
+
end
|
50
|
+
|
51
|
+
# Creates the interconnect bay mapping
|
52
|
+
# @return [OneviewSDK::API300::C7000::EnclosureGroup] self
|
53
|
+
def create_interconnect_bay_mapping
|
54
|
+
@data['interconnectBayMappings'] = []
|
55
|
+
1.upto(@data['enclosureCount']) do |enclosureIndex|
|
56
|
+
1.upto(@data['interconnectBayMappingCount']) do |bay_number|
|
57
|
+
entry = {
|
58
|
+
'enclosureIndex' => enclosureIndex,
|
59
|
+
'interconnectBay' => bay_number,
|
60
|
+
'logicalInterconnectGroupUri' => nil
|
61
|
+
}
|
62
|
+
@data['interconnectBayMappings'] << entry
|
63
|
+
end
|
64
|
+
end
|
65
|
+
self
|
66
|
+
end
|
67
|
+
|
68
|
+
private
|
69
|
+
|
70
|
+
# Add logical interconnect group to bay
|
71
|
+
# @param [Integer] bay Bay number
|
72
|
+
# @param [OneviewSDK::LogicalInterconnectGroup] lig Logical Interconnect Group
|
73
|
+
# @param [Integer] enclosureIndex Enclosure index of bay to add LIG to. If nil, interconnects will be added for all enclosures
|
74
|
+
def add_lig_to_bay(bay, lig, enclosureIndex)
|
75
|
+
@data['interconnectBayMappings'].each do |location|
|
76
|
+
next unless location['interconnectBay'] == bay
|
77
|
+
if enclosureIndex
|
78
|
+
next unless location['enclosureIndex'] == enclosureIndex
|
79
|
+
location['logicalInterconnectGroupUri'] = lig['uri']
|
80
|
+
location['enclosureIndex'] = enclosureIndex
|
81
|
+
break
|
82
|
+
else
|
83
|
+
location['logicalInterconnectGroupUri'] = lig['uri']
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
34
87
|
end
|
35
88
|
end
|
36
89
|
end
|
@@ -19,13 +19,13 @@ module OneviewSDK
|
|
19
19
|
|
20
20
|
# Method is not available
|
21
21
|
# @raise [OneviewSDK::MethodUnavailable] method is not available
|
22
|
-
def self.get_without_ethernet
|
22
|
+
def self.get_without_ethernet(*)
|
23
23
|
raise MethodUnavailable, 'The method #self.get_without_ethernet is unavailable for this resource'
|
24
24
|
end
|
25
25
|
|
26
26
|
# Method is not available
|
27
27
|
# @raise [OneviewSDK::MethodUnavailable] method is not available
|
28
|
-
def get_without_ethernet
|
28
|
+
def get_without_ethernet(*)
|
29
29
|
unavailable_method
|
30
30
|
end
|
31
31
|
end
|
@@ -10,12 +10,15 @@
|
|
10
10
|
# language governing permissions and limitations under the License.
|
11
11
|
|
12
12
|
require_relative '../../api200/logical_switch'
|
13
|
+
require_relative 'scope'
|
13
14
|
|
14
15
|
module OneviewSDK
|
15
16
|
module API300
|
16
17
|
module C7000
|
17
18
|
# Logical switch resource implementation for API300 C7000
|
18
19
|
class LogicalSwitch < OneviewSDK::API200::LogicalSwitch
|
20
|
+
include OneviewSDK::API300::C7000::Scope::ScopeHelperMethods
|
21
|
+
|
19
22
|
INTERNAL_LINK_SET_URI = '/rest/internal-link-sets'.freeze
|
20
23
|
|
21
24
|
# Create a resource object, associate it with a client, and set its properties.
|
@@ -26,6 +29,7 @@ module OneviewSDK
|
|
26
29
|
@data ||= {}
|
27
30
|
# Default values:
|
28
31
|
@data['type'] ||= 'logical-switchV300'
|
32
|
+
@data['scopeUris'] ||= []
|
29
33
|
super
|
30
34
|
end
|
31
35
|
|
@@ -0,0 +1,142 @@
|
|
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 'resource'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module C7000
|
17
|
+
# Scope resource implementation for API300 C7k
|
18
|
+
class Scope < Resource
|
19
|
+
BASE_URI = '/rest/scopes'.freeze
|
20
|
+
|
21
|
+
# Create a resource object, associate it with a client, and set its properties.
|
22
|
+
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
23
|
+
# @param [Hash] params The options for this resource (key-value pairs)
|
24
|
+
# @param [Integer] api_ver The api version to use when interracting with this resource.
|
25
|
+
# Defaults to the client.api_version if it exists, or the OneviewSDK::Client::DEFAULT_API_VERSION.
|
26
|
+
def initialize(client, params = {}, api_ver = nil)
|
27
|
+
@data ||= {}
|
28
|
+
@data['type'] ||= 'Scope'
|
29
|
+
super
|
30
|
+
end
|
31
|
+
|
32
|
+
# Set data and save to OneView
|
33
|
+
# @param [Hash] attributes The attributes to add/change for this resource (key-value pairs)
|
34
|
+
# @raise [OneviewSDK::IncompleteResource] if the client or uri is not set
|
35
|
+
# @raise [StandardError] if the resource save fails
|
36
|
+
# @return [Resource] self
|
37
|
+
def update(attributes = {})
|
38
|
+
set_all(attributes)
|
39
|
+
ensure_client && ensure_uri
|
40
|
+
options = {
|
41
|
+
'If-Match' => @data.delete('eTag'),
|
42
|
+
'body' => @data
|
43
|
+
}
|
44
|
+
response = @client.rest_put(@data['uri'], options, @api_version)
|
45
|
+
@client.response_handler(response)
|
46
|
+
self
|
47
|
+
end
|
48
|
+
|
49
|
+
# Delete resource from OneView
|
50
|
+
# @raise [OneviewSDK::IncompleteResource] if the client or uri is not set
|
51
|
+
# @return [true] if resource was deleted successfully
|
52
|
+
def delete
|
53
|
+
ensure_client && ensure_uri
|
54
|
+
response = @client.rest_delete(@data['uri'], { 'If-Match' => @data['eTag'] }, @api_version)
|
55
|
+
@client.response_handler(response)
|
56
|
+
true
|
57
|
+
end
|
58
|
+
|
59
|
+
# Adds resource assignments
|
60
|
+
# @param [Array] *resources The array of resources (or any number of resources separated by comma)
|
61
|
+
# @raise [OneviewSDK::IncompleteResource] if the client or uri is not set
|
62
|
+
def set_resources(*resources)
|
63
|
+
change_resource_assignments(add_resources: resources.flatten)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Removes resource assignments
|
67
|
+
# @param [Array] *resources The array of resources (or any number of resources separated by comma)
|
68
|
+
# @raise [OneviewSDK::IncompleteResource] if the client or uri is not set
|
69
|
+
def unset_resources(*resources)
|
70
|
+
change_resource_assignments(remove_resources: resources.flatten)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Modifies scope membership by adding or removing resource assignments
|
74
|
+
# @param [Array] resources The array of resources (or any number of resources separated by comma)
|
75
|
+
# @raise [OneviewSDK::IncompleteResource] if the client or uri is not set
|
76
|
+
def change_resource_assignments(add_resources: [], remove_resources: [])
|
77
|
+
if !add_resources.empty? || !remove_resources.empty?
|
78
|
+
ensure_uri && ensure_client
|
79
|
+
add_uris = ensure_and_get_uris(add_resources)
|
80
|
+
remove_uris = ensure_and_get_uris(remove_resources)
|
81
|
+
body = {
|
82
|
+
'addedResourceUris' => add_uris,
|
83
|
+
'removedResourceUris' => remove_uris
|
84
|
+
}
|
85
|
+
response = @client.rest_patch(@data['uri'] + '/resource-assignments', 'body' => body)
|
86
|
+
@client.response_handler(response)
|
87
|
+
end
|
88
|
+
self
|
89
|
+
end
|
90
|
+
|
91
|
+
# Helper methods for add, remove and replace scopes from the another resources
|
92
|
+
module ScopeHelperMethods
|
93
|
+
# Performs a specific patch operation for the given server.
|
94
|
+
# If the server supports the particular operation, the operation is performed
|
95
|
+
# and a response is returned to the caller with the results.
|
96
|
+
# @param [String] operation The operation to be performed
|
97
|
+
# @param [String] path The path of operation
|
98
|
+
# @param [String] value The value
|
99
|
+
# @note This attribute is subject to incompatible changes in future release versions, including redefinition or removal.
|
100
|
+
def patch(operation, path, value = nil)
|
101
|
+
ensure_client && ensure_uri
|
102
|
+
body = {
|
103
|
+
'op' => operation,
|
104
|
+
'path' => path,
|
105
|
+
'value' => value
|
106
|
+
}
|
107
|
+
response = @client.rest_patch(@data['uri'], { 'body' => [body] }, @api_version)
|
108
|
+
@client.response_handler(response)
|
109
|
+
end
|
110
|
+
|
111
|
+
# Add one scope to the resource
|
112
|
+
# @param [OneviewSDK::API300::C7000::Scope] scope The scope resource
|
113
|
+
# @raise [OneviewSDK::IncompleteResource] if the uri of scope is not set
|
114
|
+
def add_scope(scope)
|
115
|
+
scope.ensure_uri
|
116
|
+
patch('add', '/scopeUris/-', scope['uri'])
|
117
|
+
end
|
118
|
+
|
119
|
+
# Remove one scope from the resource
|
120
|
+
# @param [OneviewSDK::API300::C7000::Scope] scope The scope resource
|
121
|
+
# @return [Boolean] True if the scope was deleted and false if enclosure has not the scope
|
122
|
+
# @raise [OneviewSDK::IncompleteResource] if the uri of scope is not set
|
123
|
+
def remove_scope(scope)
|
124
|
+
scope.ensure_uri
|
125
|
+
scope_index = @data['scopeUris'].find_index { |uri| uri == scope['uri'] }
|
126
|
+
return false unless scope_index
|
127
|
+
patch('remove', "/scopeUris/#{scope_index}", nil)
|
128
|
+
true
|
129
|
+
end
|
130
|
+
|
131
|
+
# Change the list of scopes in the resource
|
132
|
+
# @param [Array<OneviewSDK::API300::C7000::Scope>] scopes The scopes list (or scopes separeted by comma)
|
133
|
+
# @raise [OneviewSDK::IncompleteResource] if the uri of each scope is not set
|
134
|
+
def replace_scopes(*scopes)
|
135
|
+
uris = ensure_and_get_uris(scopes.flatten)
|
136
|
+
patch('replace', '/scopeUris', uris)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
@@ -10,12 +10,14 @@
|
|
10
10
|
# language governing permissions and limitations under the License.
|
11
11
|
|
12
12
|
require_relative '../../api200/server_hardware'
|
13
|
+
require_relative 'scope'
|
13
14
|
|
14
15
|
module OneviewSDK
|
15
16
|
module API300
|
16
17
|
module C7000
|
17
18
|
# Server Hardware resource implementation on API300 C7000
|
18
19
|
class ServerHardware < OneviewSDK::API200::ServerHardware
|
20
|
+
include OneviewSDK::API300::C7000::Scope::ScopeHelperMethods
|
19
21
|
|
20
22
|
# Create a resource object, associate it with a client, and set its properties.
|
21
23
|
# @param [OneviewSDK::Client] client The client object for the OneView appliance
|
@@ -25,6 +27,7 @@ module OneviewSDK
|
|
25
27
|
@data ||= {}
|
26
28
|
# Default values:
|
27
29
|
@data['type'] ||= 'server-hardware-5'
|
30
|
+
@data['scopeUris'] ||= []
|
28
31
|
super
|
29
32
|
end
|
30
33
|
|
@@ -58,23 +61,6 @@ module OneviewSDK
|
|
58
61
|
results
|
59
62
|
end
|
60
63
|
|
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
64
|
private
|
79
65
|
|
80
66
|
def uri_generate(uri, filters)
|
@@ -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 '../../api200/user'
|
13
|
+
|
14
|
+
module OneviewSDK
|
15
|
+
module API300
|
16
|
+
module C7000
|
17
|
+
# User resource implementation for API300 C7000
|
18
|
+
class User < OneviewSDK::API200::User
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -28,19 +28,19 @@ module OneviewSDK
|
|
28
28
|
|
29
29
|
# Method is unavailable
|
30
30
|
# @raise [OneviewSDK::MethodUnavailable] method is not available
|
31
|
-
def create
|
31
|
+
def create(*)
|
32
32
|
unavailable_method
|
33
33
|
end
|
34
34
|
|
35
35
|
# Method is unavailable
|
36
36
|
# @raise [OneviewSDK::MethodUnavailable] method is not available
|
37
|
-
def delete
|
37
|
+
def delete(*)
|
38
38
|
unavailable_method
|
39
39
|
end
|
40
40
|
|
41
41
|
# Method is unavailable
|
42
42
|
# @raise [OneviewSDK::MethodUnavailable] method is not available
|
43
|
-
def update
|
43
|
+
def update(*)
|
44
44
|
unavailable_method
|
45
45
|
end
|
46
46
|
|
@@ -9,25 +9,13 @@
|
|
9
9
|
# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
|
10
10
|
# language governing permissions and limitations under the License.
|
11
11
|
|
12
|
-
require_relative '
|
12
|
+
require_relative '../c7000/enclosure'
|
13
13
|
|
14
14
|
module OneviewSDK
|
15
15
|
module API300
|
16
16
|
module Synergy
|
17
17
|
# Enclosure resource implementation for API300 Synergy
|
18
|
-
class Enclosure < OneviewSDK::
|
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
|
-
# @note Renames the enclosures only if @data['name']. Pattern used is: <@data['name']>+<1..number of enclosures added>.
|
25
|
-
def initialize(client, params = {}, api_ver = nil)
|
26
|
-
@data ||= {}
|
27
|
-
# Default values:
|
28
|
-
@data['type'] ||= 'EnclosureV300'
|
29
|
-
super
|
30
|
-
end
|
18
|
+
class Enclosure < OneviewSDK::API300::C7000::Enclosure
|
31
19
|
|
32
20
|
# Claim/configure the enclosure and its components to the appliance
|
33
21
|
# @note Calls the update_enclosure_names method to set the enclosure names
|
@@ -46,30 +34,15 @@ module OneviewSDK
|
|
46
34
|
OneviewSDK::API300::Synergy::Enclosure.update_enclosure_names(@client, @data['hostname'], @data['name'])
|
47
35
|
end
|
48
36
|
|
49
|
-
# Update specific attributes of a given enclosure
|
50
|
-
# @param [String] operation Operation to be performed
|
51
|
-
# @param [String] path Path
|
52
|
-
# @param [String] value Value
|
53
|
-
def patch(operation, path, value = nil)
|
54
|
-
ensure_client && ensure_uri
|
55
|
-
body = if value
|
56
|
-
{ op: operation, path: path, value: value }
|
57
|
-
else
|
58
|
-
{ op: operation, path: path }
|
59
|
-
end
|
60
|
-
response = @client.rest_patch(@data['uri'], { 'body' => [body] }, @api_version)
|
61
|
-
@client.response_handler(response)
|
62
|
-
end
|
63
|
-
|
64
37
|
# Method is not available
|
65
38
|
# @raise [OneviewSDK::MethodUnavailable] method is not available
|
66
|
-
def set_environmental_configuration
|
39
|
+
def set_environmental_configuration(*)
|
67
40
|
unavailable_method
|
68
41
|
end
|
69
42
|
|
70
43
|
# Method is not available
|
71
44
|
# @raise [OneviewSDK::MethodUnavailable] method is not available
|
72
|
-
def set_enclosure_group
|
45
|
+
def set_enclosure_group(*)
|
73
46
|
unavailable_method
|
74
47
|
end
|
75
48
|
|