Skip to content

Commit

Permalink
Merge 7472aa3 into 41e5c45
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvirani committed Sep 9, 2020
2 parents 41e5c45 + 7472aa3 commit 169701c
Show file tree
Hide file tree
Showing 10 changed files with 193 additions and 38 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ This release extends support to OneView Rest API version 2000 (OneView v5.40) fo
- Network Set
- OS Deployment Plan
- Server Certificate
- Server Profile
- Server Profile Template

#### Bug fixes & Enhancements:
- Enahanced the method to set the default API version to appliance's max API version instead of hardcoded 200.
Expand Down
50 changes: 25 additions & 25 deletions endpoints-support.md

Large diffs are not rendered by default.

30 changes: 17 additions & 13 deletions examples/shared_samples/server_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
require_relative '../_client' # Gives access to @client

# Supported APIs:
# - 200, 300, 500, 600, 800, 1000, 1200, 1600, 1800
# - 200, 300, 500, 600, 800, 1000, 1200, 1600, 1800 and 2000

# Supported Variants:
# - C7000 and Synergy for all supported API versions
Expand Down Expand Up @@ -67,12 +67,14 @@
puts "\nServer Profile updated successfully! Name: #{item3['name']}"

# This method supports till OneView REST API Version 1200
puts "\nGetting the available servers"
begin
servers = server_profile_class.get_available_servers(@client)
puts "\nAvailable servers: \n#{servers}"
rescue OneviewSDK::MethodUnavailable
puts "\nThe method #get_available_servers is available for API version <= 1200"
if @client.api_version <= 1200
puts "\nGetting the available servers"
begin
servers = server_profile_class.get_available_servers(@client)
puts "\nAvailable servers: \n#{servers}"
rescue OneviewSDK::MethodUnavailable
puts "\nThe method #get_available_servers is available for API version <= 1200"
end
end

puts "\nGetting the available networks"
Expand Down Expand Up @@ -110,12 +112,14 @@
puts "\nServer Profile updated successfully!"

# This method supports till OneView REST API Version 1200
puts "\nGetting a new profile template of a given server profile"
begin
new_template = item2.get_profile_template
puts "\nNew template generated: \n#{new_template.data}"
rescue NoMethodError
puts "\nThe method #get_profile_template is available from API 500."
if @client.api_version <= 1200
puts "\nGetting a new profile template of a given server profile"
begin
new_template = item2.get_profile_template
puts "\nNew template generated: \n#{new_template.data}"
rescue NoMethodError
puts "\nThe method #get_profile_template is available from API 500."
end
end

puts "\nRemoving the server profiles created is this sample"
Expand Down
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api2000/c7000/server_profile_template.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

require_relative '../../api1800/c7000/server_profile_template'

module OneviewSDK
module API2000
module C7000
# Server Profile Template resource implementation on API2000 C7000
class ServerProfileTemplate < OneviewSDK::API1800::C7000::ServerProfileTemplate
end
end
end
end
25 changes: 25 additions & 0 deletions lib/oneview-sdk/resource/api2000/synergy/server_profile.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# (c) Copyright 2020 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

require_relative '../../api300/synergy/server_profile'
require_relative '../c7000/server_profile'

module OneviewSDK
module API2000
module Synergy
# Server profile resource implementation for API2000 Synergy
class ServerProfile < OneviewSDK::API2000::C7000::ServerProfile
extend OneviewSDK::API300::Synergy::SASLogicalJBODHelper
include OneviewSDK::API300::Synergy::ServerProfileHelper
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

require_relative '../c7000/server_profile_template'

module OneviewSDK
module API2000
module Synergy
# Server Profile Template resource implementation for API2000 Synergy
class ServerProfileTemplate < OneviewSDK::API2000::C7000::ServerProfileTemplate
end
end
end
end
20 changes: 20 additions & 0 deletions spec/unit/resource/api2000/c7000/server_profile_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.

require 'spec_helper'

RSpec.describe OneviewSDK::API2000::C7000::ServerProfile do
include_context 'shared context'

it 'inherits from OneviewSDK::API1800::C7000::ServerProfile' do
expect(described_class).to be < OneviewSDK::API1800::C7000::ServerProfile
end
end
20 changes: 20 additions & 0 deletions spec/unit/resource/api2000/c7000/server_profile_template_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.

require 'spec_helper'

RSpec.describe OneviewSDK::API2000::C7000::ServerProfileTemplate do
include_context 'shared context'

it 'inherits from OneviewSDK::API1800::C7000::ServerProfileTemplate' do
expect(described_class).to be < OneviewSDK::API1800::C7000::ServerProfileTemplate
end
end
20 changes: 20 additions & 0 deletions spec/unit/resource/api2000/synergy/server_profile_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.

require 'spec_helper'

RSpec.describe OneviewSDK::API2000::Synergy::ServerProfile do
include_context 'shared context'

it 'inherits from OneviewSDK::API2000::C7000::ServerProfile' do
expect(described_class).to be < OneviewSDK::API2000::C7000::ServerProfile
end
end
20 changes: 20 additions & 0 deletions spec/unit/resource/api2000/synergy/server_profile_template_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.

require 'spec_helper'

RSpec.describe OneviewSDK::API2000::Synergy::ServerProfileTemplate do
include_context 'shared context'

it 'inherits from OneviewSDK::API2000::C7000::ServerProfileTemplate' do
expect(described_class).to be < OneviewSDK::API2000::C7000::ServerProfileTemplate
end
end

0 comments on commit 169701c

Please sign in to comment.