Skip to content

Commit

Permalink
Merge pull request #494 from HewlettPackard/feature
Browse files Browse the repository at this point in the history
PR for 2400 config changes
  • Loading branch information
yuvirani authored Feb 9, 2021
2 parents b4e1e38 + 2ca56ce commit d7cf5fd
Show file tree
Hide file tree
Showing 89 changed files with 1,457 additions and 254 deletions.
1 change: 1 addition & 0 deletions Berksfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ group :test do
cookbook 'oneview_test_api1600_c7000', path: './spec/fixtures/cookbooks/oneview_test_api1600_c7000'
cookbook 'oneview_test_api1800_c7000', path: './spec/fixtures/cookbooks/oneview_test_api1800_c7000'
cookbook 'oneview_test_api2000_c7000', path: './spec/fixtures/cookbooks/oneview_test_api2000_c7000'
cookbook 'oneview_test_api2400_c7000', path: './spec/fixtures/cookbooks/oneview_test_api2400_c7000'
cookbook 'image_streamer_test_api300', path: './spec/fixtures/cookbooks/image_streamer_test_api300'
cookbook 'image_streamer_test_api500', path: './spec/fixtures/cookbooks/image_streamer_test_api500'
cookbook 'image_streamer_test_api600', path: './spec/fixtures/cookbooks/image_streamer_test_api600'
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
## 3.8.0(Unrelesed)
### Notes
- This release extends support of the SDK to OneView REST API version 2400 (OneView v5.60).

### Oneview Features supported
- oneview_connection_template
- oneview_enclosure
- oneview_enclosure_group
- oneview_ethernet_network
- oneview_fc_network
- oneview_fcoe_network
- oneview_hypervisor_cluster_profile
- oneview_hypervisor_manager
- oneview_interconnect
- oneview_logical_enclosure
- oneview_logical_interconnect
- oneview_logical_interconnect_group
- oneview_network_set
- oneview_scope
- oneview_server_certificate
- oneview_server_hardware
- oneview_server_hardware_type
- oneview_server_profile
- oneview_server_profile_template
- oneview_storage_pool
- oneview_storage_system
- oneview_uplink_set
- oneview_volume
- oneview_volume_attachment
- oneview_volume_template

## 3.7.0
### Notes
- This release extends support of the SDK to OneView REST API version 2200 (OneView v5.50) and ImageStreamer REST API version 2000 (I3S v5.40).
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ gem 'chefspec'
gem 'codeclimate-test-reporter'
gem 'cucumber-core', '~> 3.2.1'
gem 'foodcritic', '~> 7.1.0'
gem 'oneview-sdk', '~> 5.17.0'
gem 'oneview-sdk', '~> 5.18.0'
gem 'pry'
gem 'rubocop', '~> 0.49.1'
gem 'simplecov', '~> 0.17.1'
Expand Down
429 changes: 215 additions & 214 deletions endpoints-support.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/connection_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200
api_version: 2400
}

# Ethernet network that will be used for the examples below
Expand Down Expand Up @@ -53,7 +53,7 @@
data(
bandwidth: {
maximumBandwidth: 13500,
typicalBandwidth: 2200
typicalBandwidth: 2400
}
)
end
Expand Down Expand Up @@ -91,7 +91,7 @@
data(
bandwidth: {
maximumBandwidth: 13500,
typicalBandwidth: 2200
typicalBandwidth: 2400
}
)
end
Expand Down
2 changes: 1 addition & 1 deletion examples/enclosure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200,
api_version: 2400,
api_variant: 'Synergy'
}

Expand Down
2 changes: 1 addition & 1 deletion examples/enclosure_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200,
api_version: 2400,
api_variant: 'Synergy'
}

Expand Down
6 changes: 3 additions & 3 deletions examples/ethernet_network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200
api_version: 2400
}

# Example: Create and manage a new ethernet network
Expand Down Expand Up @@ -49,7 +49,7 @@
action :create_if_missing
end

# Only for API1800 or greater
# Only for API2400 or greater
# Example: Bulk deletes ethernet networks.
oneview_ethernet_network 'None' do
client my_client
Expand All @@ -59,7 +59,7 @@
networkUris: [ test1['uri'], test['uri'] ]
)
action :delete_bulk
only_if { client[:api_version] >= 1800 }
only_if { client[:api_version] >= 2400 }
end

# Only for V300 and V500
Expand Down
6 changes: 3 additions & 3 deletions examples/fc_network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200
api_version: 2400
}

# Example: Create and manage a new fc network
Expand Down Expand Up @@ -46,7 +46,7 @@
action :create_if_missing
end

# This examples works only from API1800
# This examples works only from API2400
# Example: Bulk deletes fc networks.
oneview_fc_network 'None' do
client my_client
Expand All @@ -55,7 +55,7 @@
networkUris: [ test1['uri'] ]
)
action :delete_bulk
only_if { client[:api_version] >= 1800 }
only_if { client[:api_version] >= 2400 }
end

# Example: Adds 'Fc1' to 'Scope1' and 'Scope2'
Expand Down
6 changes: 3 additions & 3 deletions examples/fcoe_network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200
api_version: 2400
}

oneview_fcoe_network 'FCoE1' do
Expand All @@ -37,7 +37,7 @@
action :create
end

# Only from API1800
# Only from API2400
# Example: Bulk deletes fcoe networks.
oneview_fcoe_network 'None' do
client my_client
Expand All @@ -46,7 +46,7 @@
networkUris: [ test1['uri'] ]
)
action :delete_bulk
only_if { client[:api_version] >= 1800 }
only_if { client[:api_version] >= 2400 }
end

# Adds 'FCoE1' to 'Scope1' and 'Scope2'
Expand Down
2 changes: 1 addition & 1 deletion examples/hypervisor_cluster_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200
api_version: 2400
}

hcm = OneviewCookbook::Helper.load_resource(my_client, type: 'HypervisorManager', id: 'HCM')
Expand Down
2 changes: 1 addition & 1 deletion examples/hypervisor_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200
api_version: 2400
}

# No action will be performed
Expand Down
2 changes: 1 addition & 1 deletion examples/interconnect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200
api_version: 2400
}

interconnect = '0000A66101, interconnect 1'
Expand Down
2 changes: 1 addition & 1 deletion examples/logical_enclosure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
variant: 'Synergy',
api_version: 2200
api_version: 2400
}

# Example: Create a logical enclosure if it's missing
Expand Down
2 changes: 1 addition & 1 deletion examples/logical_interconnect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_variant: 'Synergy',
api_version: 2200
api_version: 2400
}

# No action
Expand Down
2 changes: 1 addition & 1 deletion examples/network_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200
api_version: 2400
}

# Create a few networks for the next examples
Expand Down
2 changes: 1 addition & 1 deletion examples/scope.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200
api_version: 2400
}

# Example: Create a Scope with a simple description
Expand Down
2 changes: 1 addition & 1 deletion examples/server_certificate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200
api_version: 2400
}

# Example: Action will do nothing
Expand Down
2 changes: 1 addition & 1 deletion examples/server_hardware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200,
api_version: 2400,
api_variant: 'Synergy'
}

Expand Down
2 changes: 1 addition & 1 deletion examples/server_hardware_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200,
api_version: 2400,
api_variant: 'Synergy'
}

Expand Down
2 changes: 1 addition & 1 deletion examples/server_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200
api_version: 2400
}

my_server_hardware_type = 'SY 480 Gen9 1'
Expand Down
2 changes: 1 addition & 1 deletion examples/server_profile_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200
api_version: 2400
}

enclosure_group = 'EG'
Expand Down
4 changes: 2 additions & 2 deletions examples/storage_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.

node.default['oneview']['api_version'] = 1800
node.default['oneview']['api_version'] = 2400

my_client = {
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200
api_version: 2400
}

# Ensures the Storage Pool is managed by the HPE OneView appliance
Expand Down
4 changes: 2 additions & 2 deletions examples/storage_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.

node.default['oneview']['api_version'] = 1800
node.default['oneview']['api_version'] = 2400

my_client = {
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200
api_version: 2400
}

# Example: add storage system or update if it already exists
Expand Down
2 changes: 1 addition & 1 deletion examples/uplink_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200
api_version: 2400
}

# Example: creates or updates an uplink set
Expand Down
2 changes: 1 addition & 1 deletion examples/volume.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200
api_version: 2400
}

# Example: Create a volume
Expand Down
2 changes: 1 addition & 1 deletion examples/volume_attachment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200
api_version: 2400
}

# No action
Expand Down
2 changes: 1 addition & 1 deletion examples/volume_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
url: ENV['ONEVIEWSDK_URL'],
user: ENV['ONEVIEWSDK_USER'],
password: ENV['ONEVIEWSDK_PASSWORD'],
api_version: 2200
api_version: 2400
}

properties = {
Expand Down
7 changes: 4 additions & 3 deletions libraries/matchers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@
oneview_logical_enclosure: %i[create_if_missing create update_from_group reconfigure set_script delete create_support_dump],
oneview_logical_interconnect_group: standard_actions + scope_actions,
oneview_logical_interconnect: %i[none add_interconnect remove_interconnect update_internal_networks update_settings
update_ethernet_settings update_igmp_settings update_port_monitor update_qos_configuration
update_telemetry_configuration update_snmp_configuration update_firmware stage_firmware
validate_bulk_inconsistency activate_firmware update_from_group reapply_configuration] + scope_actions,
update_ethernet_settings update_igmp_settings update_port_flap_settings update_port_monitor
update_qos_configuration update_telemetry_configuration update_snmp_configuration update_firmware
stage_firmware validate_bulk_inconsistency activate_firmware update_from_group
reapply_configuration] + scope_actions,
oneview_logical_switch_group: standard_actions + scope_actions,
oneview_logical_switch: standard_actions + scope_actions + %i[refresh],
oneview_managed_san: %i[refresh set_policy set_public_attributes],
Expand Down
31 changes: 31 additions & 0 deletions libraries/resource_providers/api2400.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# (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 'api2200'

module OneviewCookbook
# Module for Oneview API 2400 Resources
module API2400
SUPPORTED_VARIANTS ||= %w[C7000 Synergy].freeze

# Get resource class that matches the type given
# @param [String] type Name of the desired class type
# @param [String] variant Variant (C7000 or Synergy)
# @raise [RuntimeError] if resource class not found
# @return [Class] Resource class
def self.provider_named(type, variant)
OneviewCookbook::Helper.get_provider_named(type, self, variant)
end
end
end

# Load all API-specific resources:
Dir[File.dirname(__FILE__) + '/api2400/*.rb'].each { |file| require file }
Loading

0 comments on commit d7cf5fd

Please sign in to comment.