Skip to content

Commit

Permalink
Api600 support for connection templates
Browse files Browse the repository at this point in the history
  • Loading branch information
AnushaY1916 committed Mar 23, 2018
1 parent fd41592 commit e721c86
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 39 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,7 @@ Extends support of the SDK to OneView Rest API version 600 (OneView v4.0).

#### Features supported
This release adds support to OneView Rest API version 600 for the hardware variants C7000 and Synergy to the already existing features:
- Connection Templates
- Enclosure
- Enclosure Group
- Ethernet Network
Expand Down
8 changes: 4 additions & 4 deletions endpoints-support.md
Expand Up @@ -55,10 +55,10 @@ OneviewSDK::Datacenter.find_by(@client, width: 11000).map(&:remove)
|<sub>/rest/certificates/client/rabbitmq/keys/{aliasName}</sub> |GET | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x:
|<sub>/rest/certificates/client/rabbitmq/{aliasName}</sub> |GET | :heavy_multiplication_x: | :heavy_multiplication_x: | :heavy_multiplication_x:
| **Connection Templates** |
|<sub>/rest/connection-templates</sub> |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/connection-templates/defaultConnectionTemplate</sub> |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/connection-templates/{id}</sub> |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/connection-templates/{id}</sub> |PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/connection-templates</sub> |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/connection-templates/defaultConnectionTemplate</sub> |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/connection-templates/{id}</sub> |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/connection-templates/{id}</sub> |PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| **Datacenters** |
|<sub>/rest/datacenters</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/datacenters</sub> | POST | :white_check_mark: | :white_check_mark: | :white_check_mark: |
Expand Down
4 changes: 3 additions & 1 deletion examples/shared_samples/connection_template.rb
Expand Up @@ -14,14 +14,16 @@
# Example: Manage connection templates
#
# 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::ConnectionTemplate
# api_version = 300 & variant = C7000 to OneviewSDK::API300::C7000::ConnectionTemplate
# api_version = 300 & variant = Synergy to OneviewSDK::API300::Synergy::ConnectionTemplate
# api_version = 500 & variant = C7000 to OneviewSDK::API500::C7000::ConnectionTemplate
# api_version = 500 & variant = Synergy to OneviewSDK::API500::Synergy::ConnectionTemplate
# api_version = 500 & variant = C7000 to OneviewSDK::API500::C7000::ConnectionTemplate
# api_version = 500 & variant = Synergy to OneviewSDK::API500::Synergy::ConnectionTemplate

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

module OneviewSDK
module API600
module C7000
# Connection template resource implementation for API600 C7000
class ConnectionTemplate < OneviewSDK::API300::C7000::ConnectionTemplate
class ConnectionTemplate < OneviewSDK::API500::C7000::ConnectionTemplate
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/connection_template'
require_relative '../../api500/synergy/connection_template'

module OneviewSDK
module API600
module Synergy
# Connection template resource implementation for API600 Synergy
class ConnectionTemplate < OneviewSDK::API300::Synergy::ConnectionTemplate
class ConnectionTemplate < OneviewSDK::API500::Synergy::ConnectionTemplate
end
end
end
Expand Down
Expand Up @@ -11,8 +11,8 @@

require 'spec_helper'

klass = OneviewSDK::API500::C7000::ConnectionTemplate
klass = OneviewSDK::API600::C7000::ConnectionTemplate
RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do
let(:current_client) { $client_500 }
include_examples 'ConnectionTemplateCreateExample', 'integration api500 context'
let(:current_client) { $client_600 }
include_examples 'ConnectionTemplateCreateExample', 'integration api600 context'
end
Expand Up @@ -11,8 +11,8 @@

require 'spec_helper'

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

klass = OneviewSDK::API500::C7000::ConnectionTemplate
klass = OneviewSDK::API600::C7000::ConnectionTemplate
RSpec.describe klass, integration: true, type: UPDATE do
let(:current_client) { $client_500 }
include_examples 'ConnectionTemplateUpdateExample', 'integration api500 context'
let(:current_client) { $client_600 }
include_examples 'ConnectionTemplateUpdateExample', 'integration api600 context'
end
Expand Up @@ -11,8 +11,8 @@

require 'spec_helper'

klass = OneviewSDK::API500::Synergy::ConnectionTemplate
klass = OneviewSDK::API600::Synergy::ConnectionTemplate
RSpec.describe klass, integration: true, type: CREATE, sequence: seq(klass) do
let(:current_client) { $client_500_synergy }
include_examples 'ConnectionTemplateCreateExample', 'integration api500 context'
let(:current_client) { $client_600_synergy }
include_examples 'ConnectionTemplateCreateExample', 'integration api600 context'
end
Expand Up @@ -11,8 +11,8 @@

require 'spec_helper'

klass = OneviewSDK::API500::Synergy::ConnectionTemplate
klass = OneviewSDK::API600::Synergy::ConnectionTemplate
RSpec.describe klass, integration: true, type: DELETE, sequence: rseq(klass) do
let(:current_client) { $client_500_synergy }
include_examples 'ConnectionTemplateDeleteExample', 'integration api500 context'
let(:current_client) { $client_600_synergy }
include_examples 'ConnectionTemplateDeleteExample', 'integration api600 context'
end
@@ -1,7 +1,7 @@
require 'spec_helper'

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

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

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

describe '#get_default' do
it 'verify endpoint' do
expect(@client_500).to receive(:rest_get).with('/rest/connection-templates/defaultConnectionTemplate').and_return(FakeResponse.new({}))
connection = described_class.get_default(@client_500)
expect(connection).to be_an_instance_of OneviewSDK::API500::C7000::ConnectionTemplate
expect(@client_600).to receive(:rest_get).with('/rest/connection-templates/defaultConnectionTemplate').and_return(FakeResponse.new({}))
connection = described_class.get_default(@client_600)
expect(connection).to be_an_instance_of OneviewSDK::API600::C7000::ConnectionTemplate
end
end
end
12 changes: 6 additions & 6 deletions spec/unit/resource/api600/synergy/connection_template_spec.rb
@@ -1,17 +1,17 @@
require 'spec_helper'

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

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

describe '#get_default' do
it 'verify endpoint' do
expect(@client_500).to receive(:rest_get).with('/rest/connection-templates/defaultConnectionTemplate').and_return(FakeResponse.new({}))
connection = described_class.get_default(@client_500)
expect(connection).to be_an_instance_of OneviewSDK::API500::Synergy::ConnectionTemplate
expect(@client_600).to receive(:rest_get).with('/rest/connection-templates/defaultConnectionTemplate').and_return(FakeResponse.new({}))
connection = described_class.get_default(@client_600)
expect(connection).to be_an_instance_of OneviewSDK::API600::Synergy::ConnectionTemplate
end
end
end

0 comments on commit e721c86

Please sign in to comment.