From e434fa0ce93f6b512086e4e520f2168a23b48ee2 Mon Sep 17 00:00:00 2001 From: Chebrolu Date: Wed, 4 Nov 2020 20:06:32 +0530 Subject: [PATCH 1/9] Config changes for I3S resources --- examples/shared_samples/volume_attachment.rb | 9 +---- .../image-streamer/resource/api2000.rb | 39 +++++++++++++++++++ .../resource/api2000/artifact_bundle.rb | 22 +++++++++++ .../resource/api2000/build_plan.rb | 22 +++++++++++ .../resource/api2000/deployment_group.rb | 22 +++++++++++ .../resource/api2000/deployment_plan.rb | 22 +++++++++++ .../resource/api2000/golden_image.rb | 22 +++++++++++ .../resource/api2000/os_volume.rb | 22 +++++++++++ .../resource/api2000/plan_script.rb | 22 +++++++++++ spec/unit/image-streamer/client_spec.rb | 4 +- .../resource/api2000/artifact_bundle_spec.rb | 10 +++++ .../resource/api2000/build_plan_spec.rb | 9 +++++ .../resource/api2000/deployment_group_spec.rb | 10 +++++ .../resource/api2000/deployment_plan_spec.rb | 10 +++++ .../resource/api2000/golden_image_spec.rb | 10 +++++ .../resource/api2000/os_volume_spec.rb | 10 +++++ .../resource/api2000/plan_script_spec.rb | 10 +++++ .../image-streamer/resource/api2000_spec.rb | 9 +++++ 18 files changed, 274 insertions(+), 10 deletions(-) create mode 100644 lib/oneview-sdk/image-streamer/resource/api2000.rb create mode 100644 lib/oneview-sdk/image-streamer/resource/api2000/artifact_bundle.rb create mode 100644 lib/oneview-sdk/image-streamer/resource/api2000/build_plan.rb create mode 100644 lib/oneview-sdk/image-streamer/resource/api2000/deployment_group.rb create mode 100644 lib/oneview-sdk/image-streamer/resource/api2000/deployment_plan.rb create mode 100644 lib/oneview-sdk/image-streamer/resource/api2000/golden_image.rb create mode 100644 lib/oneview-sdk/image-streamer/resource/api2000/os_volume.rb create mode 100644 lib/oneview-sdk/image-streamer/resource/api2000/plan_script.rb create mode 100644 spec/unit/image-streamer/resource/api2000/artifact_bundle_spec.rb create mode 100644 spec/unit/image-streamer/resource/api2000/build_plan_spec.rb create mode 100644 spec/unit/image-streamer/resource/api2000/deployment_group_spec.rb create mode 100644 spec/unit/image-streamer/resource/api2000/deployment_plan_spec.rb create mode 100644 spec/unit/image-streamer/resource/api2000/golden_image_spec.rb create mode 100644 spec/unit/image-streamer/resource/api2000/os_volume_spec.rb create mode 100644 spec/unit/image-streamer/resource/api2000/plan_script_spec.rb create mode 100644 spec/unit/image-streamer/resource/api2000_spec.rb diff --git a/examples/shared_samples/volume_attachment.rb b/examples/shared_samples/volume_attachment.rb index f01cf6b7d..dd4c5e9f4 100644 --- a/examples/shared_samples/volume_attachment.rb +++ b/examples/shared_samples/volume_attachment.rb @@ -11,12 +11,6 @@ require_relative '../_client' # Gives access to @client -# All supported APIs for Volume Attachment: -# - 200, 300, 500, 600, 800, 1000, 1200, 1600, 1800 and 2000 - -# Supported Variants: -# C7000 and Synergy for all API versions - volume_attachment_class = OneviewSDK.resource_named('VolumeAttachment', @client.api_version) # List volume attachments @@ -42,5 +36,4 @@ volume_paths.each do |path| puts "- #{path['initiatorName']}" end -end -puts +end \ No newline at end of file diff --git a/lib/oneview-sdk/image-streamer/resource/api2000.rb b/lib/oneview-sdk/image-streamer/resource/api2000.rb new file mode 100644 index 000000000..db5c7a6fd --- /dev/null +++ b/lib/oneview-sdk/image-streamer/resource/api2000.rb @@ -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 2000 + module API2000 + # 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__) + '/api2000/*.rb'].each { |file| require file } diff --git a/lib/oneview-sdk/image-streamer/resource/api2000/artifact_bundle.rb b/lib/oneview-sdk/image-streamer/resource/api2000/artifact_bundle.rb new file mode 100644 index 000000000..c6afd21b3 --- /dev/null +++ b/lib/oneview-sdk/image-streamer/resource/api2000/artifact_bundle.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/artifact_bundle' + +module OneviewSDK + module ImageStreamer + module API2000 + # Artifact Bundle resource implementation for Image Streamer + class ArtifactBundle < OneviewSDK::ImageStreamer::API1600::ArtifactBundle + end + end + end +end diff --git a/lib/oneview-sdk/image-streamer/resource/api2000/build_plan.rb b/lib/oneview-sdk/image-streamer/resource/api2000/build_plan.rb new file mode 100644 index 000000000..d06b4e1f6 --- /dev/null +++ b/lib/oneview-sdk/image-streamer/resource/api2000/build_plan.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/build_plan' + +module OneviewSDK + module ImageStreamer + module API2000 + # Build Plan resource implementation for Image Streamer + class BuildPlan < OneviewSDK::ImageStreamer::API1600::BuildPlan + end + end + end +end diff --git a/lib/oneview-sdk/image-streamer/resource/api2000/deployment_group.rb b/lib/oneview-sdk/image-streamer/resource/api2000/deployment_group.rb new file mode 100644 index 000000000..cbf3a386c --- /dev/null +++ b/lib/oneview-sdk/image-streamer/resource/api2000/deployment_group.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/deployment_group' + +module OneviewSDK + module ImageStreamer + module API2000 + # Deployment Group resource implementation for Image Streamer + class DeploymentGroup < OneviewSDK::ImageStreamer::API1600::DeploymentGroup + end + end + end +end diff --git a/lib/oneview-sdk/image-streamer/resource/api2000/deployment_plan.rb b/lib/oneview-sdk/image-streamer/resource/api2000/deployment_plan.rb new file mode 100644 index 000000000..03841a916 --- /dev/null +++ b/lib/oneview-sdk/image-streamer/resource/api2000/deployment_plan.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/deployment_plan' + +module OneviewSDK + module ImageStreamer + module API2000 + # Deployment Plan resource implementation for Image Streamer + class DeploymentPlan < OneviewSDK::ImageStreamer::API1600::DeploymentPlan + end + end + end +end diff --git a/lib/oneview-sdk/image-streamer/resource/api2000/golden_image.rb b/lib/oneview-sdk/image-streamer/resource/api2000/golden_image.rb new file mode 100644 index 000000000..cbbdf02e1 --- /dev/null +++ b/lib/oneview-sdk/image-streamer/resource/api2000/golden_image.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/golden_image' + +module OneviewSDK + module ImageStreamer + module API2000 + # Golden Image resource implementation for Image Streamer + class GoldenImage < OneviewSDK::ImageStreamer::API1600::GoldenImage + end + end + end +end diff --git a/lib/oneview-sdk/image-streamer/resource/api2000/os_volume.rb b/lib/oneview-sdk/image-streamer/resource/api2000/os_volume.rb new file mode 100644 index 000000000..68b033492 --- /dev/null +++ b/lib/oneview-sdk/image-streamer/resource/api2000/os_volume.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/os_volume' + +module OneviewSDK + module ImageStreamer + module API2000 + # OS Volume resource implementation for Image Streamer + class OSVolume < OneviewSDK::ImageStreamer::API1600::OSVolume + end + end + end +end diff --git a/lib/oneview-sdk/image-streamer/resource/api2000/plan_script.rb b/lib/oneview-sdk/image-streamer/resource/api2000/plan_script.rb new file mode 100644 index 000000000..0b95d9852 --- /dev/null +++ b/lib/oneview-sdk/image-streamer/resource/api2000/plan_script.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/plan_script' + +module OneviewSDK + module ImageStreamer + module API2000 + # Plan Script resource implementation for Image Streamer + class PlanScript < OneviewSDK::ImageStreamer::API1600::PlanScript + end + end + end +end diff --git a/spec/unit/image-streamer/client_spec.rb b/spec/unit/image-streamer/client_spec.rb index 47351fa1a..f3c94e9bb 100644 --- a/spec/unit/image-streamer/client_spec.rb +++ b/spec/unit/image-streamer/client_spec.rb @@ -51,11 +51,11 @@ end it 'warns if the api level is greater than the appliance api version' do - options = { url: 'https://oneview.example.com', token: 'token123', api_version: 1800 } + options = { url: 'https://oneview.example.com', token: 'token123', api_version: 2200 } client = nil expect { client = OneviewSDK::ImageStreamer::Client.new(options) } .to output(/is greater than the Image Streamer API version/).to_stdout_from_any_process - expect(client.api_version).to eq(1800) + expect(client.api_version).to eq(2200) end it 'sets @print_wait_dots to false by default' do diff --git a/spec/unit/image-streamer/resource/api2000/artifact_bundle_spec.rb b/spec/unit/image-streamer/resource/api2000/artifact_bundle_spec.rb new file mode 100644 index 000000000..7e3caa6b8 --- /dev/null +++ b/spec/unit/image-streamer/resource/api2000/artifact_bundle_spec.rb @@ -0,0 +1,10 @@ +require 'spec_helper' + +klass = OneviewSDK::ImageStreamer::API1600::ArtifactBundle +RSpec.describe klass do + include_context 'shared context' + + it 'inherits from API1600' do + expect(described_class).to be < OneviewSDK::ImageStreamer::API1600::ArtifactBundle + end +end diff --git a/spec/unit/image-streamer/resource/api2000/build_plan_spec.rb b/spec/unit/image-streamer/resource/api2000/build_plan_spec.rb new file mode 100644 index 000000000..df181d7cb --- /dev/null +++ b/spec/unit/image-streamer/resource/api2000/build_plan_spec.rb @@ -0,0 +1,9 @@ +require 'spec_helper' + +klass = OneviewSDK::ImageStreamer::API1600::BuildPlan +RSpec.describe klass do + include_context 'shared context' + it 'inherits from API1600' do + expect(described_class).to be < OneviewSDK::ImageStreamer::API1600::BuildPlan + end +end diff --git a/spec/unit/image-streamer/resource/api2000/deployment_group_spec.rb b/spec/unit/image-streamer/resource/api2000/deployment_group_spec.rb new file mode 100644 index 000000000..d2af2d9f3 --- /dev/null +++ b/spec/unit/image-streamer/resource/api2000/deployment_group_spec.rb @@ -0,0 +1,10 @@ +require 'spec_helper' + +klass = OneviewSDK::ImageStreamer::API1600::DeploymentGroup +RSpec.describe klass do + include_context 'shared context' + + it 'inherits from API1600' do + expect(described_class).to be < OneviewSDK::ImageStreamer::API1600::DeploymentGroup + end +end diff --git a/spec/unit/image-streamer/resource/api2000/deployment_plan_spec.rb b/spec/unit/image-streamer/resource/api2000/deployment_plan_spec.rb new file mode 100644 index 000000000..88e4f985e --- /dev/null +++ b/spec/unit/image-streamer/resource/api2000/deployment_plan_spec.rb @@ -0,0 +1,10 @@ +require 'spec_helper' + +klass = OneviewSDK::ImageStreamer::API1600::DeploymentPlan +RSpec.describe klass do + include_context 'shared context' + + it 'inherits from API1600' do + expect(described_class).to be < OneviewSDK::ImageStreamer::API1600::DeploymentPlan + end +end diff --git a/spec/unit/image-streamer/resource/api2000/golden_image_spec.rb b/spec/unit/image-streamer/resource/api2000/golden_image_spec.rb new file mode 100644 index 000000000..77a663cf8 --- /dev/null +++ b/spec/unit/image-streamer/resource/api2000/golden_image_spec.rb @@ -0,0 +1,10 @@ +require 'spec_helper' + +klass = OneviewSDK::ImageStreamer::API1600::GoldenImage +RSpec.describe klass do + include_context 'shared context' + + it 'inherits from API1600' do + expect(described_class).to be < OneviewSDK::ImageStreamer::API1600::GoldenImage + end +end diff --git a/spec/unit/image-streamer/resource/api2000/os_volume_spec.rb b/spec/unit/image-streamer/resource/api2000/os_volume_spec.rb new file mode 100644 index 000000000..4a0ff3828 --- /dev/null +++ b/spec/unit/image-streamer/resource/api2000/os_volume_spec.rb @@ -0,0 +1,10 @@ +require 'spec_helper' + +klass = OneviewSDK::ImageStreamer::API1600::OSVolume +RSpec.describe klass do + include_context 'shared context' + + it 'inherits from API1600' do + expect(described_class).to be < OneviewSDK::ImageStreamer::API1600::OSVolume + end +end diff --git a/spec/unit/image-streamer/resource/api2000/plan_script_spec.rb b/spec/unit/image-streamer/resource/api2000/plan_script_spec.rb new file mode 100644 index 000000000..aa4dd4fed --- /dev/null +++ b/spec/unit/image-streamer/resource/api2000/plan_script_spec.rb @@ -0,0 +1,10 @@ +require 'spec_helper' + +klass = OneviewSDK::ImageStreamer::API1600::PlanScript +RSpec.describe klass do + include_context 'shared context' + + it 'inherits from AP1600' do + expect(described_class).to be < OneviewSDK::ImageStreamer::API1600::PlanScript + end +end diff --git a/spec/unit/image-streamer/resource/api2000_spec.rb b/spec/unit/image-streamer/resource/api2000_spec.rb new file mode 100644 index 000000000..70699d381 --- /dev/null +++ b/spec/unit/image-streamer/resource/api2000_spec.rb @@ -0,0 +1,9 @@ +require 'spec_helper' + +RSpec.describe OneviewSDK::ImageStreamer::API2000 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 From b8889b90de8558abd848b2b9092d610f0905760b Mon Sep 17 00:00:00 2001 From: Chebrolu Date: Wed, 4 Nov 2020 20:29:21 +0530 Subject: [PATCH 2/9] Added spec file changes --- lib/oneview-sdk/image_streamer.rb | 2 +- spec/spec_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/oneview-sdk/image_streamer.rb b/lib/oneview-sdk/image_streamer.rb index 6ac7fc175..8e5cbdf85 100644 --- a/lib/oneview-sdk/image_streamer.rb +++ b/lib/oneview-sdk/image_streamer.rb @@ -19,7 +19,7 @@ module OneviewSDK # Module for interacting with the Image Streamer module ImageStreamer - SUPPORTED_API_VERSIONS = [300, 500, 600, 800, 1000, 1020, 1600].freeze + SUPPORTED_API_VERSIONS = [300, 500, 600, 800, 1000, 1020, 1600, 2000].freeze DEFAULT_API_VERSION = 300 @api_version = DEFAULT_API_VERSION @api_version_updated = false # Whether or not the API version has been set by the user diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 084ff1370..ca79c2b2e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -117,7 +117,7 @@ # Mock appliance version and login api requests, as well as loading trusted certs allow_any_instance_of(OneviewSDK::Client).to receive(:appliance_api_version).and_return(2200) allow_any_instance_of(OneviewSDK::Client).to receive(:login).and_return('secretToken') - allow_any_instance_of(OneviewSDK::ImageStreamer::Client).to receive(:appliance_i3s_api_version).and_return(1600) + allow_any_instance_of(OneviewSDK::ImageStreamer::Client).to receive(:appliance_i3s_api_version).and_return(2000) allow(OneviewSDK::SSLHelper).to receive(:load_trusted_certs).and_return(nil) end From 199422c78e87dacb6eaaaa3bffac962da4e4c38b Mon Sep 17 00:00:00 2001 From: Chebrolu Date: Thu, 5 Nov 2020 09:34:01 +0530 Subject: [PATCH 3/9] fix robocop errors --- examples/shared_samples/volume_attachment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/shared_samples/volume_attachment.rb b/examples/shared_samples/volume_attachment.rb index dd4c5e9f4..37ab3b8cc 100644 --- a/examples/shared_samples/volume_attachment.rb +++ b/examples/shared_samples/volume_attachment.rb @@ -36,4 +36,4 @@ volume_paths.each do |path| puts "- #{path['initiatorName']}" end -end \ No newline at end of file +end From eeed8b83a6613cb823d5c5ad23a1eda7a3094729 Mon Sep 17 00:00:00 2001 From: Chebrolu Date: Thu, 5 Nov 2020 09:48:21 +0530 Subject: [PATCH 4/9] fix UTs --- .../image-streamer/resource/api2000/artifact_bundle_spec.rb | 2 +- spec/unit/image-streamer/resource/api2000/build_plan_spec.rb | 2 +- .../image-streamer/resource/api2000/deployment_group_spec.rb | 2 +- .../image-streamer/resource/api2000/deployment_plan_spec.rb | 2 +- spec/unit/image-streamer/resource/api2000/golden_image_spec.rb | 2 +- spec/unit/image-streamer/resource/api2000/os_volume_spec.rb | 2 +- spec/unit/image-streamer/resource/api2000/plan_script_spec.rb | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/unit/image-streamer/resource/api2000/artifact_bundle_spec.rb b/spec/unit/image-streamer/resource/api2000/artifact_bundle_spec.rb index 7e3caa6b8..d57bd9678 100644 --- a/spec/unit/image-streamer/resource/api2000/artifact_bundle_spec.rb +++ b/spec/unit/image-streamer/resource/api2000/artifact_bundle_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -klass = OneviewSDK::ImageStreamer::API1600::ArtifactBundle +klass = OneviewSDK::ImageStreamer::API2000::ArtifactBundle RSpec.describe klass do include_context 'shared context' diff --git a/spec/unit/image-streamer/resource/api2000/build_plan_spec.rb b/spec/unit/image-streamer/resource/api2000/build_plan_spec.rb index df181d7cb..316a563d9 100644 --- a/spec/unit/image-streamer/resource/api2000/build_plan_spec.rb +++ b/spec/unit/image-streamer/resource/api2000/build_plan_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -klass = OneviewSDK::ImageStreamer::API1600::BuildPlan +klass = OneviewSDK::ImageStreamer::API2000::BuildPlan RSpec.describe klass do include_context 'shared context' it 'inherits from API1600' do diff --git a/spec/unit/image-streamer/resource/api2000/deployment_group_spec.rb b/spec/unit/image-streamer/resource/api2000/deployment_group_spec.rb index d2af2d9f3..9230fac3d 100644 --- a/spec/unit/image-streamer/resource/api2000/deployment_group_spec.rb +++ b/spec/unit/image-streamer/resource/api2000/deployment_group_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -klass = OneviewSDK::ImageStreamer::API1600::DeploymentGroup +klass = OneviewSDK::ImageStreamer::API2000::DeploymentGroup RSpec.describe klass do include_context 'shared context' diff --git a/spec/unit/image-streamer/resource/api2000/deployment_plan_spec.rb b/spec/unit/image-streamer/resource/api2000/deployment_plan_spec.rb index 88e4f985e..08321e929 100644 --- a/spec/unit/image-streamer/resource/api2000/deployment_plan_spec.rb +++ b/spec/unit/image-streamer/resource/api2000/deployment_plan_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -klass = OneviewSDK::ImageStreamer::API1600::DeploymentPlan +klass = OneviewSDK::ImageStreamer::AP2000::DeploymentPlan RSpec.describe klass do include_context 'shared context' diff --git a/spec/unit/image-streamer/resource/api2000/golden_image_spec.rb b/spec/unit/image-streamer/resource/api2000/golden_image_spec.rb index 77a663cf8..2682c3d2f 100644 --- a/spec/unit/image-streamer/resource/api2000/golden_image_spec.rb +++ b/spec/unit/image-streamer/resource/api2000/golden_image_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -klass = OneviewSDK::ImageStreamer::API1600::GoldenImage +klass = OneviewSDK::ImageStreamer::API2000::GoldenImage RSpec.describe klass do include_context 'shared context' diff --git a/spec/unit/image-streamer/resource/api2000/os_volume_spec.rb b/spec/unit/image-streamer/resource/api2000/os_volume_spec.rb index 4a0ff3828..d661ed0d8 100644 --- a/spec/unit/image-streamer/resource/api2000/os_volume_spec.rb +++ b/spec/unit/image-streamer/resource/api2000/os_volume_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -klass = OneviewSDK::ImageStreamer::API1600::OSVolume +klass = OneviewSDK::ImageStreamer::API2000::OSVolume RSpec.describe klass do include_context 'shared context' diff --git a/spec/unit/image-streamer/resource/api2000/plan_script_spec.rb b/spec/unit/image-streamer/resource/api2000/plan_script_spec.rb index aa4dd4fed..30b3c62cc 100644 --- a/spec/unit/image-streamer/resource/api2000/plan_script_spec.rb +++ b/spec/unit/image-streamer/resource/api2000/plan_script_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -klass = OneviewSDK::ImageStreamer::API1600::PlanScript +klass = OneviewSDK::ImageStreamer::API2000::PlanScript RSpec.describe klass do include_context 'shared context' From 53732f7af2866bc78b54b9ae27060581d1a382cb Mon Sep 17 00:00:00 2001 From: Chebrolu Date: Thu, 5 Nov 2020 10:30:03 +0530 Subject: [PATCH 5/9] fix UTs --- spec/unit/client_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb index 5a1bc3f05..bf28a792f 100644 --- a/spec/unit/client_spec.rb +++ b/spec/unit/client_spec.rb @@ -372,7 +372,7 @@ options = { url: 'https://oneview.example.com', token: 'token123' } client = OneviewSDK::Client.new(options) expect(client.token).to eq('token123') - expect(client.api_version).to eq(2200) + expect(client.api_version).to eq(2000) i3s_options = { url: 'https://imagestreamer.example.com', api_version: 300 } i3s_client = client.new_i3s_client(i3s_options) From 14a5d8ee4007a6104731193ec2509e093dc7d9f8 Mon Sep 17 00:00:00 2001 From: Chebrolu Date: Thu, 5 Nov 2020 11:59:06 +0530 Subject: [PATCH 6/9] fix UTs --- .../image-streamer/resource/api2000/deployment_plan_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/unit/image-streamer/resource/api2000/deployment_plan_spec.rb b/spec/unit/image-streamer/resource/api2000/deployment_plan_spec.rb index 08321e929..128dff6c7 100644 --- a/spec/unit/image-streamer/resource/api2000/deployment_plan_spec.rb +++ b/spec/unit/image-streamer/resource/api2000/deployment_plan_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -klass = OneviewSDK::ImageStreamer::AP2000::DeploymentPlan +klass = OneviewSDK::ImageStreamer::API2000::DeploymentPlan RSpec.describe klass do include_context 'shared context' From e28a6d4f303413ae4595ba600ce151f43ae22a37 Mon Sep 17 00:00:00 2001 From: Chebrolu Date: Thu, 5 Nov 2020 12:09:02 +0530 Subject: [PATCH 7/9] fix UTs --- spec/unit/client_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb index bf28a792f..5a1bc3f05 100644 --- a/spec/unit/client_spec.rb +++ b/spec/unit/client_spec.rb @@ -372,7 +372,7 @@ options = { url: 'https://oneview.example.com', token: 'token123' } client = OneviewSDK::Client.new(options) expect(client.token).to eq('token123') - expect(client.api_version).to eq(2000) + expect(client.api_version).to eq(2200) i3s_options = { url: 'https://imagestreamer.example.com', api_version: 300 } i3s_client = client.new_i3s_client(i3s_options) From ac6bdfeae5d0796df705dc045c73bf5989c055e0 Mon Sep 17 00:00:00 2001 From: VenkateshRavula Date: Thu, 5 Nov 2020 22:42:22 +0530 Subject: [PATCH 8/9] modified i3s examples for api 2000 --- examples/image-streamer/artifact_bundle.rb | 37 ++++++++++----------- examples/image-streamer/build_plan.rb | 24 +++++++------ examples/image-streamer/deployment_group.rb | 7 ++-- examples/image-streamer/deployment_plan.rb | 13 +++----- examples/image-streamer/golden_image.rb | 7 ++-- examples/image-streamer/os_volume.rb | 7 ++-- examples/image-streamer/plan_script.rb | 21 +++++------- 7 files changed, 51 insertions(+), 65 deletions(-) diff --git a/examples/image-streamer/artifact_bundle.rb b/examples/image-streamer/artifact_bundle.rb index 3e3d9fe0c..19e1098c9 100644 --- a/examples/image-streamer/artifact_bundle.rb +++ b/examples/image-streamer/artifact_bundle.rb @@ -13,16 +13,13 @@ require_relative '../_client_i3s' # Gives access to @client # Supported APIs: -# - 300, 500, 600, 800, 1000, 1020, 1600 +# - 1000, 1020, 1600, 2000 # Resources that can be created according to parameters: -# api_version = 300 & variant = Synergy to OneviewSDK::ImageStreamer::API300::ArtifactBundle -# api_version = 500 & variant = Synergy to OneviewSDK::ImageStreamer::API500::ArtifactBundle -# api_version = 600 & variant = Synergy to OneviewSDK::ImageStreamer::API600::ArtifactBundle -# api_version = 800 & variant = Synergy to OneviewSDK::ImageStreamer::API800::ArtifactBundle # api_version = 1000 & variant = Synergy to OneviewSDK::ImageStreamer::API1000::ArtifactBundle # api_version = 1020 & variant = Synergy to OneviewSDK::ImageStreamer::API1020::ArtifactBundle # api_version = 1600 & variant = Synergy to OneviewSDK::ImageStreamer::API1600::ArtifactBundle +# api_version = 2000 & variant = Synergy to OneviewSDK::ImageStreamer::API2000::ArtifactBundle # Example: # - Create, update, download, upload, extract and delete an artifact bundle for an Image Streamer @@ -68,26 +65,26 @@ puts "\nExtracting artifact bundle uploaded" puts 'Artifact Bundle extracted successfully.' if item_uploaded.extract -puts "\nCreating a backup associated to deployment group with name='#{deployment_group['name']}' and uri='#{deployment_group['uri']}'" -puts artifact_bundle_class.create_backup(@client, deployment_group) +#puts "\nCreating a backup associated to deployment group with name='#{deployment_group['name']}' and uri='#{deployment_group['uri']}'" +#puts artifact_bundle_class.create_backup(@client, deployment_group) puts "\nListing backups" backups = artifact_bundle_class.get_backups(@client) backups.each { |bkp| puts bkp['name'] } -backup_download_file = Tempfile.new(['backup-bundle', '.zip']) -backup_download_path = backup_download_file.path -puts "\nDownloading backup bundle file and saving at #{backup_download_path}" -artifact_bundle_class.download_backup(@client, backup_download_path, backups.first) -puts 'Downloaded successfully.' if File.exist?(backup_download_path) - -puts "\nUploading backup bundle" -puts artifact_bundle_class.create_backup_from_file!(@client, deployment_group, backup_download_path, 'Backup Bundle') - -puts "\nExtracting backup bundle uploaded" -backup = artifact_bundle_class.get_backups(@client).first -puts artifact_bundle_class.extract_backup(@client, deployment_group, backup) -puts 'Backup extracted successfully' +# backup_download_file = Tempfile.new(['backup-bundle', '.zip']) +# backup_download_path = backup_download_file.path +# puts "\nDownloading backup bundle file and saving at #{backup_download_path}" +# artifact_bundle_class.download_backup(@client, backup_download_path, backups.first) +# puts 'Downloaded successfully.' if File.exist?(backup_download_path) +# +# puts "\nUploading backup bundle" +# puts artifact_bundle_class.create_backup_from_file!(@client, deployment_group, backup_download_path, 'Backup Bundle') +# +# puts "\nExtracting backup bundle uploaded" +# backup = artifact_bundle_class.get_backups(@client).first +# puts artifact_bundle_class.extract_backup(@client, deployment_group, backup) +# puts 'Backup extracted successfully' puts "\nDeleting the artifact bundles" item.delete diff --git a/examples/image-streamer/build_plan.rb b/examples/image-streamer/build_plan.rb index 1736a3a9f..f23bfdec1 100644 --- a/examples/image-streamer/build_plan.rb +++ b/examples/image-streamer/build_plan.rb @@ -11,15 +11,12 @@ require_relative '../_client_i3s' # Gives access to @client # Supported APIs: -# - 300, 500, 600, 800, 1000, 1020 +# - 1000, 1020, 2000 # Resources that can be created according to parameters: -# api_version = 300 & variant = Synergy to OneviewSDK::ImageStreamer::API300::BuildPlan -# api_version = 500 & variant = Synergy to OneviewSDK::ImageStreamer::API500::BuildPlan -# api_version = 600 & variant = Synergy to OneviewSDK::ImageStreamer::API600::BuildPlan -# api_version = 800 & variant = Synergy to OneviewSDK::ImageStreamer::API800::BuildPlan # api_version = 1000 & variant = Synergy to OneviewSDK::ImageStreamer::API1000::BuildPlan # api_version = 1020 & variant = Synergy to OneviewSDK::ImageStreamer::API1020::BuildPlan +# api_version = 2000 & variant = Synergy to OneviewSDK::ImageStreamer::API2000::BuildPlan # Example: Create a build plan for an Image Streamer # NOTE: This will create three build plans with the following names 'Build_Plan_1', 'Build_Plan_2' and 'Build_Plan_3', then delete them. @@ -39,7 +36,8 @@ content: 'esxcli system hostname set --domain "@DomainName@"' } plan_script_class = OneviewSDK::ImageStreamer.resource_named('PlanScript', @client.api_version) -plan_script = plan_script_class.find_by(@client, name: @plan_script1_name).first +plan_script1 = plan_script_class.find_by(@client, name: @plan_script1_name).first +puts "\n#Found a plan script with name #{plan_script1[:name]} and uri #{plan_script1[:uri]}." puts "\n#Creating a plan script with name #{options_plan_script[:name]}." plan_script2 = plan_script_class.new(@client, options_plan_script) plan_script2.create! @@ -47,7 +45,6 @@ puts "\n#Plan script with name #{plan_script2['name']} and uri #{plan_script2['uri']} created successfully." custom_attributes = JSON.parse(plan_script2['customAttributes']) - custom_attributes.replace([custom_attributes[0].merge('type' => 'String')]) build_plan_class = OneviewSDK::ImageStreamer.resource_named('BuildPlan', @client.api_version) @@ -56,7 +53,7 @@ serialNumber: '1', parameters: 'anystring', planScriptName: @plan_script1_name, - planScriptUri: plan_script['uri'] + planScriptUri: plan_script1['uri'] } ] @@ -105,9 +102,9 @@ item3.retrieve! puts "\n#Build plan with name #{item3['name']} and uri #{item3['uri']} created successfully." -# List all builds +# List all build plans list = build_plan_class.get_all(@client) -puts "\n#Listing all:" +puts "\n#Listing all build plans:" list.each { |p| puts " #{p['name']}" } id = list.first['uri'] @@ -137,3 +134,10 @@ puts "\n#Removing a build plan with id #{item5['uri']} and name #{item5['name']}:" item5.delete puts "\n#Build plan with id #{item5['uri']} and name #{item5['name']} removed successfully." + +# Creating a build plan to support automation +item = build_plan_class.new(@client, options) +puts "\n#Creating a build plan with name #{options[:name]}." +item.create! +item.retrieve! +puts "\n#Build plan with name #{item['name']} and uri #{item['uri']} created successfully." diff --git a/examples/image-streamer/deployment_group.rb b/examples/image-streamer/deployment_group.rb index fae396220..1327b4aef 100644 --- a/examples/image-streamer/deployment_group.rb +++ b/examples/image-streamer/deployment_group.rb @@ -12,16 +12,13 @@ require_relative '../_client_i3s' # Gives access to @client # Supported APIs: -# - 300, 500, 600, 800, 1000, 1020, 1600 +# - 1000, 1020, 1600, 2000 # Resources that can be created according to parameters: -# api_version = 300 & variant = Synergy to OneviewSDK::ImageStreamer::API300::DeploymentGroup -# api_version = 500 & variant = Synergy to OneviewSDK::ImageStreamer::API500::DeploymentGroup -# api_version = 600 & variant = Synergy to OneviewSDK::ImageStreamer::API600::DeploymentGroup -# api_version = 800 & variant = Synergy to OneviewSDK::ImageStreamer::API800::DeploymentGroup # api_version = 1000 & variant = Synergy to OneviewSDK::ImageStreamer::API1000::DeploymentGroup # api_version = 1020 & variant = Synergy to OneviewSDK::ImageStreamer::API1020::DeploymentGroup # api_version = 1600 & variant = Synergy to OneviewSDK::ImageStreamer::API1600::DeploymentGroup +# api_version = 2000 & variant = Synergy to OneviewSDK::ImageStreamer::API2000::DeploymentGroup # Example: # - Gets the Deployment Groups diff --git a/examples/image-streamer/deployment_plan.rb b/examples/image-streamer/deployment_plan.rb index c1f035d13..986f42536 100644 --- a/examples/image-streamer/deployment_plan.rb +++ b/examples/image-streamer/deployment_plan.rb @@ -11,16 +11,13 @@ require_relative '../_client_i3s' # Gives access to @client # Supported APIs: -# - 300, 500, 600, 800, 1000, 1020, 1600 +# - 1000, 1020, 1600, 2000 # Resources that can be created according to parameters: -# api_version = 300 & variant = Synergy to OneviewSDK::ImageStreamer::API300::DeploymentPlan -# api_version = 500 & variant = Synergy to OneviewSDK::ImageStreamer::API500::DeploymentPlan -# api_version = 600 & variant = Synergy to OneviewSDK::ImageStreamer::API600::DeploymentPlan -# api_version = 800 & variant = Synergy to OneviewSDK::ImageStreamer::API800::DeploymentPlan # api_version = 1000 & variant = Synergy to OneviewSDK::ImageStreamer::API1000::DeploymentPlan # api_version = 1020 & variant = Synergy to OneviewSDK::ImageStreamer::API1020::DeploymentPlan # api_version = 1600 & variant = Synergy to OneviewSDK::ImageStreamer::API1600::DeploymentPlan +# api_version = 2000 & variant = Synergy to OneviewSDK::ImageStreamer::API2000::DeploymentPlan # Example: Create a deployment plan for an Image Streamer # NOTE: This will create a deployment plan named 'Deployment_Plan_1', then delete it. @@ -36,15 +33,15 @@ name: 'Deployment_Plan_1', description: 'AnyDescription', hpProvided: false, - oeBuildPlanURI: build_plan.data['uri'] + oeBuildPlanURI: build_plan['uri'] } options2 = { name: 'Deployment_Plan_2', description: 'AnyDescription', hpProvided: false, - oeBuildPlanURI: build_plan.data['uri'], - goldenImageURI: golden_image.data['uri'] + oeBuildPlanURI: build_plan['uri'], + goldenImageURI: golden_image['uri'] } # Creating a deployment plan diff --git a/examples/image-streamer/golden_image.rb b/examples/image-streamer/golden_image.rb index 042c49332..e69015a57 100644 --- a/examples/image-streamer/golden_image.rb +++ b/examples/image-streamer/golden_image.rb @@ -11,15 +11,12 @@ require_relative '../_client_i3s' # Gives access to @client # Supported APIs: -# - 300, 500, 600, 800, 1000, 1020 +# - 1000, 1020, 2000 # Resources that can be created according to parameters: -# api_version = 300 & variant = Synergy to OneviewSDK::ImageStreamer::API300::GoldenImage -# api_version = 500 & variant = Synergy to OneviewSDK::ImageStreamer::API500::GoldenImage -# api_version = 600 & variant = Synergy to OneviewSDK::ImageStreamer::API600::GoldenImage -# api_version = 800 & variant = Synergy to OneviewSDK::ImageStreamer::API800::GoldenImage # api_version = 1000 & variant = Synergy to OneviewSDK::ImageStreamer::API1000::GoldenImage # api_version = 1020 & variant = Synergy to OneviewSDK::ImageStreamer::API1020::GoldenImage +# api_version = 2000 & variant = Synergy to OneviewSDK::ImageStreamer::API2000::GoldenImage # Example: Create a golden image for an Image Streamer # NOTE: This will create a golden images named 'Golden_Image_1' and 'Golden_Image_2', and then, it will delete them. diff --git a/examples/image-streamer/os_volume.rb b/examples/image-streamer/os_volume.rb index ba9b8807f..dccd3cc1e 100644 --- a/examples/image-streamer/os_volume.rb +++ b/examples/image-streamer/os_volume.rb @@ -11,15 +11,12 @@ require_relative '../_client_i3s' # Gives access to @client # Supported APIs: -# - 300, 500, 600, 800, 1000, 1020 +# - 1000, 1020, 2000 # Resources that can be created according to parameters: -# api_version = 300 & variant = Synergy to OneviewSDK::ImageStreamer::API300::OSVolume -# api_version = 500 & variant = Synergy to OneviewSDK::ImageStreamer::API500::OSVolume -# api_version = 600 & variant = Synergy to OneviewSDK::ImageStreamer::API600::OSVolume -# api_version = 800 & variant = Synergy to OneviewSDK::ImageStreamer::API800::OSVolume # api_version = 1000 & variant = Synergy to OneviewSDK::ImageStreamer::API1000::OSVolume # api_version = 1020 & variant = Synergy to OneviewSDK::ImageStreamer::API1020::OSVolume +# api_version = 2000 & variant = Synergy to OneviewSDK::ImageStreamer::API2000::OSVolume # Example: Os Volume for an Image Streamer # NOTE: You must have one os volume. diff --git a/examples/image-streamer/plan_script.rb b/examples/image-streamer/plan_script.rb index dc3cf708a..5487501b5 100644 --- a/examples/image-streamer/plan_script.rb +++ b/examples/image-streamer/plan_script.rb @@ -12,15 +12,12 @@ require_relative '../_client_i3s' # Gives access to @client # Supported APIs: -# - 300, 500, 600, 800, 1000, 1020 +# - 1000, 1020, 2000 # Resources that can be created according to parameters: -# api_version = 300 & variant = Synergy to OneviewSDK::ImageStreamer::API300::PlanScript -# api_version = 500 & variant = Synergy to OneviewSDK::ImageStreamer::API500::PlanScript -# api_version = 600 & variant = Synergy to OneviewSDK::ImageStreamer::API600::PlanScript -# api_version = 800 & variant = Synergy to OneviewSDK::ImageStreamer::API800::PlanScript # api_version = 1000 & variant = Synergy to OneviewSDK::ImageStreamer::API1000::PlanScript # api_version = 1020 & variant = Synergy to OneviewSDK::ImageStreamer::API1020::PlanScript +# api_version = 2000 & variant = Synergy to OneviewSDK::ImageStreamer::API2000::PlanScript # Example: Create a plan script for an Image Streamer # NOTE: This will create a plan script named 'Plan_Script_1', then delete it. @@ -66,14 +63,14 @@ item2.retrieve! puts "\n#Plan script updated successfully with id #{item2['uri']} and new name #{item2['name']}." -# Updates a plan script -puts "\n#Retrieves the modified contents of the selected Plan Script with id #{item2['uri']} and name #{item2['name']}:" -differences = item2.retrieve_differences -puts "\n#Differences retrieved:" -differences.each { |d| puts " #{d}" } -puts "\n#Plan script updated successfully with id #{item2['uri']} and new name #{item2['name']}." - # Removes a plan script puts "\n#Removing a plan script with id #{item2['uri']} and name #{item2['name']}:" item2.delete puts "\n#Plan script with id #{item2['uri']} and name #{item2['name']} removed successfully." + +# Creating a plan script to support automation +puts "\n#Creating a plan script with name #{options[:name]}." +plan_script = plan_script_class.new(@client, options) +plan_script.create! +plan_script.retrieve! +puts "\n#Plan script with name #{plan_script['name']} and uri #{plan_script['uri']} created successfully." From 4668a2e148aabc2a2d05586aca76999e546b9b6f Mon Sep 17 00:00:00 2001 From: VenkateshRavula Date: Thu, 5 Nov 2020 22:44:07 +0530 Subject: [PATCH 9/9] removed comments --- examples/image-streamer/artifact_bundle.rb | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/image-streamer/artifact_bundle.rb b/examples/image-streamer/artifact_bundle.rb index 19e1098c9..521d5ab31 100644 --- a/examples/image-streamer/artifact_bundle.rb +++ b/examples/image-streamer/artifact_bundle.rb @@ -65,26 +65,26 @@ puts "\nExtracting artifact bundle uploaded" puts 'Artifact Bundle extracted successfully.' if item_uploaded.extract -#puts "\nCreating a backup associated to deployment group with name='#{deployment_group['name']}' and uri='#{deployment_group['uri']}'" -#puts artifact_bundle_class.create_backup(@client, deployment_group) +puts "\nCreating a backup associated to deployment group with name='#{deployment_group['name']}' and uri='#{deployment_group['uri']}'" +puts artifact_bundle_class.create_backup(@client, deployment_group) puts "\nListing backups" backups = artifact_bundle_class.get_backups(@client) backups.each { |bkp| puts bkp['name'] } -# backup_download_file = Tempfile.new(['backup-bundle', '.zip']) -# backup_download_path = backup_download_file.path -# puts "\nDownloading backup bundle file and saving at #{backup_download_path}" -# artifact_bundle_class.download_backup(@client, backup_download_path, backups.first) -# puts 'Downloaded successfully.' if File.exist?(backup_download_path) -# -# puts "\nUploading backup bundle" -# puts artifact_bundle_class.create_backup_from_file!(@client, deployment_group, backup_download_path, 'Backup Bundle') -# -# puts "\nExtracting backup bundle uploaded" -# backup = artifact_bundle_class.get_backups(@client).first -# puts artifact_bundle_class.extract_backup(@client, deployment_group, backup) -# puts 'Backup extracted successfully' +backup_download_file = Tempfile.new(['backup-bundle', '.zip']) +backup_download_path = backup_download_file.path +puts "\nDownloading backup bundle file and saving at #{backup_download_path}" +artifact_bundle_class.download_backup(@client, backup_download_path, backups.first) +puts 'Downloaded successfully.' if File.exist?(backup_download_path) + +puts "\nUploading backup bundle" +puts artifact_bundle_class.create_backup_from_file!(@client, deployment_group, backup_download_path, 'Backup Bundle') + +puts "\nExtracting backup bundle uploaded" +backup = artifact_bundle_class.get_backups(@client).first +puts artifact_bundle_class.extract_backup(@client, deployment_group, backup) +puts 'Backup extracted successfully' puts "\nDeleting the artifact bundles" item.delete