Skip to content

Commit

Permalink
Api600 support for Server Hardware ypes
Browse files Browse the repository at this point in the history
  • Loading branch information
AnushaY1916 committed Mar 26, 2018
1 parent fd41592 commit 772dff1
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 38 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -21,6 +21,7 @@ This release adds support to OneView Rest API version 600 for the hardware varia
- SAS Logical Interconnect
- SAS Logical Interconnect Group
- Server Hardware
- Server Hardware Types
- Server Profile Template

## v5.3.0
Expand Down
8 changes: 4 additions & 4 deletions endpoints-support.md
Expand Up @@ -436,10 +436,10 @@ OneviewSDK::Datacenter.find_by(@client, width: 11000).map(&:remove)
|<sub>/rest/server-hardware/{id}/firmware | GET | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/server-hardware/discovery | POST | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: |
| **Server Hardware Types** |
|<sub>/rest/server-hardware-types</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/server-hardware-types/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/server-hardware-types/{id}</sub> | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/server-hardware-types/{id}</sub> | DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/server-hardware-types</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/server-hardware-types/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/server-hardware-types/{id}</sub> | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/server-hardware-types/{id}</sub> | DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| **Server Profile Templates** |
|<sub>/rest/server-profile-templates</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark:
|<sub>/rest/server-profile-templates</sub> | POST | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark:
Expand Down
4 changes: 3 additions & 1 deletion examples/shared_samples/server_hardware_type.rb
Expand Up @@ -14,14 +14,16 @@
# Example: Actions with a Server Hardware Type
#
# Supported APIs:
# - 200, 300, 500
# - 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

# Resource Class used in this sample
shw_type_class = OneviewSDK.resource_named('ServerHardwareType', @client.api_version)
Expand Down
4 changes: 2 additions & 2 deletions lib/oneview-sdk/resource/api600/c7000/server_hardware_type.rb
Expand Up @@ -9,13 +9,13 @@
# 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/c7000/server_hardware_type'
require_relative '../../api500/c7000/server_hardware_type'

module OneviewSDK
module API600
module C7000
# Server hardware type resource implementation for API600 C7000
class ServerHardwareType < OneviewSDK::API300::C7000::ServerHardwareType
class ServerHardwareType < OneviewSDK::API500::C7000::ServerHardwareType
end
end
end
Expand Down
Expand Up @@ -9,13 +9,13 @@
# 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/server_hardware_type'
require_relative '../../api500/synergy/server_hardware_type'

module OneviewSDK
module API600
module Synergy
# Server hardware type resource implementation for API600 Synergy
class ServerHardwareType < OneviewSDK::API300::Synergy::ServerHardwareType
class ServerHardwareType < OneviewSDK::API500::Synergy::ServerHardwareType
end
end
end
Expand Down
@@ -1,8 +1,8 @@
require 'spec_helper'

klass = OneviewSDK::API500::C7000::ServerHardwareType
klass = OneviewSDK::API600::C7000::ServerHardwareType
RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do
let(:current_client) { $client_500 }
let(:server_hardware_class) { OneviewSDK::API500::C7000::ServerHardware }
include_examples 'ServerHardwareTypeCreateExample', 'integration api500 context', true
let(:current_client) { $client_600 }
let(:server_hardware_class) { OneviewSDK::API600::C7000::ServerHardware }
include_examples 'ServerHardwareTypeCreateExample', 'integration api600 context', true
end
@@ -1,10 +1,10 @@
require 'spec_helper'

klass = OneviewSDK::API500::C7000::ServerHardwareType
klass = OneviewSDK::API600::C7000::ServerHardwareType
RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do
include_context 'integration api500 context'
let(:current_client) { $client_500 }
let(:server_hardware) { OneviewSDK::API500::C7000::ServerHardware.find_by(current_client, name: $secrets['server_hardware2_ip']).first }
include_context 'integration api600 context'
let(:current_client) { $client_600 }
let(:server_hardware) { OneviewSDK::API600::C7000::ServerHardware.find_by(current_client, name: $secrets['server_hardware2_ip']).first }

include_examples 'ServerHardwareTypeDeleteExample', 'integration api500 context', true
include_examples 'ServerHardwareTypeDeleteExample', 'integration api600 context', true
end
@@ -1,7 +1,7 @@
require 'spec_helper'

klass = OneviewSDK::API500::C7000::ServerHardwareType
klass = OneviewSDK::API600::C7000::ServerHardwareType
RSpec.describe klass, integration: true, type: UPDATE do
let(:current_client) { $client_500 }
include_examples 'ServerHardwareTypeUpdateExample', 'integration api500 context'
let(:current_client) { $client_600 }
include_examples 'ServerHardwareTypeUpdateExample', 'integration api600 context'
end
@@ -1,7 +1,7 @@
require 'spec_helper'

klass = OneviewSDK::API500::Synergy::ServerHardwareType
klass = OneviewSDK::API600::Synergy::ServerHardwareType
RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do
let(:current_client) { $client_500_synergy }
include_examples 'ServerHardwareTypeCreateExample', 'integration api500 context'
let(:current_client) { $client_600_synergy }
include_examples 'ServerHardwareTypeCreateExample', 'integration api600 context'
end
@@ -1,10 +1,10 @@
require 'spec_helper'

klass = OneviewSDK::API500::Synergy::ServerHardwareType
klass = OneviewSDK::API600::Synergy::ServerHardwareType
RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do
include_context 'integration api500 context'
let(:current_client) { $client_500_synergy }
let(:server_hardware) { OneviewSDK::API500::Synergy::ServerHardware.get_all(current_client).first }
include_context 'integration api600 context'
let(:current_client) { $client_600_synergy }
let(:server_hardware) { OneviewSDK::API600::Synergy::ServerHardware.get_all(current_client).first }

include_examples 'ServerHardwareTypeDeleteExample', 'integration api500 context'
include_examples 'ServerHardwareTypeDeleteExample', 'integration api600 context'
end
@@ -1,7 +1,7 @@
require 'spec_helper'

klass = OneviewSDK::API500::Synergy::ServerHardwareType
klass = OneviewSDK::API600::Synergy::ServerHardwareType
RSpec.describe klass, integration: true, type: UPDATE do
let(:current_client) { $client_500_synergy }
include_examples 'ServerHardwareTypeUpdateExample', 'integration api500 context'
let(:current_client) { $client_600_synergy }
include_examples 'ServerHardwareTypeUpdateExample', 'integration api600 context'
end
6 changes: 3 additions & 3 deletions spec/unit/resource/api600/c7000/server_hardware_type_spec.rb
@@ -1,9 +1,9 @@
require 'spec_helper'

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

it 'inherits from OneviewSDK::API300::C7000::ServerHardwareType' do
expect(described_class).to be < OneviewSDK::API300::C7000::ServerHardwareType
it 'inherits from OneviewSDK::API500::C7000::ServerHardwareType' do
expect(described_class).to be < OneviewSDK::API500::C7000::ServerHardwareType
end
end
@@ -1,9 +1,9 @@
require 'spec_helper'

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

it 'inherits from OneviewSDK::API300::Synergy::ServerHardwareType' do
expect(described_class).to be < OneviewSDK::API300::Synergy::ServerHardwareType
it 'inherits from OneviewSDK::API500::Synergy::ServerHardwareType' do
expect(described_class).to be < OneviewSDK::API500::Synergy::ServerHardwareType
end
end

0 comments on commit 772dff1

Please sign in to comment.