-
Notifications
You must be signed in to change notification settings - Fork 16
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
Added API1600 support for HCP #421
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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/c7000/hypervisor_cluster_profile' | ||
|
||
module OneviewSDK | ||
module API1600 | ||
module C7000 | ||
# Hypervisor cluster profile resource implementation for API1600 C7000 | ||
class HypervisorClusterProfile < OneviewSDK::API1200::C7000::HypervisorClusterProfile | ||
|
||
# softDelete is mandatory argument in API1600 | ||
def delete(soft_delete = false, force = false) | ||
ensure_client && ensure_uri | ||
uri = @data['uri'] | ||
uri += if force == true | ||
"?softDelete=#{soft_delete}" + "&force=#{force}" | ||
else | ||
"?softDelete=#{soft_delete}" | ||
end | ||
response = @client.rest_delete(uri, DEFAULT_REQUEST_HEADER, @api_version) | ||
@client.response_handler(response) | ||
true | ||
end | ||
end | ||
end | ||
end | ||
end |
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 '../../api1600/c7000/hypervisor_cluster_profile' | ||
|
||
module OneviewSDK | ||
module API1600 | ||
module Synergy | ||
# Hypervisor cluster profile resource implementation for API1600 Synergy | ||
class HypervisorClusterProfile < OneviewSDK::API1600::C7000::HypervisorClusterProfile | ||
end | ||
end | ||
end | ||
end |
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::API1000::C7000::HypervisorClusterProfile do | ||
include_context 'shared context' | ||
|
||
it 'inherits from OneviewSDK::API800::C7000::HypervisorClusterProfile' do | ||
expect(described_class).to be < OneviewSDK::API800::C7000::HypervisorClusterProfile | ||
end | ||
end |
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::API1000::Synergy::HypervisorClusterProfile do | ||
include_context 'shared context' | ||
|
||
it 'inherits from OneviewSDK::API800::Synergy::HypervisorClusterProfile' do | ||
expect(described_class).to be < OneviewSDK::API800::Synergy::HypervisorClusterProfile | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it should inherit API1000::C7000 class. If so, please update description also accordingly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The respective lib file for API1000::Synergy file inherits from API800::Synergy file, so mentioned the same in spec file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay |
||
end | ||
end |
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::API1200::C7000::HypervisorClusterProfile do | ||
include_context 'shared context' | ||
|
||
it 'inherits from OneviewSDK::API1000::C7000::HypervisorClusterProfile' do | ||
expect(described_class).to be < OneviewSDK::API1000::C7000::HypervisorClusterProfile | ||
end | ||
end |
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::API1200::Synergy::HypervisorClusterProfile do | ||
include_context 'shared context' | ||
|
||
it 'inherits from OneviewSDK::API1000::Synergy::HypervisorClusterProfile' do | ||
expect(described_class).to be < OneviewSDK::API1000::Synergy::HypervisorClusterProfile | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it should inherit API1200::C7000 class. If so, please update description also accordingly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The respective lib file for API1200::Synergy file inherits from API1000::Synergy file, so mentioned the same in spec file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay |
||
end | ||
end |
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 'spec_helper' | ||
|
||
RSpec.describe OneviewSDK::API1600::C7000::HypervisorClusterProfile do | ||
include_context 'shared context' | ||
|
||
it 'inherits from OneviewSDK::API1200::C7000::HypervisorClusterProfile' do | ||
expect(described_class).to be < OneviewSDK::API1200::C7000::HypervisorClusterProfile | ||
end | ||
|
||
describe '#delete' do | ||
it 'passes no extra arguments' do | ||
allow_any_instance_of(OneviewSDK::Client).to receive(:response_handler).and_return(true) | ||
item = described_class.new(@client_1600, uri: '/rest/fake') | ||
expect(@client_1600).to receive(:rest_api).with(:delete, '/rest/fake?softDelete=false', {}, 1600) | ||
item.delete | ||
end | ||
|
||
it 'passes extra arguments' do | ||
allow_any_instance_of(OneviewSDK::Client).to receive(:response_handler).and_return(true) | ||
item = described_class.new(@client_1600, uri: '/rest/fake') | ||
expect(@client_1600).to receive(:rest_api).with(:delete, '/rest/fake?softDelete=true&force=true', {}, 1600) | ||
item.delete(true, true) | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# (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::HypervisorClusterProfile do | ||
include_context 'shared context' | ||
|
||
# it inherit latest changes from API1600 C7000 lib file | ||
it 'inherits from OneviewSDK::API1600::C7000::HypervisorClusterProfile' do | ||
expect(described_class).to be < OneviewSDK::API1600::C7000::HypervisorClusterProfile | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try if hcp.delete(soft_delete = true, force = true) is working or not. If it is, change it accordingly.