-
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 #411 from HewlettPackard/API1600ImageStreamer_Depl…
…oymentPlan API1600 support for Image Streamer Deployment plan
- Loading branch information
Showing
18 changed files
with
244 additions
and
13 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,39 @@ | ||
# (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 '../../resource' | ||
|
||
module OneviewSDK | ||
# Module Image Streamer | ||
module ImageStreamer | ||
# Module API 1600 | ||
module API1600 | ||
# Get resource class that matches the type given | ||
# @param [String] type Name of the desired class type | ||
# @param [String] variant There is only 1 variant for this module, so this is not used. | ||
# It exists only so that the parameters match API modules that do have multiple variants. | ||
# @return [Class] Resource class or nil if not found | ||
def self.resource_named(type, _variant = nil) | ||
new_type = type.to_s.downcase.gsub(/[ -_]/, '') | ||
constants.each do |c| | ||
klass = const_get(c) | ||
next unless klass.is_a?(Class) && klass < OneviewSDK::Resource | ||
name = klass.name.split('::').last.downcase.delete('_').delete('-') | ||
return klass if new_type =~ /^#{name}[s]?$/ | ||
end | ||
nil | ||
end | ||
end | ||
end | ||
end | ||
|
||
# Load all API-specific resources: | ||
Dir[File.dirname(__FILE__) + '/api1600/*.rb'].each { |file| require file } |
22 changes: 22 additions & 0 deletions
22
lib/oneview-sdk/image-streamer/resource/api1600/build_plan.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 '../api1020/build_plan' | ||
|
||
module OneviewSDK | ||
module ImageStreamer | ||
module API1600 | ||
# Build Plan resource implementation for Image Streamer | ||
class BuildPlan < OneviewSDK::ImageStreamer::API1020::BuildPlan | ||
end | ||
end | ||
end | ||
end |
22 changes: 22 additions & 0 deletions
22
lib/oneview-sdk/image-streamer/resource/api1600/deployment_plan.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 '../api1020/deployment_plan' | ||
|
||
module OneviewSDK | ||
module ImageStreamer | ||
module API1600 | ||
# Deployment Plan resource implementation for Image Streamer | ||
class DeploymentPlan < OneviewSDK::ImageStreamer::API1020::DeploymentPlan | ||
end | ||
end | ||
end | ||
end |
22 changes: 22 additions & 0 deletions
22
lib/oneview-sdk/image-streamer/resource/api1600/golden_image.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 '../api1020/golden_image' | ||
|
||
module OneviewSDK | ||
module ImageStreamer | ||
module API1600 | ||
# Golden Image resource implementation for Image Streamer | ||
class GoldenImage < OneviewSDK::ImageStreamer::API1020::GoldenImage | ||
end | ||
end | ||
end | ||
end |
22 changes: 22 additions & 0 deletions
22
lib/oneview-sdk/image-streamer/resource/api1600/os_volume.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 '../api1020/os_volume' | ||
|
||
module OneviewSDK | ||
module ImageStreamer | ||
module API1600 | ||
# OS Volume resource implementation for Image Streamer | ||
class OSVolume < OneviewSDK::ImageStreamer::API1020::OSVolume | ||
end | ||
end | ||
end | ||
end |
22 changes: 22 additions & 0 deletions
22
lib/oneview-sdk/image-streamer/resource/api1600/plan_script.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 '../api1020/plan_script' | ||
|
||
module OneviewSDK | ||
module ImageStreamer | ||
module API1600 | ||
# Plan Script resource implementation for Image Streamer | ||
class PlanScript < OneviewSDK::ImageStreamer::API1020::PlanScript | ||
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
22 changes: 22 additions & 0 deletions
22
lib/oneview-sdk/resource/api1600/synergy/os_deployment_plan.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 '../../api300/synergy/os_deployment_plan' | ||
|
||
module OneviewSDK | ||
module API1600 | ||
module Synergy | ||
# Network set resource implementation for API1600 Synergy | ||
class OSDeploymentPlan < OneviewSDK::API300::Synergy::OSDeploymentPlan | ||
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
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,9 @@ | ||
require 'spec_helper' | ||
|
||
klass = OneviewSDK::ImageStreamer::API1600::BuildPlan | ||
RSpec.describe klass do | ||
include_context 'shared context' | ||
it 'inherits from API1020' do | ||
expect(described_class).to be < OneviewSDK::ImageStreamer::API1020::BuildPlan | ||
end | ||
end |
10 changes: 10 additions & 0 deletions
10
spec/unit/image-streamer/resource/api1600/deployment_plan_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,10 @@ | ||
require 'spec_helper' | ||
|
||
klass = OneviewSDK::ImageStreamer::API1600::DeploymentPlan | ||
RSpec.describe klass do | ||
include_context 'shared context' | ||
|
||
it 'inherits from API1020' do | ||
expect(described_class).to be < OneviewSDK::ImageStreamer::API1020::DeploymentPlan | ||
end | ||
end |
10 changes: 10 additions & 0 deletions
10
spec/unit/image-streamer/resource/api1600/golden_image_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,10 @@ | ||
require 'spec_helper' | ||
|
||
klass = OneviewSDK::ImageStreamer::API1600::GoldenImage | ||
RSpec.describe klass do | ||
include_context 'shared context' | ||
|
||
it 'inherits from API1020' do | ||
expect(described_class).to be < OneviewSDK::ImageStreamer::API1020::GoldenImage | ||
end | ||
end |
10 changes: 10 additions & 0 deletions
10
spec/unit/image-streamer/resource/api1600/os_volume_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,10 @@ | ||
require 'spec_helper' | ||
|
||
klass = OneviewSDK::ImageStreamer::API1600::OSVolume | ||
RSpec.describe klass do | ||
include_context 'shared context' | ||
|
||
it 'inherits from API1020' do | ||
expect(described_class).to be < OneviewSDK::ImageStreamer::API1020::OSVolume | ||
end | ||
end |
10 changes: 10 additions & 0 deletions
10
spec/unit/image-streamer/resource/api1600/plan_script_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,10 @@ | ||
require 'spec_helper' | ||
|
||
klass = OneviewSDK::ImageStreamer::API1600::PlanScript | ||
RSpec.describe klass do | ||
include_context 'shared context' | ||
|
||
it 'inherits from AP1020' do | ||
expect(described_class).to be < OneviewSDK::ImageStreamer::API1020::PlanScript | ||
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,9 @@ | ||
require 'spec_helper' | ||
|
||
RSpec.describe OneviewSDK::ImageStreamer::API1600 do | ||
describe '#resource_named' do | ||
it 'gets the correct resource class' do | ||
expect(described_class.resource_named('PlanScript')).to eq(described_class::PlanScript) | ||
end | ||
end | ||
end |