Skip to content

Commit

Permalink
Merge pull request #464 from HewlettPackard/API2000_hyp_resources
Browse files Browse the repository at this point in the history
Added API2000 support for hypervisor resources
  • Loading branch information
VenkateshRavula committed Sep 9, 2020
2 parents 704dfba + e1a0ffd commit 41e5c45
Show file tree
Hide file tree
Showing 29 changed files with 450 additions and 36 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ This release extends support to OneView Rest API version 2000 (OneView v5.40) fo
- Ethernet Network
- FC Network
- FCOE Network
- Firmware Driver
- Hypervisor Cluster Profile
- Hypervisor Manager
- Network Set
- OS Deployment Plan
- Server Certificate

#### Bug fixes & Enhancements:
- Enahanced the method to set the default API version to appliance's max API version instead of hardcoded 200.
Expand Down
34 changes: 17 additions & 17 deletions endpoints-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,23 +112,23 @@ OneviewSDK::Datacenter.find_by(@client, width: 11000).map(&:remove)
| **Firmware Bundles** |
|<sub>/rest/firmware-bundles</sub> | POST | :white_check_mark: | :white_check_mark: |
| **Firmware Drivers** |
|<sub>/rest/firmware-drivers</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/firmware-drivers</sub> | POST | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/firmware-drivers/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/firmware-drivers/{id}</sub> | DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/firmware-drivers</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/firmware-drivers</sub> | POST | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/firmware-drivers/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/firmware-drivers/{id}</sub> | DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| **Hypervisor Managers** |
|<sub>/rest/hypervisor-managers</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-managers</sub> | POST | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-managers/{id}</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark:| :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-managers/{id}</sub> | PUT | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-managers/{id}</sub> | DELETE | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-managers</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-managers</sub> | POST | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-managers/{id}</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark:| :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-managers/{id}</sub> | PUT | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-managers/{id}</sub> | DELETE | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| **Hypervisor Cluster Profiles** |
|<sub>/rest/hypervisor-cluster-profiles</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-cluster-profiles</sub> | POST | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-cluster-profiles/{id}</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-cluster-profiles/{id}</sub> | PUT | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-cluster-profiles/{id}/compliance-preview</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-cluster-profiles/{id}</sub> | DELETE | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-cluster-profiles</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-cluster-profiles</sub> | POST | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-cluster-profiles/{id}</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-cluster-profiles/{id}</sub> | PUT | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-cluster-profiles/{id}/compliance-preview</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/hypervisor-cluster-profiles/{id}</sub> | DELETE | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| **ID Pools** |
|<sub>/rest/id-pools/{poolType}</sub> | GET | :white_check_mark: | :white_check_mark: |
|<sub>/rest/id-pools/{poolType}</sub> | PUT | :white_check_mark: | :white_check_mark: |
Expand Down Expand Up @@ -254,8 +254,8 @@ OneviewSDK::Datacenter.find_by(@client, width: 11000).map(&:remove)
|<sub>/rest/network-sets/{id}/withoutEthernet</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|<sub>/rest/network-sets/{id}</sub> | PATCH | :white_check_mark: | :white_check_mark: | :heavy_minus_sign: |:heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: |
| **OS Deployment Plans** |
|<sub>/rest/os-deployment-plans/</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/os-deployment-plans/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |
|<sub>/rest/os-deployment-plans/</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: | :white_check_mark: |
|<sub>/rest/os-deployment-plans/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: |:white_check_mark: | :white_check_mark: |
| **Power Devices** |
|<sub>/rest/power-devices</sub> | GET | :white_check_mark: | :white_check_mark: |
|<sub>/rest/power-devices</sub> | POST | :white_check_mark: | :white_check_mark: |
Expand Down
5 changes: 2 additions & 3 deletions examples/_client.rb.example
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,5 @@ puts "Connected to OneView appliance at #{@client.url}\n\n"
# @hypervisor_host_prefix = "Test-Cluster-host"
# @hypervisor_hypervisorType = "Vmware"
# @hypervisor_type = "HypervisorClusterProfileV3"
# @hypervisor_manager_uri = "/rest/hypervisor-managers/befc6bd9-0366-4fd9-a3fc-c92ab0df3603"
# @hypervisor_serverProfileTemplateUri = "/rest/server-profile-templates/c865a62c-8fd8-414c-8c16-3f7ca75ab2ba"
# @hypervisor_deploymentPlanUri = "/rest/os-deployment-plans/c54e1dab-cc14-48fa-92bf-d301671fb0cf"
# @hypervisor_serverProfileTemplate = "spt-hypervisor"
# @hypervisor_deploymentPlan = "Basic Deployment Plan"
2 changes: 1 addition & 1 deletion examples/shared_samples/firmware_driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# The OneView appliance must have a valid spp and hotfix
#
# Supported APIs:
# - 200, 300, 500, 600, 800, 1000, 1200, 1600, 1800
# - 200, 300, 500, 600, 800, 1000, 1200, 1600, 1800, 2000
# Supported API variants
# C7000, Synergy

Expand Down
25 changes: 20 additions & 5 deletions examples/shared_samples/hypervisor_cluster_profile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,35 @@
# NOTE: This will create a hypervisor cluster profile named 'cluster5', update it and then delete it.
#
# Supported API Versions:
# - 800, 1000, 1200, 1600 and 1800
# - 800, 1000, 1200, 1600, 1800, 2000

# Supported Variants:
# - C7000 and Synergy for all API versions

# Resource Class used in this sample
hypervisor_cluster_profile_class = OneviewSDK.resource_named('HypervisorClusterProfile', @client.api_version)
hypervisor_manager_class = OneviewSDK.resource_named('HypervisorManager', @client.api_version)
server_profile_template_class = OneviewSDK.resource_named('ServerProfileTemplate', @client.api_version)
os_deployment_plan_class = OneviewSDK.resource_named('OSDeploymentPlan', @client.api_version, 'Synergy')

# Making GET calls on below resources and fetch URI
hm_matches = hypervisor_manager_class.find_by(@client, name: @hypervisor_manager_ip)
hm = hm_matches.first
spt_matches = server_profile_template_class.find_by(@client, name: @hypervisor_serverProfileTemplate)
spt = spt_matches.first
dp_matches = os_deployment_plan_class.find_by(@client, name: @hypervisor_deploymentPlan)
osdp = dp_matches.first

options = {
type: @hypervisor_type,
name: @hypervisor_cluster_profile_name,
hypervisorManagerUri: @hypervisor_manager_uri,
hypervisorManagerUri: hm[:uri],
path: @hypervisor_path,
hypervisorType: @hypervisor_hypervisorType,
hypervisorHostProfileTemplate: {
serverProfileTemplateUri: @hypervisor_serverProfileTemplateUri,
serverProfileTemplateUri: spt[:uri],
deploymentPlan: {
deploymentPlanUri: @hypervisor_deploymentPlanUri,
deploymentPlanUri: osdp[:uri],
serverPassword: @hypervisor_server_password
},
hostprefix: @hypervisor_host_prefix
Expand Down Expand Up @@ -68,5 +79,9 @@
# Delete method accepts 2 arguments - soft_delete(boolean) and force(boolean) which are optional till API1200
# soft_delete has become mandatory argument in API1600 and force is still optional
# The default values for the arguments is "false"
hcp.delete(true, true)
if @client.api_version.to_i < 1600
hcp.delete
else
hcp.delete(true, true)
end
puts "\nSuccesfully deleted the cluster profile"
2 changes: 1 addition & 1 deletion examples/shared_samples/hypervisor_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# NOTE: This will create a hypervisor manager named 'vcenter.corp.com', update it and then delete it.
#
# Supported APIs:
# - 800, 1000, 1200, 1600 and 1800
# - 800, 1000, 1200, 1600, 1800, 2000

# Supported Variants:
# - C7000 and Synergy for all API versions
Expand Down
8 changes: 2 additions & 6 deletions examples/shared_samples/os_deployment_plan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@
require_relative '../_client' # Gives access to @client

# Supported APIs:
# - 300, 500 only for Synergy

# Resources that can be created according to parameters:
# api_version = 300 & variant = Synergy to OneviewSDK::API300::Synergy::OSDeploymentPlan
# api_version = 500 & variant = Synergy to OneviewSDK::API500::Synergy::OSDeploymentPlan
# - 300, 500, 600, 800, 1000, 1200, 1600, 1800, 2000 only for Synergy

# Resource Class used in this sample
os_deployment_plan_class = OneviewSDK.resource_named('OSDeploymentPlan', @client.api_version)
os_deployment_plan_class = OneviewSDK.resource_named('OSDeploymentPlan', @client.api_version, 'Synergy')

puts "\nListing all 'OS Deployment Plans':"
all_deployments_plans = os_deployment_plan_class.get_all(@client)
Expand Down
2 changes: 1 addition & 1 deletion examples/shared_samples/server_certificate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# @hypervisor_manager_ip

# All supported APIs for Server Certificate:
# - 600, 800, 1000, 1200, 1600 and 1800
# - 600, 800, 1000, 1200, 1600, 1800, 2000

# Supported Variants:
# - C7000 and Synergy for all API versions
Expand Down
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api2000/c7000/firmware_driver.rb
Original file line number Diff line number Diff line change
@@ -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 '../../api1800/c7000/firmware_driver'

module OneviewSDK
module API2000
module C7000
# FirmwareDriver resource implementation for API2000 C7000
class FirmwareDriver < OneviewSDK::API1800::C7000::FirmwareDriver
end
end
end
end
Original file line number Diff line number Diff line change
@@ -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 '../../api1800/c7000/hypervisor_cluster_profile'

module OneviewSDK
module API2000
module C7000
# Hypervisor cluster profile resource implementation for API2000 C7000
class HypervisorClusterProfile < OneviewSDK::API1800::C7000::HypervisorClusterProfile
end
end
end
end
22 changes: 22 additions & 0 deletions lib/oneview-sdk/resource/api2000/c7000/hypervisor_manager.rb
Original file line number Diff line number Diff line change
@@ -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 '../../api1800/c7000/hypervisor_manager'

module OneviewSDK
module API2000
module C7000
# Hypervisor Manager resource implementation for API2000 C7000
class HypervisorManager < OneviewSDK::API1800::C7000::HypervisorManager
end
end
end
end
Loading

0 comments on commit 41e5c45

Please sign in to comment.