From b0eec3e7ca5ea9bb53947d24a1b7775876ae1e0c Mon Sep 17 00:00:00 2001 From: jyothis Date: Mon, 20 Jan 2020 04:06:23 -0500 Subject: [PATCH 1/6] Fixed update request for enclosure group. --- CHANGELOG.md | 5 +++++ lib/oneview-sdk/resource/api1200/c7000/enclosure_group.rb | 4 ++++ lib/oneview-sdk/resource/api1200/synergy/enclosure_group.rb | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3304a1791..28a4ec38f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v5.8.1 (UnRelaesed) + +#### Notes +- Bugfix for the update request for enclosure group. + ## v5.8.0 #### Notes diff --git a/lib/oneview-sdk/resource/api1200/c7000/enclosure_group.rb b/lib/oneview-sdk/resource/api1200/c7000/enclosure_group.rb index c2a2a385e..c950d65a4 100644 --- a/lib/oneview-sdk/resource/api1200/c7000/enclosure_group.rb +++ b/lib/oneview-sdk/resource/api1200/c7000/enclosure_group.rb @@ -23,6 +23,10 @@ class EnclosureGroup < OneviewSDK::API1000::C7000::EnclosureGroup def initialize(client, params = {}, api_ver = nil) @data ||= {} # Default values: + super + end + + def update(attributes = {}) @data['type'] ||= 'EnclosureGroupV8' super end diff --git a/lib/oneview-sdk/resource/api1200/synergy/enclosure_group.rb b/lib/oneview-sdk/resource/api1200/synergy/enclosure_group.rb index fed2354c8..bf2e4aa71 100644 --- a/lib/oneview-sdk/resource/api1200/synergy/enclosure_group.rb +++ b/lib/oneview-sdk/resource/api1200/synergy/enclosure_group.rb @@ -23,6 +23,10 @@ class EnclosureGroup < OneviewSDK::API1000::Synergy::EnclosureGroup def initialize(client, params = {}, api_ver = nil) @data ||= {} # Default values: + super + end + + def update(attributes = {}) @data['type'] ||= 'EnclosureGroupV8' super end From 877c1559efc765c9967f3f8db589d6315f459733 Mon Sep 17 00:00:00 2001 From: jyothis Date: Mon, 20 Jan 2020 04:14:43 -0500 Subject: [PATCH 2/6] Formatting issue fixed. --- lib/oneview-sdk/resource/api1200/c7000/enclosure_group.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oneview-sdk/resource/api1200/c7000/enclosure_group.rb b/lib/oneview-sdk/resource/api1200/c7000/enclosure_group.rb index c950d65a4..3f2d73b55 100644 --- a/lib/oneview-sdk/resource/api1200/c7000/enclosure_group.rb +++ b/lib/oneview-sdk/resource/api1200/c7000/enclosure_group.rb @@ -25,7 +25,7 @@ def initialize(client, params = {}, api_ver = nil) # Default values: super end - + def update(attributes = {}) @data['type'] ||= 'EnclosureGroupV8' super From 40c188ace48666a9043f1cd3fe2e43c5461d530d Mon Sep 17 00:00:00 2001 From: jyothis Date: Tue, 11 Feb 2020 13:22:54 -0500 Subject: [PATCH 3/6] Connection template --- examples/_client.rb.example | 11 +++++----- .../shared_samples/connection_template.rb | 2 +- examples/shared_samples/enclosure_group.rb | 18 --------------- .../api1000/c7000/connection_template.rb | 22 +++++++++++++++++++ .../api1000/synergy/connection_template.rb | 22 +++++++++++++++++++ .../api1200/c7000/connection_template.rb | 22 +++++++++++++++++++ .../api1200/synergy/connection_template.rb | 22 +++++++++++++++++++ .../api800/c7000/connection_template.rb | 22 +++++++++++++++++++ .../api800/synergy/connection_template.rb | 22 +++++++++++++++++++ 9 files changed, 139 insertions(+), 24 deletions(-) create mode 100644 lib/oneview-sdk/resource/api1000/c7000/connection_template.rb create mode 100644 lib/oneview-sdk/resource/api1000/synergy/connection_template.rb create mode 100644 lib/oneview-sdk/resource/api1200/c7000/connection_template.rb create mode 100644 lib/oneview-sdk/resource/api1200/synergy/connection_template.rb create mode 100644 lib/oneview-sdk/resource/api800/c7000/connection_template.rb create mode 100644 lib/oneview-sdk/resource/api800/synergy/connection_template.rb diff --git a/examples/_client.rb.example b/examples/_client.rb.example index 16aeb7c9d..460f58677 100644 --- a/examples/_client.rb.example +++ b/examples/_client.rb.example @@ -2,10 +2,11 @@ require_relative './../lib/oneview-sdk' require 'pry' @client = OneviewSDK::Client.new( - url: 'https://oneview.example.com', # or set ENV['ONEVIEWSDK_URL'] - user: 'Administrator', # or set ENV['ONEVIEWSDK_USER'] - password: 'secret123', # or set ENV['ONEVIEWSDK_PASSWORD'] - ssl_enabled: false + url: ENV['ONEVIEWSDK_URL'], + user: ENV['ONEVIEWSDK_USER'], + password: ENV['ONEVIEWSDK_PASSWORD'], + ssl_enabled: false, + version: ENV['ONEVIEWSDK_VERSION'], ) ## This setting allows the SDK to flush messages to the screen as it is being run. @@ -17,7 +18,7 @@ require 'pry' # when referring to OneviewSDK::::Synergy:: # Versions supported: [200, 300, 500, 600, 800] # Variants supported[C7000, Synergy] -# OneviewSDK::API.variant='Synergy' +OneviewSDK::API.variant='Synergy' puts "Connected to OneView appliance at #{@client.url}\n\n" diff --git a/examples/shared_samples/connection_template.rb b/examples/shared_samples/connection_template.rb index 5868266b2..96e007e2b 100644 --- a/examples/shared_samples/connection_template.rb +++ b/examples/shared_samples/connection_template.rb @@ -42,7 +42,7 @@ puts " Name: #{c[:name]} with uri: #{c[:uri]}" end -conn_name = connections.first['name'] +conn_name = connections.fetch(2)['name'] puts "\nFinding a connection template by name. Name: #{conn_name}" item = conn_template_class.find_by(@client, name: conn_name).first diff --git a/examples/shared_samples/enclosure_group.rb b/examples/shared_samples/enclosure_group.rb index 92caf40f6..43b03b3ac 100644 --- a/examples/shared_samples/enclosure_group.rb +++ b/examples/shared_samples/enclosure_group.rb @@ -65,24 +65,6 @@ item.update(name: 'OneViewSDK Test Enclosure_Group Updated') puts "\nUpdated #{type} with new name = '#{item[:name]}' sucessfully." -begin - command = '#TEST COMMAND' - puts "\nSetting a script with command = '#{command}'" - item.set_script(command) - puts "\nScript attributed sucessfully." -rescue OneviewSDK::MethodUnavailable => e - puts "\n#{e}. Available only for C7000." -end - -begin - puts "\nGetting a script" - script = item.get_script - puts "\nScript retrieved sucessfully." - puts script -rescue OneviewSDK::MethodUnavailable => e - puts "\n#{e}. Available only for C7000." -end - puts "\nDeleting the #{type} with name = '#{item[:name]}' and uri = '#{item[:uri]}''" item.delete puts "\nSucessfully deleted #{type} '#{item[:name]}'." diff --git a/lib/oneview-sdk/resource/api1000/c7000/connection_template.rb b/lib/oneview-sdk/resource/api1000/c7000/connection_template.rb new file mode 100644 index 000000000..5d5538695 --- /dev/null +++ b/lib/oneview-sdk/resource/api1000/c7000/connection_template.rb @@ -0,0 +1,22 @@ +# (c) Copyright 2017 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 '../../api800/c7000/connection_template' + +module OneviewSDK + module API1000 + module C7000 + # Connection template resource implementation for API1000 C7000 + class ConnectionTemplate < OneviewSDK::API800::C7000::ConnectionTemplate + end + end + end +end diff --git a/lib/oneview-sdk/resource/api1000/synergy/connection_template.rb b/lib/oneview-sdk/resource/api1000/synergy/connection_template.rb new file mode 100644 index 000000000..cd1c7cb7d --- /dev/null +++ b/lib/oneview-sdk/resource/api1000/synergy/connection_template.rb @@ -0,0 +1,22 @@ +# (c) Copyright 2017 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 '../../api800/synergy/connection_template' + +module OneviewSDK + module API1000 + module Synergy + # Connection template resource implementation for API1000 Synergy + class ConnectionTemplate < OneviewSDK::API800::Synergy::ConnectionTemplate + end + end + end +end diff --git a/lib/oneview-sdk/resource/api1200/c7000/connection_template.rb b/lib/oneview-sdk/resource/api1200/c7000/connection_template.rb new file mode 100644 index 000000000..094c8ef11 --- /dev/null +++ b/lib/oneview-sdk/resource/api1200/c7000/connection_template.rb @@ -0,0 +1,22 @@ +# (c) Copyright 2017 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 '../../api1000/c7000/connection_template' + +module OneviewSDK + module API1200 + module C7000 + # Connection template resource implementation for API1200 C7000 + class ConnectionTemplate < OneviewSDK::API1000::C7000::ConnectionTemplate + end + end + end +end diff --git a/lib/oneview-sdk/resource/api1200/synergy/connection_template.rb b/lib/oneview-sdk/resource/api1200/synergy/connection_template.rb new file mode 100644 index 000000000..4dfc80c73 --- /dev/null +++ b/lib/oneview-sdk/resource/api1200/synergy/connection_template.rb @@ -0,0 +1,22 @@ +# (c) Copyright 2017 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 '../../api1000/synergy/connection_template' + +module OneviewSDK + module API1200 + module Synergy + # Connection template resource implementation for API1200 Synergy + class ConnectionTemplate < OneviewSDK::API1000::Synergy::ConnectionTemplate + end + end + end +end diff --git a/lib/oneview-sdk/resource/api800/c7000/connection_template.rb b/lib/oneview-sdk/resource/api800/c7000/connection_template.rb new file mode 100644 index 000000000..817a60cc7 --- /dev/null +++ b/lib/oneview-sdk/resource/api800/c7000/connection_template.rb @@ -0,0 +1,22 @@ +# (c) Copyright 2017 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 '../../api600/c7000/connection_template' + +module OneviewSDK + module API800 + module C7000 + # Connection template resource implementation for API800 C7000 + class ConnectionTemplate < OneviewSDK::API600::C7000::ConnectionTemplate + end + end + end +end diff --git a/lib/oneview-sdk/resource/api800/synergy/connection_template.rb b/lib/oneview-sdk/resource/api800/synergy/connection_template.rb new file mode 100644 index 000000000..5b4067e6b --- /dev/null +++ b/lib/oneview-sdk/resource/api800/synergy/connection_template.rb @@ -0,0 +1,22 @@ +# (c) Copyright 2017 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 '../../api600/synergy/connection_template' + +module OneviewSDK + module API800 + module Synergy + # Connection template resource implementation for API800 Synergy + class ConnectionTemplate < OneviewSDK::API600::Synergy::ConnectionTemplate + end + end + end +end From ef76934abcca41245df10a8ba576f0cc70eea2db Mon Sep 17 00:00:00 2001 From: jyothis Date: Tue, 11 Feb 2020 13:25:53 -0500 Subject: [PATCH 4/6] Reset files. --- examples/_client.rb.example | 11 +++++------ examples/shared_samples/connection_template.rb | 2 +- examples/shared_samples/enclosure_group.rb | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/examples/_client.rb.example b/examples/_client.rb.example index 460f58677..16aeb7c9d 100644 --- a/examples/_client.rb.example +++ b/examples/_client.rb.example @@ -2,11 +2,10 @@ require_relative './../lib/oneview-sdk' require 'pry' @client = OneviewSDK::Client.new( - url: ENV['ONEVIEWSDK_URL'], - user: ENV['ONEVIEWSDK_USER'], - password: ENV['ONEVIEWSDK_PASSWORD'], - ssl_enabled: false, - version: ENV['ONEVIEWSDK_VERSION'], + url: 'https://oneview.example.com', # or set ENV['ONEVIEWSDK_URL'] + user: 'Administrator', # or set ENV['ONEVIEWSDK_USER'] + password: 'secret123', # or set ENV['ONEVIEWSDK_PASSWORD'] + ssl_enabled: false ) ## This setting allows the SDK to flush messages to the screen as it is being run. @@ -18,7 +17,7 @@ require 'pry' # when referring to OneviewSDK::::Synergy:: # Versions supported: [200, 300, 500, 600, 800] # Variants supported[C7000, Synergy] -OneviewSDK::API.variant='Synergy' +# OneviewSDK::API.variant='Synergy' puts "Connected to OneView appliance at #{@client.url}\n\n" diff --git a/examples/shared_samples/connection_template.rb b/examples/shared_samples/connection_template.rb index 96e007e2b..5868266b2 100644 --- a/examples/shared_samples/connection_template.rb +++ b/examples/shared_samples/connection_template.rb @@ -42,7 +42,7 @@ puts " Name: #{c[:name]} with uri: #{c[:uri]}" end -conn_name = connections.fetch(2)['name'] +conn_name = connections.first['name'] puts "\nFinding a connection template by name. Name: #{conn_name}" item = conn_template_class.find_by(@client, name: conn_name).first diff --git a/examples/shared_samples/enclosure_group.rb b/examples/shared_samples/enclosure_group.rb index 43b03b3ac..92caf40f6 100644 --- a/examples/shared_samples/enclosure_group.rb +++ b/examples/shared_samples/enclosure_group.rb @@ -65,6 +65,24 @@ item.update(name: 'OneViewSDK Test Enclosure_Group Updated') puts "\nUpdated #{type} with new name = '#{item[:name]}' sucessfully." +begin + command = '#TEST COMMAND' + puts "\nSetting a script with command = '#{command}'" + item.set_script(command) + puts "\nScript attributed sucessfully." +rescue OneviewSDK::MethodUnavailable => e + puts "\n#{e}. Available only for C7000." +end + +begin + puts "\nGetting a script" + script = item.get_script + puts "\nScript retrieved sucessfully." + puts script +rescue OneviewSDK::MethodUnavailable => e + puts "\n#{e}. Available only for C7000." +end + puts "\nDeleting the #{type} with name = '#{item[:name]}' and uri = '#{item[:uri]}''" item.delete puts "\nSucessfully deleted #{type} '#{item[:name]}'." From 021382800dd202c8976555608cf27fc3d0211710 Mon Sep 17 00:00:00 2001 From: jyothis Date: Tue, 11 Feb 2020 14:00:44 -0500 Subject: [PATCH 5/6] Docs updated. --- CHANGELOG.md | 7 +++++++ endpoints-support.md | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3304a1791..e0adefe10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## v5.9.0 +- This release supports OneView Rest API versions 800/1000/1200 minimally where we can use OneView v4.10/v4.20/v5.0 with this SDK. No new fields are added/deleted to support OneView Rest API 800/1000/1200. Complete support will be done in next releases. + +#### Features Supported +This release adds support to OneView Rest API version 800/1000/1200 for the hardware variants C7000 and Synergy to the already existing features: +- Connection Template + ## v5.8.0 #### Notes diff --git a/endpoints-support.md b/endpoints-support.md index 16a988506..170f413b6 100644 --- a/endpoints-support.md +++ b/endpoints-support.md @@ -31,10 +31,10 @@ OneviewSDK::Datacenter.find_by(@client, width: 11000).map(&:remove) |/rest/alerts/{id} |DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | |/rest/alerts/AlertChangeLog/{id} |DELETE | :white_check_mark: | :white_check_mark: |:white_check_mark: | :white_check_mark: | | **Connection Templates** | -|/rest/connection-templates |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -|/rest/connection-templates/defaultConnectionTemplate |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -|/rest/connection-templates/{id} |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -|/rest/connection-templates/{id} |PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +|/rest/connection-templates |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +|/rest/connection-templates/defaultConnectionTemplate |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +|/rest/connection-templates/{id} |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +|/rest/connection-templates/{id} |PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | **Datacenters** | |/rest/datacenters | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | |/rest/datacenters | POST | :white_check_mark: | :white_check_mark: | :white_check_mark: | From d5b91c399e48ac09af6214525e36131d7c9275b2 Mon Sep 17 00:00:00 2001 From: jyothis Date: Tue, 11 Feb 2020 14:19:48 -0500 Subject: [PATCH 6/6] Changelog and version. --- CHANGELOG.md | 2 +- lib/oneview-sdk/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0adefe10..838ac9707 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## v5.9.0 +## v5.9.0 (Unreleased) - This release supports OneView Rest API versions 800/1000/1200 minimally where we can use OneView v4.10/v4.20/v5.0 with this SDK. No new fields are added/deleted to support OneView Rest API 800/1000/1200. Complete support will be done in next releases. #### Features Supported diff --git a/lib/oneview-sdk/version.rb b/lib/oneview-sdk/version.rb index 4b221a67a..8250fe0ad 100644 --- a/lib/oneview-sdk/version.rb +++ b/lib/oneview-sdk/version.rb @@ -11,5 +11,5 @@ # Gem version defined here module OneviewSDK - VERSION = '5.8.0'.freeze + VERSION = '5.9.0'.freeze end