Skip to content

Commit

Permalink
Merge branch 'master' into API1600_SPT
Browse files Browse the repository at this point in the history
  • Loading branch information
AsisBagga committed May 15, 2020
2 parents 7dd4fe9 + a5c8aac commit 0204d9b
Show file tree
Hide file tree
Showing 18 changed files with 276 additions and 56 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,9 @@ This release extends support of the SDK to OneView REST API version 1600 (OneVie

#### Features supported
- Enclosure
- Logical Enclosure
- Server Hardware
- Server Hardware Type
- Server Profile Template

## v5.11.0
Expand Down
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -223,6 +223,13 @@ OneviewSDK::API300.variant # 'Synergy'
OneviewSDK::API300.variant_updated? # true
OneviewSDK::EthernetNetwork # OneviewSDK::API300::Synergy::EthernetNetwork
OneviewSDK::API300::EthernetNetwork # OneviewSDK::API300::Synergy::EthernetNetwork

# Likewise, we can set a new default variant for the API1600 module:
OneviewSDK::API1600.variant = 'Synergy'
OneviewSDK::API1600.variant # 'Synergy'
OneviewSDK::API1600.variant_updated? # true
OneviewSDK::EthernetNetwork # OneviewSDK::API1600::Synergy::EthernetNetwork
OneviewSDK::API1600::EthernetNetwork # OneviewSDK::API1600::Synergy::EthernetNetwork
```

We understand that this can be confusing, so to avoid any confusion or unexpected behavior, we recommend specifying the full namespace identifier in your code. At the very least, set defaults explicitly using `OneviewSDK.api_version = <ver>` and `OneviewSDK::API300.variant = <variant>`, as the defaults may change.
Expand Down
68 changes: 34 additions & 34 deletions endpoints-support.md

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion examples/shared_samples/logical_enclosure.rb
Expand Up @@ -16,7 +16,7 @@
# To run this test with Synergy you must have an enclosureGroup with enclosure count = 3.
#
# Supported APIs:
# - 200, 300, 500, 600
# - 200, 300, 500, 600, 800, 1000, 1200, and 1600.

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


# Resource Class used in this sample
logical_enclosure_class = OneviewSDK.resource_named('LogicalEnclosure', @client.api_version)
Expand Down
16 changes: 5 additions & 11 deletions examples/shared_samples/server_hardware.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 @@ -18,17 +18,11 @@
# @server_hardware_username
# @server_hardware_password
#
# Supported APIs:
# - 200, 300, 500, 600

# Resources that can be created according to parameters:
# api_version = 200 & variant = any to OneviewSDK::API200::ServerHardware
# api_version = 300 & variant = C7000 to OneviewSDK::API300::C7000::ServerHardware
# api_version = 300 & variant = Synergy to OneviewSDK::API300::Synergy::ServerHardware
# api_version = 500 & variant = C7000 to OneviewSDK::API500::C7000::ServerHardware
# api_version = 500 & variant = Synergy to OneviewSDK::API500::Synergy::ServerHardware
# api_version = 600 & variant = C7000 to OneviewSDK::API600::C7000::ServerHardware
# api_version = 600 & variant = Synergy to OneviewSDK::API600::Synergy::ServerHardware
# Supported APIs:
# - 200, 300, 500, 600, 800, 1000, 1200, 1600
# Supported Variants:
# C7000 and Synergy for all api-versions

# Resource Class used in this sample
server_harware_class = OneviewSDK.resource_named('ServerHardware', @client.api_version)
Expand Down
13 changes: 3 additions & 10 deletions examples/shared_samples/server_hardware_type.rb
Expand Up @@ -14,16 +14,9 @@
# Example: Actions with a Server Hardware Type
#
# Supported APIs:
# - 200, 300, 500, 600

# Resources that can be created according to parameters:
# api_version = 200 & variant = any to OneviewSDK::API200::ServerHardwareType
# api_version = 300 & variant = C7000 to OneviewSDK::API300::C7000::ServerHardwareType
# api_version = 300 & variant = Synergy to OneviewSDK::API300::Synergy::ServerHardwareType
# api_version = 500 & variant = C7000 to OneviewSDK::API500::C7000::ServerHardwareType
# api_version = 500 & variant = Synergy to OneviewSDK::API500::Synergy::ServerHardwareType
# api_version = 600 & variant = C7000 to OneviewSDK::API600::C7000::ServerHardwareType
# api_version = 600 & variant = Synergy to OneviewSDK::API600::Synergy::ServerHardwareType
# - 200, 300, 500, 600, 800, 1000, 1200, 1600
# Supported API variants:
# C7000, Synergy

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

module OneviewSDK
module API1600
module C7000
# Logical Enclosure resource implementation on API1600 C7000
class LogicalEnclosure < OneviewSDK::API1200::C7000::LogicalEnclosure
end
end
end
end
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api1600/c7000/server_hardware.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/server_hardware'

module OneviewSDK
module API1600
module C7000
# Server Hardware resource implementation on API1600 C7000
class ServerHardware < OneviewSDK::API1200::C7000::ServerHardware
end
end
end
end
25 changes: 25 additions & 0 deletions lib/oneview-sdk/resource/api1600/c7000/server_hardware_type.rb
@@ -0,0 +1,25 @@
# (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/server_hardware_type'

module OneviewSDK
module API1600
module C7000
# Server hardware type resource implementation for API1600 C7000
class ServerHardwareType < OneviewSDK::API1200::C7000::ServerHardwareType
def self.api_version
1600
end
end
end
end
end
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api1600/synergy/logical_enclosure.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/logical_enclosure'

module OneviewSDK
module API1600
module Synergy
# Logical Enclosure resource implementation on API1600 Synergy
class LogicalEnclosure < OneviewSDK::API1200::Synergy::LogicalEnclosure
end
end
end
end
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api1600/synergy/server_hardware.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/server_hardware'

module OneviewSDK
module API1600
module Synergy
# Server Hardware resource implementation on API1600 Synergy
class ServerHardware < OneviewSDK::API1200::Synergy::ServerHardware
end
end
end
end
25 changes: 25 additions & 0 deletions lib/oneview-sdk/resource/api1600/synergy/server_hardware_type.rb
@@ -0,0 +1,25 @@
# (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/server_hardware_type'

module OneviewSDK
module API1600
module Synergy
# Server hardware type resource implementation for API1600 Synergy
class ServerHardwareType < OneviewSDK::API1600::C7000::ServerHardwareType
def self.api_version
1600
end
end
end
end
end
9 changes: 9 additions & 0 deletions spec/unit/resource/api1600/c7000/logical_enclosure_spec.rb
@@ -0,0 +1,9 @@
require 'spec_helper'

RSpec.describe OneviewSDK::API1600::C7000::LogicalEnclosure do
include_context 'shared context'

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

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

RSpec.describe OneviewSDK::API1600::C7000::ServerHardwareType do
include_context 'shared context'

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

RSpec.describe OneviewSDK::API1600::Synergy::LogicalEnclosure do
include_context 'shared context'

it 'inherits from OneviewSDK::API1200::Synergy::LogicalEnclosure' do
expect(described_class).to be < OneviewSDK::API1200::Synergy::LogicalEnclosure
end
end
20 changes: 20 additions & 0 deletions spec/unit/resource/api1600/synergy/server_hardware_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::API1600::Synergy::ServerHardware do
include_context 'shared context'

it 'inherits from OneviewSDK::API1200::Synergy::ServerHardware' do
expect(described_class).to be < OneviewSDK::API1200::Synergy::ServerHardware
end
end
@@ -0,0 +1,9 @@
require 'spec_helper'

RSpec.describe OneviewSDK::API1600::Synergy::ServerHardwareType do
include_context 'shared context'

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

0 comments on commit 0204d9b

Please sign in to comment.