Skip to content

Commit

Permalink
Merge pull request #430 from HewlettPackard/API1600ConnectionTemplate
Browse files Browse the repository at this point in the history
API1600 support for Connection Template
  • Loading branch information
yuvirani committed Jun 3, 2020
2 parents 2039acc + fbff799 commit e823050
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,11 @@
## v5.12.1 (unreleased)

#### Notes
This release extends support of the SDK to OneView REST API version 1600 (OneView v5.20).

#### Features supported
- Connection Template

## v5.12.0

#### Notes
Expand Down
8 changes: 4 additions & 4 deletions endpoints-support.md
Expand Up @@ -31,10 +31,10 @@ OneviewSDK::Datacenter.find_by(@client, width: 11000).map(&:remove)
|<sub>/rest/alerts/{id}</sub> |DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/alerts/AlertChangeLog/{id}</sub> |DELETE | :white_check_mark: |:white_check_mark: | :white_check_mark: |
| **Connection Templates** |
|<sub>/rest/connection-templates</sub> |GET | :white_check_mark: | :white_check_mark: | :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: | :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: | :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: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/connection-templates</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/connection-templates/defaultConnectionTemplate</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/connection-templates/{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/connection-templates/{id}</sub> |PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| **Datacenters** |
|<sub>/rest/datacenters</sub> | GET | :white_check_mark: | :white_check_mark: |
|<sub>/rest/datacenters</sub> | POST | :white_check_mark: | :white_check_mark: |
Expand Down
13 changes: 11 additions & 2 deletions examples/shared_samples/connection_template.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 @@ -14,7 +14,7 @@
# Example: Manage connection templates
#
# Supported APIs:
# - 200, 300, 500, 600
# - 200, 300, 500, 600, 800, 1000, 1200, 1600

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


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

module OneviewSDK
module API1600
module C7000
# Connection template resource implementation for API1600 C7000
class ConnectionTemplate < OneviewSDK::API1200::C7000::ConnectionTemplate
end
end
end
end
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api1600/synergy/connection_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 '../../api1200/synergy/connection_template'

module OneviewSDK
module API1600
module Synergy
# Connection template resource implementation for API1600 Synergy
class ConnectionTemplate < OneviewSDK::API1200::Synergy::ConnectionTemplate
end
end
end
end
20 changes: 20 additions & 0 deletions spec/unit/resource/api1600/c7000/connection_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::API1600::C7000::ConnectionTemplate do
include_context 'shared context'

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

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

0 comments on commit e823050

Please sign in to comment.