-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #469 from HewlettPackard/API2000_Interconnects
API2000 support for LI and Interconnects
- Loading branch information
Showing
11 changed files
with
226 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 '../../api1800/c7000/interconnect' | ||
|
||
module OneviewSDK | ||
module API2000 | ||
module C7000 | ||
# Interconnect resource implementation on API2000 C7000 | ||
class Interconnect < OneviewSDK::API1800::C7000::Interconnect | ||
include OneviewSDK::ResourceHelper::ConfigurationOperation | ||
def self.api_version | ||
2000 | ||
end | ||
end | ||
end | ||
end | ||
end |
33 changes: 33 additions & 0 deletions
33
lib/oneview-sdk/resource/api2000/c7000/logical_interconnect.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# (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 '../../api1800/c7000/logical_interconnect' | ||
|
||
module OneviewSDK | ||
module API2000 | ||
module C7000 | ||
# Logical interconnect resource implementation for API2000 C7000 | ||
class LogicalInterconnect < OneviewSDK::API1800::C7000::LogicalInterconnect | ||
# Validates the bulk update from group operation and gets the consolidated inconsistency report | ||
def bulk_inconsistency_validate | ||
raise IncompleteResource, 'Please retrieve the Logical Interconnect before trying to validate' unless @data['uri'] | ||
options = { | ||
'logicalInterconnectUris' => @data['logicalInterconnectUris'] | ||
} | ||
response = @client.rest_post("#{BASE_URI}/bulk-inconsistency-validation", { 'body' => options }, @api_version) | ||
body = @client.response_handler(response) | ||
set_all(body) | ||
end | ||
|
||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 '../../api1800/synergy/interconnect' | ||
|
||
module OneviewSDK | ||
module API2000 | ||
module Synergy | ||
# Interconnect resource implementation on API2000 Synergy | ||
class Interconnect < OneviewSDK::API1800::Synergy::Interconnect | ||
def self.api_version | ||
2000 | ||
end | ||
end | ||
end | ||
end | ||
end |
22 changes: 22 additions & 0 deletions
22
lib/oneview-sdk/resource/api2000/synergy/logical_interconnect.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# (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 '../../api2000/c7000/logical_interconnect' | ||
|
||
module OneviewSDK | ||
module API2000 | ||
module Synergy | ||
# Logical interconnect resource implementation for API2000 Synergy | ||
class LogicalInterconnect < OneviewSDK::API2000::C7000::LogicalInterconnect | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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::API2000::C7000::Interconnect do | ||
include_context 'shared context' | ||
|
||
it 'inherits from OneviewSDK::API1800::C7000::Interconnect' do | ||
expect(described_class).to be < OneviewSDK::API1800::C7000::Interconnect | ||
end | ||
end |
40 changes: 40 additions & 0 deletions
40
spec/unit/resource/api2000/c7000/logical_interconnect_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# (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::API2000::C7000::LogicalInterconnect do | ||
include_context 'shared context' | ||
|
||
let(:fixture_path) { 'spec/support/fixtures/unit/resource/logical_interconnect_default.json' } | ||
let(:log_int) { OneviewSDK::API2000::C7000::LogicalInterconnect.from_file(@client_2000, fixture_path) } | ||
|
||
it 'inherits from OneviewSDK::API1800::C7000::LogicalInterconnect' do | ||
expect(described_class).to be < OneviewSDK::API1800::C7000::LogicalInterconnect | ||
end | ||
|
||
describe '#bulk_inconsistency_validate' do | ||
it 'requires the uri to be set' do | ||
expect { OneviewSDK::API2000::C7000::LogicalInterconnect.new(@client_2000).bulk_inconsistency_validate } | ||
.to raise_error(OneviewSDK::IncompleteResource, /Please retrieve the Logical Interconnect before trying to validate/) | ||
end | ||
|
||
it 'gets the inconsistency report for bulk update' do | ||
item = log_int | ||
uri = item.class::BASE_URI + '/bulk-inconsistency-validation' | ||
options = { | ||
'logicalInterconnectUris' => [] | ||
} | ||
expect(@client_2000).to receive(:rest_post).with(uri, { 'body' => options }, item.api_version).and_return(FakeResponse.new) | ||
item.bulk_inconsistency_validate | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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::API2000::Synergy::Interconnect do | ||
include_context 'shared context' | ||
|
||
it 'inherits from OneviewSDK::API1800::Synergy::Interconnect' do | ||
expect(described_class).to be < OneviewSDK::API1800::Synergy::Interconnect | ||
end | ||
end |
20 changes: 20 additions & 0 deletions
20
spec/unit/resource/api2000/synergy/logical_interconnect_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# (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::API2000::Synergy::LogicalInterconnect do | ||
include_context 'shared context' | ||
|
||
it 'inherits from OneviewSDK::API2000::C7000::LogicalInterconnect' do | ||
expect(described_class).to be < OneviewSDK::API2000::C7000::LogicalInterconnect | ||
end | ||
end |