Skip to content

Commit

Permalink
Merge b84c45e into e876cf6
Browse files Browse the repository at this point in the history
  • Loading branch information
AsisBagga committed May 13, 2020
2 parents e876cf6 + b84c45e commit 21086db
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,7 @@ This release extends support of the SDK to OneView REST API version 1600 (OneVie

#### Features supported
- Enclosure
- Enclosure Group

## v5.11.0

Expand Down
14 changes: 7 additions & 7 deletions endpoints-support.md
Expand Up @@ -50,13 +50,13 @@ OneviewSDK::Datacenter.find_by(@client, width: 11000).map(&:remove)
|<sub>/rest/drive-enclosures/{id}/port-map</sub> | GET | :white_check_mark: | :white_check_mark: |
|<sub>/rest/drive-enclosures/{id}/refreshState</sub> | PUT | :white_check_mark: | :white_check_mark: |
| **Enclosure Groups** |
|<sub>/rest/enclosure-groups</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/enclosure-groups</sub> | POST | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/enclosure-groups/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/enclosure-groups/{id}</sub> | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/enclosure-groups/{id}</sub> | DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/enclosure-groups/{id}/script</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/enclosure-groups/{id}/script</sub> | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/enclosure-groups</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/enclosure-groups</sub> | POST | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/enclosure-groups/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/enclosure-groups/{id}</sub> | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/enclosure-groups/{id}</sub> | DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/enclosure-groups/{id}/script</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/enclosure-groups/{id}/script</sub> | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
| **Enclosures** |
|<sub>/rest/enclosures</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/enclosures</sub> | POST | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
Expand Down
14 changes: 12 additions & 2 deletions examples/shared_samples/enclosure_group.rb
Expand Up @@ -15,7 +15,7 @@
# NOTE: This will create an enclosure group named 'OneViewSDK Test Enclosure Group', then delete it.
#
# Supported APIs:
# - 200, 300, 500, 600
# - 200, 300, 500, 600, 800, 1200, and 1600.

# Resources that can be created according to parameters:
# api_version = 200 & variant = any to OneviewSDK::API200::EnclosureGroup
Expand All @@ -25,11 +25,20 @@
# api_version = 500 & variant = Synergy to OneviewSDK::API500::Synergy::EnclosureGroup
# api_version = 600 & variant = C7000 to OneviewSDK::API600::C7000::EnclosureGroup
# api_version = 600 & variant = Synergy to OneviewSDK::API600::Synergy::EnclosureGroup
# api_version = 800 & variant = C7000 to OneviewSDK::API800::C7000::EnclosureGroup
# api_version = 800 & variant = Synergy to OneviewSDK::API800::Synergy::EnclosureGroup
# api_version = 1000 & variant = C7000 to OneviewSDK::API1000::C7000::EnclosureGroup
# api_version = 1000 & variant = Synergy to OneviewSDK::API1000::Synergy::EnclosureGroup
# api_version = 1200 & variant = C7000 to OneviewSDK::API1200::C7000::EnclosureGroup
# api_version = 1200 & variant = Synergy to OneviewSDK::API1200::Synergy::EnclosureGroup
# api_version = 1600 & variant = C7000 to OneviewSDK::API1600::C7000::EnclosureGroup
# api_version = 1600 & variant = Synergy to OneviewSDK::API1600::Synergy::EnclosureGroup

# Resource Class used in this sample
encl_group_class = OneviewSDK.resource_named('EnclosureGroup', @client.api_version)

# LogicalInterconnectGroup class used in this sample
# LogicalInterconnectGroup class used in this sample.
# To run this example for API > 1200, you would need to set api version for LIG to 1200 or less.
lig_class = OneviewSDK.resource_named('LogicalInterconnectGroup', @client.api_version)

type = 'enclosure group'
Expand All @@ -42,6 +51,7 @@

if @client.api_version >= 600
# Gets enclosure group by scopeUris
# To run this example for API > 1200, you would need to set api version for scope to 1200 or less.
scope_class = OneviewSDK.resource_named('Scope', @client.api_version)
scope_item = scope_class.get_all(@client).first
query = {
Expand Down
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api1600/c7000/enclosure_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 '../../api1200/c7000/enclosure_group'

module OneviewSDK
module API1600
module C7000
# Enclosure group resource implementation on API1600 C7000
class EnclosureGroup < OneviewSDK::API1200::C7000::EnclosureGroup
end
end
end
end
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api1600/synergy/enclosure_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 '../../api1200/synergy/enclosure_group'

module OneviewSDK
module API1600
module Synergy
# Enclosure group resource implementation on API1600 Synergy
class EnclosureGroup < OneviewSDK::API1200::Synergy::EnclosureGroup
end
end
end
end
10 changes: 10 additions & 0 deletions spec/unit/resource/api1600/c7000/enclosure_group_spec.rb
@@ -0,0 +1,10 @@
require 'spec_helper'

klass = OneviewSDK::API1600::C7000::EnclosureGroup
RSpec.describe klass do
include_context 'shared context'

it 'inherits from API1200' do
expect(described_class).to be < OneviewSDK::API1200::C7000::EnclosureGroup
end
end
10 changes: 10 additions & 0 deletions spec/unit/resource/api1600/synergy/enclosure_group_spec.rb
@@ -0,0 +1,10 @@
require 'spec_helper'

klass = OneviewSDK::API1600::Synergy::EnclosureGroup
RSpec.describe klass do
include_context 'shared context'

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

0 comments on commit 21086db

Please sign in to comment.