Skip to content

Commit

Permalink
API1800 support for hypervisor resources
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvirani committed Jul 15, 2020
1 parent 8d93596 commit 79102af
Show file tree
Hide file tree
Showing 12 changed files with 269 additions and 0 deletions.
@@ -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 API1800
module C7000
# Hypervisor cluster profile resource implementation for API1800 C7000
class HypervisorClusterProfile < OneviewSDK::API1600::C7000::HypervisorClusterProfile
end
end
end
end
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api1800/c7000/hypervisor_manager.rb
@@ -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_manager'

module OneviewSDK
module API1800
module C7000
# Hypervisor Manager resource implementation for API1800 C7000
class HypervisorManager < OneviewSDK::API1600::C7000::HypervisorManager
end
end
end
end
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api1800/c7000/server_certificate.rb
@@ -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/server_certificate'

module OneviewSDK
module API1800
module C7000
# Server certificate resource implementation for API1800 C7000
class ServerCertificate < OneviewSDK::API1600::C7000::ServerCertificate
end
end
end
end
@@ -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 '../../api1800/c7000/hypervisor_cluster_profile'

module OneviewSDK
module API1800
module Synergy
# Hypervisor cluster profile resource implementation for API1800 Synergy
class HypervisorClusterProfile < OneviewSDK::API1800::C7000::HypervisorClusterProfile
end
end
end
end
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api1800/synergy/hypervisor_manager.rb
@@ -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/synergy/hypervisor_manager'

module OneviewSDK
module API1800
module Synergy
# Hypervisor Manager resource implementation for API1800 Synergy
class HypervisorManager < OneviewSDK::API1600::Synergy::HypervisorManager
end
end
end
end
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api1800/synergy/server_certificate.rb
@@ -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/synergy/server_certificate'

module OneviewSDK
module API1800
module Synergy
# Server certificate resource implementation for API 1800 Synergy
class ServerCertificate < OneviewSDK::API1600::Synergy::ServerCertificate
end
end
end
end
@@ -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::API1800::C7000::HypervisorClusterProfile do
include_context 'shared context'

it 'inherits from OneviewSDK::API1600::C7000::HypervisorClusterProfile' do
expect(described_class).to be < OneviewSDK::API1600::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_1800, uri: '/rest/fake')
expect(@client_1800).to receive(:rest_api).with(:delete, '/rest/fake?softDelete=false', {}, 1800)
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_1800, uri: '/rest/fake')
expect(@client_1800).to receive(:rest_api).with(:delete, '/rest/fake?softDelete=true&force=true', {}, 1800)
item.delete(true, true)
end
end
end
20 changes: 20 additions & 0 deletions spec/unit/resource/api1800/c7000/hypervisor_manager_spec.rb
@@ -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::API1800::C7000::HypervisorManager do
include_context 'shared context'

it 'inherits from OneviewSDK::API1600::C7000::HypervisorManager' do
expect(described_class).to be < OneviewSDK::API1600::C7000::HypervisorManager
end
end
20 changes: 20 additions & 0 deletions spec/unit/resource/api1800/c7000/server_certificate_spec.rb
@@ -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::API1800::C7000::ServerCertificate do
include_context 'shared context'

it 'inherits from OneviewSDK::API1600::C7000::ServerCertificate' do
expect(described_class).to be < OneviewSDK::API1600::C7000::ServerCertificate
end
end
@@ -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::API1800::Synergy::HypervisorClusterProfile do
include_context 'shared context'

# it inherit latest changes from API1800 C7000 lib file
it 'inherits from OneviewSDK::API1800::C7000::HypervisorClusterProfile' do
expect(described_class).to be < OneviewSDK::API1800::C7000::HypervisorClusterProfile
end
end
20 changes: 20 additions & 0 deletions spec/unit/resource/api1800/synergy/hypervisor_manager_spec.rb
@@ -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::API1800::Synergy::HypervisorManager do
include_context 'shared context'

it 'inherits from OneviewSDK::API1600::Synergy::HypervisorManager' do
expect(described_class).to be < OneviewSDK::API1600::Synergy::HypervisorManager
end
end
20 changes: 20 additions & 0 deletions spec/unit/resource/api1800/synergy/server_certificate_spec.rb
@@ -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::API1800::Synergy::ServerCertificate do
include_context 'shared context'

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

0 comments on commit 79102af

Please sign in to comment.