Skip to content
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

API1800 support for Storage Volume/Volume Attachment/Volume Template #446

Merged
merged 1 commit into from Jul 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -11,6 +11,9 @@ This release extends support to OneView Rest API version 1800 (OneView v5.30) fo
- Network Set
- Scope
- Uplink Set
- Volume
- Volume Attachment
- Volume Template

## v5.13.0

Expand Down
56 changes: 28 additions & 28 deletions endpoints-support.md

Large diffs are not rendered by default.

20 changes: 15 additions & 5 deletions examples/shared_samples/volume.rb
@@ -1,4 +1,4 @@
# (C) Copyright 2017 Hewlett Packard Enterprise Development LP
# (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.
Expand All @@ -16,10 +16,12 @@
# @unmanaged_volume_wwn (optional)
# NOTE: This sample is for APIs 200 and 300 only. To see sample for API 500, look at the example volume.rb in the examples/api500 folder.
#
# Resources that can be created according to parameters:
# api_version = 200 & variant = any to OneviewSDK::API200::Volume
# api_version = 300 & variant = C7000 to OneviewSDK::API300::C7000::Volume
# api_version = 300 & variant = Synergy to OneviewSDK::API300::Synergy::Volume

# Supported API Versions
# - 200, 300, 500, 600, 800, 1000, 1200, 1600 and 1800

# Supported Variants:
# C7000 and Synergy for all API versions

# Resource Class used in this sample
volume_class = OneviewSDK.resource_named('Volume', @client.api_version)
Expand All @@ -29,6 +31,14 @@
storage_pool_class = OneviewSDK.resource_named('StoragePool', @client.api_version)
volume_template_class = OneviewSDK.resource_named('VolumeTemplate', @client.api_version)

if @client.api_version >= 600
raise "If you want execute sample for API #{@client.api_version}," \
"you should execute the ruby file '/examples/api600/volume.rb'"
elsif @client.api_version == 500
raise "If you want execute sample for API #{@client.api_version}," \
"you should execute the ruby file '/examples/api500/volume.rb'"
end

puts '1) Common = Storage System + Storage Pool'

# Set Storage System
Expand Down
15 changes: 6 additions & 9 deletions examples/shared_samples/volume_attachment.rb
@@ -1,4 +1,4 @@
# (C) Copyright 2017 Hewlett Packard Enterprise Development LP
# (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.
Expand All @@ -12,14 +12,11 @@
require_relative '../_client' # Gives access to @client

# All supported APIs for Volume Attachment:
# - 200, 300, 500

# Resources classes that you can use for Volume Attachment in this example:
# volume_attachment_class = OneviewSDK::API200::VolumeAttachment
# volume_attachment_class = OneviewSDK::API300::C7000::VolumeAttachment
# volume_attachment_class = OneviewSDK::API300::Synergy::VolumeAttachment
# volume_attachment_class = OneviewSDK::API500::C7000::VolumeAttachment
# volume_attachment_class = OneviewSDK::API500::Synergy::VolumeAttachment
# - 200, 300, 500, 600, 800, 1000, 1200, 1600 and 1800

# Supported Variants:
# C7000 and Synergy for all API versions

volume_attachment_class = OneviewSDK.resource_named('VolumeAttachment', @client.api_version)

# List volume attachments
Expand Down
36 changes: 3 additions & 33 deletions examples/shared_samples/volume_template.rb
Expand Up @@ -15,42 +15,12 @@
# @storage_system_ip

# All supported APIs for Volume Template:
# - 200, 300, 500. 600
# - 200, 300, 500. 600, 800, 1000, 1200, 1600 and 1800

raise 'Must set @storage_system_ip in _client.rb' unless @storage_system_ip

# Resources classes that you can use for Volume Template in this example:
# volume_template_class = OneviewSDK::API200::VolumeTemplate
# volume_template_class = OneviewSDK::API300::C7000::VolumeTemplate
# volume_template_class = OneviewSDK::API300::Synergy::VolumeTemplate
# volume_template_class = OneviewSDK::API500::C7000::VolumeTemplate
# volume_template_class = OneviewSDK::API500::Synergy::VolumeTemplate
# volume_template_class = OneviewSDK::API600::C7000::VolumeTemplate
# volume_template_class = OneviewSDK::API600::Synergy::VolumeTemplate
# volume_template_class = OneviewSDK::API1600::C7000::VolumeTemplate
# volume_template_class = OneviewSDK::API1600::Synergy::VolumeTemplate

# Resources classes that you can use for Storage System in this example:
# storage_system_class = OneviewSDK::API200::StorageSystem
# storage_system_class = OneviewSDK::API300::C7000::StorageSystem
# storage_system_class = OneviewSDK::API300::Synergy::StorageSystem
# storage_system_class = OneviewSDK::API500::C7000::StorageSystem
# storage_system_class = OneviewSDK::API500::Synergy::StorageSystem
# storage_system_class = OneviewSDK::API600::C7000::StorageSystem
# storage_system_class = OneviewSDK::API600::Synergy::StorageSystem
# storage_system_class = OneviewSDK::API1600::C7000::StorageSystem
# storage_system_class = OneviewSDK::API1600::Synergy::StorageSystem

# Resources classes that you can use for Storage Pool in this example:
# storage_pool_class = OneviewSDK::API200::StoragePool
# storage_pool_class = OneviewSDK::API300::C7000::StoragePool
# storage_pool_class = OneviewSDK::API300::Synergy::StoragePool
# storage_pool_class = OneviewSDK::API500::C7000::StoragePool
# storage_pool_class = OneviewSDK::API500::Synergy::StoragePool
# storage_pool_class = OneviewSDK::API600::C7000::StoragePool
# storage_pool_class = OneviewSDK::API600::Synergy::StoragePool
# storage_pool_class = OneviewSDK::API1600::C7000::StoragePool
# storage_pool_class = OneviewSDK::API1600::Synergy::StoragePool
# Supported Variants for Storage System, Storage Pool and Volume Attachment
# - C7000 and Synergy for all API versions

# Resource classses used in this sample
volume_template_class = OneviewSDK.resource_named('VolumeTemplate', @client.api_version)
Expand Down
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api1800/c7000/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/c7000/volume'

module OneviewSDK
module API1800
module C7000
# Volume resource implementation on API1800 C7000
class Volume < OneviewSDK::API1600::C7000::Volume
end
end
end
end
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api1800/c7000/volume_attachment.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/volume_attachment'

module OneviewSDK
module API1800
module C7000
# Storage Volume Attachment resource implementation for API1800 C7000
class VolumeAttachment < OneviewSDK::API1600::C7000::VolumeAttachment
end
end
end
end
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api1800/c7000/volume_template.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/volume_template'

module OneviewSDK
module API1800
module C7000
# Volume Template resource implementation for API1800 C7000
class VolumeTemplate < OneviewSDK::API1600::C7000::VolumeTemplate
end
end
end
end
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api1800/synergy/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 '../c7000/volume'

module OneviewSDK
module API1800
module Synergy
# Volume resource implementation for API1800 Synergy
class Volume < OneviewSDK::API1800::C7000::Volume
end
end
end
end
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api1800/synergy/volume_attachment.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 '../c7000/volume_attachment'

module OneviewSDK
module API1800
module Synergy
# Storage Volume Attachment resource implementation for API1800 Synergy
class VolumeAttachment < OneviewSDK::API1800::C7000::VolumeAttachment
end
end
end
end
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api1800/synergy/volume_template.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 '../c7000/volume_template'

module OneviewSDK
module API1800
module Synergy
# Volume Template resource implementation for API1800 Synergy
class VolumeTemplate < OneviewSDK::API1800::C7000::VolumeTemplate
end
end
end
end
20 changes: 20 additions & 0 deletions spec/unit/resource/api1800/c7000/volume_attachment_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::VolumeAttachment do
include_context 'shared context'

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

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

it 'inherits from OneviewSDK::API1600::C7000::VolumeTemplate' do
expect(described_class).to be < OneviewSDK::API1600::C7000::VolumeTemplate
end
end
20 changes: 20 additions & 0 deletions spec/unit/resource/api1800/synergy/volume_attachment_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::VolumeAttachment do
include_context 'shared context'

it 'inherits from OneviewSDK::API1800::C7000::VolumeAttachment' do
expect(described_class).to be < OneviewSDK::API1800::C7000::VolumeAttachment
end
end
20 changes: 20 additions & 0 deletions spec/unit/resource/api1800/synergy/volume_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::Volume do
include_context 'shared context'

it 'inherits from OneviewSDK::API1800::C7000::Volume' do
expect(described_class).to be < OneviewSDK::API1800::C7000::Volume
end
end
20 changes: 20 additions & 0 deletions spec/unit/resource/api1800/synergy/volume_template_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::VolumeTemplate do
include_context 'shared context'

it 'inherits from OneviewSDK::API1800::C7000::VolumeTemplate' do
expect(described_class).to be < OneviewSDK::API1800::C7000::VolumeTemplate
end
end