Skip to content

Commit

Permalink
Merge 1d0737e into ec5b0b2
Browse files Browse the repository at this point in the history
  • Loading branch information
chebroluharika committed May 26, 2020
2 parents ec5b0b2 + 1d0737e commit edc846b
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 24 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This release extends support of the SDK to OneView REST API version 1600 (OneVie
- FC Network
- FCOE Network
- Hypervisor Manager
- Interconnects
- Logical Enclosure
- OS Deployment Plan
- Server Hardware
Expand Down
28 changes: 14 additions & 14 deletions endpoints-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,20 +142,20 @@ OneviewSDK::Datacenter.find_by(@client, width: 11000).map(&:remove)
|<sub>/rest/interconnect-types</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnect-types/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |
| **Interconnects** |
|<sub>/rest/interconnects</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}</sub> | PATCH | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}/configuration</sub> | PUT | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}/pluggableModuleInformation</sub> | GET | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}/ports</sub> | GET | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: |:heavy_multiplication_x: |
|<sub>/rest/interconnects/{id}/ports</sub> | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}/ports/{portId:.+}</sub> | GET | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: |:heavy_multiplication_x: |
|<sub>/rest/interconnects/{id}/resetportprotection</sub> | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}/statistics</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}/statistics/{portName:.+}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}/statistics/{portName:.+}/subport/{subportNum}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}/update-ports</sub> | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}/nameServers</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}</sub> | PATCH | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}/configuration</sub> | PUT | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}/pluggableModuleInformation</sub> | GET | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}/ports</sub> | GET | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: |:heavy_multiplication_x: |:heavy_multiplication_x: |
|<sub>/rest/interconnects/{id}/ports</sub> | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}/ports/{portId:.+}</sub> | GET | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x: |:heavy_multiplication_x: |:heavy_multiplication_x: |
|<sub>/rest/interconnects/{id}/resetportprotection</sub> | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}/statistics</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}/statistics/{portName:.+}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}/statistics/{portName:.+}/subport/{subportNum}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}/update-ports</sub> | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/interconnects/{id}/nameServers</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
| **Internal Link Sets** |
|<sub>/rest/internal-link-sets</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/internal-link-sets/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
Expand Down
14 changes: 4 additions & 10 deletions examples/shared_samples/interconnect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,10 @@
# NOTE: You'll need to add an interconnect with state Configured and a port linked.
#
# Supported APIs:
# - 200, 300, 500, 600
#
# Resources that can be created according to parameters:
# api_version = 200 & variant = any to OneviewSDK::API200::Interconnect'
# api_version = 300 & variant = C7000 to OneviewSDK::API300::C7000::Interconnect'
# api_version = 300 & variant = Synergy to OneviewSDK::API300::Synergy::Interconnect'
# api_version = 500 & variant = C7000 to OneviewSDK::API500::C7000::Interconnect'
# api_version = 500 & variant = Synergy to OneviewSDK::API500::Synergy::Interconnect'
# api_version = 600 & variant = C7000 to OneviewSDK::API600::C7000::Interconnect'
# api_version = 600 & variant = Synergy to OneviewSDK::API600::Synergy::Interconnect'
# - 200, 300, 500, 600, 800, 1000, 1200, 1600
# Supoported Variants
# C7000, Synergy


# Resource Class used in this sample
interconnect_class = OneviewSDK.resource_named('Interconnect', @client.api_version)
Expand Down
37 changes: 37 additions & 0 deletions lib/oneview-sdk/resource/api1600/c7000/interconnect.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# (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 '../../api1200/c7000/interconnect'

module OneviewSDK
module API1600
module C7000
# Interconnect resource implementation on API1600 C7000
class Interconnect < OneviewSDK::API1200::C7000::Interconnect
include OneviewSDK::ResourceHelper::ConfigurationOperation
# 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['type'] ||= 'InterconnectV7'
super
end

def self.api_version
1600
end
end
end
end
end
36 changes: 36 additions & 0 deletions lib/oneview-sdk/resource/api1600/synergy/interconnect.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# (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 '../../api1200/synergy/interconnect'

module OneviewSDK
module API1600
module Synergy
# Interconnect resource implementation on API1600 Synergy
class Interconnect < OneviewSDK::API1200::Synergy::Interconnect
# 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['type'] ||= 'InterconnectV7'
super
end

def self.api_version
1600
end
end
end
end
end
16 changes: 16 additions & 0 deletions spec/unit/resource/api1600/c7000/interconnect_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require 'spec_helper'

RSpec.describe OneviewSDK::API1600::C7000::Interconnect do
include_context 'shared context'

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

describe '#initialize' do
it 'should be initialize the instance with default values' do
item = described_class.new(@client_1600)
expect(item['type']).to eq('InterconnectV7')
end
end
end
16 changes: 16 additions & 0 deletions spec/unit/resource/api1600/synergy/interconnect_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require 'spec_helper'

RSpec.describe OneviewSDK::API1600::Synergy::Interconnect do
include_context 'shared context'

it 'inherits from OneviewSDK::API1200::Synergy::Interconnect' do
expect(described_class).to be < OneviewSDK::API1200::Synergy::Interconnect
end

describe '#initialize' do
it 'should be initialize the instance with default values' do
item = described_class.new(@client_1600)
expect(item['type']).to eq('InterconnectV7')
end
end
end

0 comments on commit edc846b

Please sign in to comment.