Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API1600 support for Interconnects #406

Merged
merged 6 commits into from
May 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
16 changes: 6 additions & 10 deletions examples/shared_samples/interconnect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@
# 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why parameter details were removed. Need to add them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


# for example, if api_version = 800 & variant = C7000 then, resource created will be in form
# OneviewSDK::API800::C7000::Interconnect

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

module OneviewSDK
module API1600
module Synergy
# Interconnect resource implementation on API1600 Synergy
class Interconnect < OneviewSDK::API1200::Synergy::Interconnect
def self.api_version
1600
end
end
end
end
end
19 changes: 19 additions & 0 deletions spec/unit/resource/api1600/c7000/interconnect_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# (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::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
end
19 changes: 19 additions & 0 deletions spec/unit/resource/api1600/synergy/interconnect_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# (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::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
end