Skip to content

Commit

Permalink
Merge 9dee069 into 59b72a1
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvirani committed May 26, 2020
2 parents 59b72a1 + 9dee069 commit 050401f
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -19,6 +19,7 @@ This release extends support of the SDK to OneView REST API version 1600 (OneVie
- Logical Interconnect
- Logical Interconnect Group
- OS Deployment Plan
- Scopes
- Server Certificate
- Server Hardware
- Server Hardware Type
Expand Down
20 changes: 10 additions & 10 deletions endpoints-support.md
Expand Up @@ -315,16 +315,16 @@ OneviewSDK::Datacenter.find_by(@client, width: 11000).map(&:remove)
|<sub>/rest/sas-logical-jbods/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark:
|<sub>/rest/sas-logical-jbods/{id}/drives</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark:
| **Scopes** |
|<sub>/rest/scopes</sub> | POST | :white_check_mark: | :white_check_mark: | :white_check_mark:| :white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/scopes</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark:| :white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/scopes/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark:| :white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/scopes/{id}</sub> | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark:| :white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/scopes/{id}</sub> | PATCH | :heavy_minus_sign: | :white_check_mark: | :white_check_mark:| :white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/scopes/{id}</sub> | DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark:| :white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/scopes/{id}/resource-assignments</sub> | PATCH | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign:| :heavy_minus_sign: |:heavy_minus_sign: |:heavy_minus_sign: |
|<sub>/rest/scopes/resources/{resource_uri}</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark:| :white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/scopes/resources/{resource_uri}</sub> | PUT | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark:| :white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/scopes/resources/{resource_uri}</sub> | PATCH | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark:| :white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/scopes</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/scopes</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/scopes/{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/scopes/{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/scopes/{id}</sub> | PATCH | :heavy_minus_sign: | :white_check_mark: | :white_check_mark:| :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/scopes/{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/scopes/{id}/resource-assignments</sub> | PATCH | :white_check_mark: | :heavy_minus_sign: | :heavy_minus_sign:| :heavy_minus_sign: |:heavy_minus_sign: |:heavy_minus_sign: |:heavy_minus_sign: |
|<sub>/rest/scopes/resources/{resource_uri}</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark:| :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/scopes/resources/{resource_uri}</sub> | PUT | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark:| :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/scopes/resources/{resource_uri}</sub> | PATCH | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark:| :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
| **Server Certificate** |
|<sub>/rest/certificates/https/remote/{address}</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/certificates/servers</sub> | POST | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
Expand Down
28 changes: 23 additions & 5 deletions examples/shared_samples/scope.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 @@ -21,14 +21,31 @@
# - API500 for Synergy
# - API600 for C7000
# - API600 for Synergy
# - API800 for C7000
# - API800 for Synergy
# - API1000 for C7000
# - API1000 for Synergy
# - API1200 for C7000
# - API1200 for Synergy
# - API1600 for C7000
# - API1600 for Synergy

# Resources that can be created according to parameters:
# api_version = 300 & variant = C7000 to OneviewSDK::API300::C7000::Scope
# api_version = 300 & variant = Synergy to OneviewSDK::API300::C7000::Scope
# api_version = 300 & variant = Synergy to OneviewSDK::API300::Synergy::Scope
# api_version = 500 & variant = C7000 to OneviewSDK::API500::C7000::Scope
# api_version = 500 & variant = Synergy to OneviewSDK::API500::C7000::Scope
# api_version = 500 & variant = Synergy to OneviewSDK::API500::Synergy::Scope
# api_version = 600 & variant = C7000 to OneviewSDK::API600::C7000::Scope
# api_version = 600 & variant = Synergy to OneviewSDK::API600::C7000::Scope
# api_version = 600 & variant = Synergy to OneviewSDK::API600::Synergy::Scope
# api_version = 800 & variant = C7000 to OneviewSDK::API800::C7000::Scope
# api_version = 800 & variant = Synergy to OneviewSDK::API800::Synergy::Scope
# api_version = 1000 & variant = C7000 to OneviewSDK::API1000::C7000::Scope
# api_version = 1000 & variant = Synergy to OneviewSDK::API1000:Synergy::Scope
# api_version = 1200 & variant = C7000 to OneviewSDK::API1200::C7000::Scope
# api_version = 1200 & variant = Synergy to OneviewSDK::API1200::Synergy::Scope
# api_version = 1600 & variant = C7000 to OneviewSDK::API1600::C7000::Scope
# api_version = 1600 & variant = Synergy to OneviewSDK::API1600::Synergy::Scope


# NOTE: Scopes doesn't support versions smaller than 300.

Expand Down Expand Up @@ -96,7 +113,7 @@
scope3 = scope_class.new(@client, options)
scope3.create
puts 'Created scope3'
scope_item = scope_class.find_by(@client, name: 'scope2').first
scope_item = scope_class.find_by(@client, name: 'Scope2').first
scope_class.add_resource_scope(@client, enclosure, scopes: [scope3, scope_item])
puts 'Server hardware resource added to scope3'

Expand All @@ -105,6 +122,7 @@
scope_class.add_resource_scope(@client, server_hardware, scopes: [scope_item])
scope_class.resource_patch(@client, server_hardware, add_scopes: [scope3], remove_scopes: [scope_item])
puts 'Removed resource from scope3'

# Delete all scopes created.
scope2.delete
scope3.delete
Expand Down
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api1600/c7000/scope.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/scope'

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

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

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

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

0 comments on commit 050401f

Please sign in to comment.