Skip to content

Commit

Permalink
Merge branch 'api600_server_hardware' of github.com:HewlettPackard/on…
Browse files Browse the repository at this point in the history
…eview-sdk-ruby into api600_server_hardware
  • Loading branch information
madhav-bharadwaj committed Mar 16, 2018
2 parents 9a50970 + 9f6961d commit 6f2105a
Show file tree
Hide file tree
Showing 19 changed files with 176 additions and 76 deletions.
11 changes: 7 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ Extends support of the SDK to OneView Rest API version 600 (OneView v4.0).

#### Features supported
This release adds support to OneView Rest API version 600 for the hardware variants C7000 and Synergy to the already existing features:
- FC Network
- FCoE Network
- Internal Link Set
- Server Hardware
- Ethernet Network
- FC Network
- FCoE Network
- Internal Link Set
- SAS Interconnect
- SAS Interconnect Type
- Server Hardware

## v5.3.0

Expand Down
29 changes: 14 additions & 15 deletions endpoints-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,14 @@ OneviewSDK::Datacenter.find_by(@client, width: 11000).map(&:remove)
|<sub>/rest/fc-sans/endpoints</sub> | GET | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: |
|<sub>/rest/fc-sans/endpoints/{id}</sub> | GET | :heavy_minus_sign: | :heavy_multiplication_x: | :heavy_multiplication_x:
| **Ethernet Networks** |
|<sub>/rest/ethernet-networks</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/ethernet-networks</sub> | POST | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/ethernet-networks/bulk</sub> | POST | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/ethernet-networks/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/ethernet-networks/{id}</sub> | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/ethernet-networks/{id}</sub> | PATCH | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/ethernet-networks/{id}</sub> | DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/ethernet-networks/{id}/associatedProfiles</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/ethernet-networks/{id}/associatedUplinkGroups</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/ethernet-networks</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/ethernet-networks</sub> | POST | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/ethernet-networks/bulk</sub> | POST | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/ethernet-networks/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/ethernet-networks/{id}</sub> | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/ethernet-networks/{id}</sub> | PATCH | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :heavy_minus_sign: | |<sub>/rest/ethernet-networks/{id}</sub> | DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/ethernet-networks/{id}/associatedProfiles</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/ethernet-networks/{id}/associatedUplinkGroups</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| **Events** |
|<sub>/rest/events</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/events</sub> | POST | :white_check_mark: | :white_check_mark: | :white_check_mark: |
Expand Down Expand Up @@ -376,13 +375,13 @@ OneviewSDK::Datacenter.find_by(@client, width: 11000).map(&:remove)
|<sub>/rest/fc-sans/device-managers/{id}</sub> | DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/fc-sans/providers/{id}/device-managers</sub> | POST | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign: |
| **SAS Interconnect Types** |
|<sub>/rest/sas-interconnect-types</sub> | GET | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/sas-interconnect-types/{id}</sub> | GET | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/sas-interconnect-types</sub> | GET | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/sas-interconnect-types/{id}</sub> | GET | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| **SAS Interconnects** |
|<sub>/rest/sas-interconnects</sub> | GET | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/sas-interconnects/{id}</sub> | GET | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/sas-interconnects/{id}</sub> | PATCH | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/sas-interconnects/{id}/refreshState</sub> | PUT | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/sas-interconnects</sub> | GET | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/sas-interconnects/{id}</sub> | GET | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/sas-interconnects/{id}</sub> | PATCH | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/sas-interconnects/{id}/refreshState</sub> | PUT | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| **SAS Logical Interconnect Groups** |
|<sub>/rest/sas-logical-interconnect-groups</sub> | POST | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/sas-logical-interconnect-groups</sub> | GET | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |
Expand Down
12 changes: 8 additions & 4 deletions examples/shared_samples/ethernet_network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@
# - API300 for Synergy
# - API500 for C7000
# - API500 for Synergy
# - API600 for C7000
# - API600 for Synergy

# Resources that can be created according to parameters:
# api_version = 200 & variant = any to OneviewSDK::API200::EthernetNetwork
# api_version = 300 & variant = C7000 to OneviewSDK::API300::C7000::EthernetNetwork
# api_version = 300 & variant = Synergy to OneviewSDK::API300::C7000::EthernetNetwork
# api_version = 300 & variant = Synergy to OneviewSDK::API300::Synergy::EthernetNetwork
# api_version = 500 & variant = C7000 to OneviewSDK::API500::C7000::EthernetNetwork
# api_version = 500 & variant = Synergy to OneviewSDK::API500::C7000::EthernetNetwork
# api_version = 500 & variant = Synergy to OneviewSDK::API500::Synergy::EthernetNetwork
# api_version = 600 & variant = C7000 to OneviewSDK::API600::C7000::EthernetNetwork
# api_version = 600 & variant = Synergy to OneviewSDK::API600::Synergy::EthernetNetwork

# Resource Class used in this sample
ethernet_class = OneviewSDK.resource_named('EthernetNetwork', @client.api_version)
Expand Down Expand Up @@ -101,8 +105,8 @@
list.sort_by! { |e| e['name'] }
list.each { |e| puts " #{e['name']}" }

# only for API300 and API500
if @client.api_version.to_i > 200
# only for API300 and API500, not supported for OneView 4.0 or greater
if @client.api_version.to_i > 200 && @client.api_version.to_i < 600
scope_1 = scope_class.new(@client, name: 'Scope 1')
scope_1.create!
scope_2 = scope_class.new(@client, name: 'Scope 2')
Expand Down
3 changes: 2 additions & 1 deletion examples/shared_samples/sas_interconnect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
require_relative '../_client' # Gives access to @client

# Supported APIs:
# - 300, 500 Synergy only
# - 300, 500, 600 Synergy only

# Resources that can be created according to parameters:
# api_version = 300 & variant = Synergy to OneviewSDK::API300::Synergy::SASInterconnect
# api_version = 500 & variant = Synergy to OneviewSDK::API500::Synergy::SASInterconnect
# api_version = 600 & variant = Synergy to OneviewSDK::API600::Synergy::SASInterconnect

# Resource Class used in this sample
sas_int_class = OneviewSDK.resource_named('SASInterconnect', @client.api_version)
Expand Down
29 changes: 27 additions & 2 deletions lib/oneview-sdk/resource/api600/c7000/ethernet_network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,38 @@
# 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/c7000/ethernet_network'
require_relative '../../api500/c7000/ethernet_network'

module OneviewSDK
module API600
module C7000
# Ethernet network resource implementation for API600 C7000
class EthernetNetwork < OneviewSDK::API300::C7000::EthernetNetwork
class EthernetNetwork < OneviewSDK::API500::C7000::EthernetNetwork
# Create a resource object, associate it with a client, and set its properties.
# @param [OneviewSDK::Client] client The client object for the OneView appliance
# @param [Hash] params The options for this resource (key-value pairs)
# @param [Integer] api_ver The api version to use when interracting with this resource.
def initialize(client, params = {}, api_ver = nil)
@data ||= {}
# Default values:
@data['ethernetNetworkType'] ||= 'Tagged'
@data['type'] ||= 'ethernet-networkV4'
super
end

# Bulk create the ethernet networks
# @param [OneviewSDK::Client] client The client object for the OneView appliance
# @param [Hash] options information necessary to create networks
# @return [Array] list of ethernet networks created
def self.bulk_create(client, options)
range = options[:vlanIdRange].split('-').map(&:to_i)
options[:type] = 'bulk-ethernet-networkV1'
response = client.rest_post(BASE_URI + '/bulk', { 'body' => options }, client.api_version)
client.response_handler(response)
network_names = []
range[0].upto(range[1]) { |i| network_names << "#{options[:namePrefix]}_#{i}" }
OneviewSDK::EthernetNetwork.get_all(client).select { |network| network_names.include?(network['name']) }
end
end
end
end
Expand Down
29 changes: 27 additions & 2 deletions lib/oneview-sdk/resource/api600/synergy/ethernet_network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,38 @@
# 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/ethernet_network'
require_relative '../../api500/synergy/ethernet_network'

module OneviewSDK
module API600
module Synergy
# Ethernet network resource implementation for API600 Synergy
class EthernetNetwork < OneviewSDK::API300::Synergy::EthernetNetwork
class EthernetNetwork < OneviewSDK::API500::Synergy::EthernetNetwork
# Create a resource object, associate it with a client, and set its properties.
# @param [OneviewSDK::Client] client The client object for the OneView appliance
# @param [Hash] params The options for this resource (key-value pairs)
# @param [Integer] api_ver The api version to use when interracting with this resource.
def initialize(client, params = {}, api_ver = nil)
@data ||= {}
# Default values:
@data['ethernetNetworkType'] ||= 'Tagged'
@data['type'] ||= 'ethernet-networkV4'
super
end

# Bulk create the ethernet networks
# @param [OneviewSDK::Client] client The client object for the OneView appliance
# @param [Hash] options information necessary to create networks
# @return [Array] list of ethernet networks created
def self.bulk_create(client, options)
range = options[:vlanIdRange].split('-').map(&:to_i)
options[:type] = 'bulk-ethernet-networkV1'
response = client.rest_post(BASE_URI + '/bulk', { 'body' => options }, client.api_version)
client.response_handler(response)
network_names = []
range[0].upto(range[1]) { |i| network_names << "#{options[:namePrefix]}_#{i}" }
OneviewSDK::EthernetNetwork.get_all(client).select { |network| network_names.include?(network['name']) }
end
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/oneview-sdk/resource/api600/synergy/sas_interconnect.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.

require_relative '../../api300/synergy/sas_interconnect'
require_relative '../../api500/synergy/sas_interconnect'

module OneviewSDK
module API600
module Synergy
# SAS Interconnect resource implementation for API600 Synergy
class SASInterconnect < OneviewSDK::API300::Synergy::SASInterconnect
class SASInterconnect < OneviewSDK::API500::Synergy::SASInterconnect
end
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require 'spec_helper'

klass = OneviewSDK::API500::C7000::EthernetNetwork
klass = OneviewSDK::API600::C7000::EthernetNetwork
RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do
include_examples 'EthernetNetworkCreateExample', 'integration api500 context' do
let(:current_client) { $client_500 }
include_examples 'EthernetNetworkCreateExample', 'integration api600 context' do
let(:current_client) { $client_600 }
end
end
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require 'spec_helper'

klass = OneviewSDK::API500::C7000::EthernetNetwork
klass = OneviewSDK::API600::C7000::EthernetNetwork
RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do
include_examples 'EthernetNetworkDeleteExample', 'integration api500 context' do
let(:current_client) { $client_500 }
include_examples 'EthernetNetworkDeleteExample', 'integration api600 context' do
let(:current_client) { $client_600 }
end
end
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
require 'spec_helper'

RSpec.describe OneviewSDK::API500::C7000::EthernetNetwork, integration: true, type: UPDATE do
include_examples 'EthernetNetworkUpdateExample', 'integration api500 context' do
let(:current_client) { $client_500 }
end

include_examples 'ScopeHelperMethodsExample', OneviewSDK::API500::C7000::Scope do
let(:current_client) { $client_500 }
let(:item) { described_class.get_all(current_client).first }
RSpec.describe OneviewSDK::API600::C7000::EthernetNetwork, integration: true, type: UPDATE do
include_examples 'EthernetNetworkUpdateExample', 'integration api600 context' do
let(:current_client) { $client_600 }
end
end
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require 'spec_helper'

klass = OneviewSDK::API500::Synergy::EthernetNetwork
klass = OneviewSDK::API600::Synergy::EthernetNetwork
RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do
include_examples 'EthernetNetworkCreateExample', 'integration api500 context' do
let(:current_client) { $client_500_synergy }
include_examples 'EthernetNetworkCreateExample', 'integration api600 context' do
let(:current_client) { $client_600_synergy }
end
end
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require 'spec_helper'

klass = OneviewSDK::API500::Synergy::EthernetNetwork
klass = OneviewSDK::API600::Synergy::EthernetNetwork
RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do
include_examples 'EthernetNetworkDeleteExample', 'integration api500 context' do
let(:current_client) { $client_500_synergy }
include_examples 'EthernetNetworkDeleteExample', 'integration api600 context' do
let(:current_client) { $client_600_synergy }
end
end
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
require 'spec_helper'

RSpec.describe OneviewSDK::API500::Synergy::EthernetNetwork, integration: true, type: UPDATE do
include_examples 'EthernetNetworkUpdateExample', 'integration api500 context' do
let(:current_client) { $client_500_synergy }
end

include_examples 'ScopeHelperMethodsExample', OneviewSDK::API500::Synergy::Scope do
let(:current_client) { $client_500_synergy }
let(:item) { described_class.get_all(current_client).first }
RSpec.describe OneviewSDK::API600::Synergy::EthernetNetwork, integration: true, type: UPDATE do
include_examples 'EthernetNetworkUpdateExample', 'integration api600 context' do
let(:current_client) { $client_600_synergy }
end
end
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

klass = OneviewSDK::API500::Synergy::SASInterconnect
klass = OneviewSDK::API600::Synergy::SASInterconnect
RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do
let(:current_client) { $client_500_synergy }
include_examples 'SASInterconnectCreateExample', 'integration api500 context'
let(:current_client) { $client_600_synergy }
include_examples 'SASInterconnectCreateExample', 'integration api600 context'
end
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

klass = OneviewSDK::API500::Synergy::SASInterconnect
klass = OneviewSDK::API600::Synergy::SASInterconnect
RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do
let(:current_client) { $client_500_synergy }
include_examples 'SASInterconnectDeleteExample', 'integration api500 context'
let(:current_client) { $client_600_synergy }
include_examples 'SASInterconnectDeleteExample', 'integration api600 context'
end
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

klass = OneviewSDK::API500::Synergy::SASInterconnect
klass = OneviewSDK::API600::Synergy::SASInterconnect
RSpec.describe klass, integration: true, type: UPDATE do
let(:current_client) { $client_500_synergy }
include_examples 'SASInterconnectUpdateExample', 'integration api500 context'
let(:current_client) { $client_600_synergy }
include_examples 'SASInterconnectUpdateExample', 'integration api600 context'
end
Loading

0 comments on commit 6f2105a

Please sign in to comment.