From b19e5a4c03941aa96f75d01eb9df4f7b0fd7623c Mon Sep 17 00:00:00 2001 From: VenkateshRavula Date: Tue, 7 Apr 2020 13:31:50 +0530 Subject: [PATCH 1/8] Adding hypervisor managers for API 800, 1000 and 1200 --- CHANGELOG.md | 1 + endpoints-support.md | 6 + examples/hypervisor_managers.py | 82 +++++++++ hpOneView/connection.py | 6 +- hpOneView/oneview_client.py | 14 ++ hpOneView/resources/hypervisors/__init__.py | 0 .../hypervisors/hypervisor_managers.py | 165 ++++++++++++++++++ tests/unit/resources/hypervisors/__init__.py | 0 .../hypervisors/test_hypervisor_managers.py | 142 +++++++++++++++ 9 files changed, 415 insertions(+), 1 deletion(-) create mode 100644 examples/hypervisor_managers.py create mode 100755 hpOneView/resources/hypervisors/__init__.py create mode 100755 hpOneView/resources/hypervisors/hypervisor_managers.py create mode 100644 tests/unit/resources/hypervisors/__init__.py create mode 100644 tests/unit/resources/hypervisors/test_hypervisor_managers.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 51da18a50..768dae439 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,3 +68,4 @@ Extends support of the SDK to OneView REST API version 1200 (OneView v5.00). - Storage volume template - Switch type - Uplink set +- Hypervisor managers diff --git a/endpoints-support.md b/endpoints-support.md index acd44db36..ccffa677c 100755 --- a/endpoints-support.md +++ b/endpoints-support.md @@ -306,6 +306,12 @@ |/rest/storage-volumes/{id}/snapshots | POST | :white_check_mark: | :white_check_mark: | :white_check_mark: | |/rest/storage-volumes/{id}/snapshots/{snapshotId} | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | |/rest/storage-volumes/{id}/snapshots/{snapshotId} | DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| **Hypervisor Managers** +|/rest/hypervisor-managers |POST | :white_check_mark: | :white_check_mark: | :white_check_mark: | +|/rest/hypervisor-managers |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | +|/rest/hypervisor-managers/{id} |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | +|/rest/hypervisor-managers/{id} |PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: | +|/rest/hypervisor-managers/{id} |DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: | ## HPE Synergy Image Streamer diff --git a/examples/hypervisor_managers.py b/examples/hypervisor_managers.py new file mode 100644 index 000000000..b8131c9b8 --- /dev/null +++ b/examples/hypervisor_managers.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- +### +# (C) Copyright [2019] 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. +### + +from config_loader import try_load_from_file +from hpOneView.oneview_client import OneViewClient + +config = { + "ip": "", + "credentials": { + "userName": "", + "password": "" + } +} + +hypervisor_manager_information = { + "type": "HypervisorManagerV2", + "name": "172.18.13.11", + "displayName": "vcenter", + "hypervisorType": "Vmware", + "username": "dcs", + "password": "dcs", + "initialScopeUris": [] +} + +# Try load config from a file (if there is a config file) +config = try_load_from_file(config) +oneview_client = OneViewClient.config() + +# Add a hypervisor manager +hypervisor_manager_added = oneview_client.hypervisor_managers.add(hypervisor_manager_information) +print('Added hypervisor manager "{name}" successfully\n'.format(**hypervisor_manager_added)) + +# Retrieve hypervisor manager by URI +hypervisor_manager = oneview_client.hypervisor_managers.get(hypervisor_manager_added['uri']) +print('Get hypervisor manager by URI "{uri}", retrieved "{name}" successfully\n'.format(**hypervisor_manager)) + +# Retrieve hypervisor manager by FILTER +hypervisor_manager_list = oneview_client.hypervisor_managers.get_by('hypervisorType', 'Vmware') +print('Get hypervisor manager by FILTER "{hypervisorType}", retrieved "{name}" successfully\n'.format(**hypervisor_manager_list[0])) + +# Update the hypervisor manager +hypervisor_manager['displayName'] = "New hypervisor" +hypervisor_manager = oneview_client.hypervisor_managers.update(hypervisor_manager) +print('Hypervisor manager "{displayName}" updated successfully\n'.format(**hypervisor_manager)) + +# Retrieve hypervisor manager by NAME +hypervisor_manager = oneview_client.hypervisor_managers.get_by_name(hypervisor_manager['name']) +print('Get hypervisor manager by NAME "{name}", retrieved "{uri}" successfully\n'.format(**hypervisor_manager)) + +# Update the hypervisor manager forcefully +hypervisor_manager['displayName'] = "Update hypervisor force" +hypervisor_manager = oneview_client.hypervisor_managers.update(hypervisor_manager, force=True) +print('Hypervisor manager "{displayName}" updated forcefully\n'.format(**hypervisor_manager)) + +# Get all hypervisor managers +print("Get all hypervisor managers:") +hypervisor_manager_all = oneview_client.hypervisor_managers.get_all() +for hyp_mgr in hypervisor_manager_all: + print(" - " + hyp_mgr['name']) + +# Remove added hypervisor manager +oneview_client.hypervisor_managers.delete(hypervisor_manager) +print('Successfully removed the hypervisor manager "{name}"\n'.format(**hypervisor_manager)) + +# Add another hypervisor manager and remove forcefully +hypervisor_manager_added = oneview_client.hypervisor_managers.add(hypervisor_manager_information) +oneview_client.hypervisor_managers.delete(hypervisor_manager_added, force=True) +print("Successfully added and removed the hypervisor manager forcefully") diff --git a/hpOneView/connection.py b/hpOneView/connection.py index 9f8bb6127..e9eb3cf75 100644 --- a/hpOneView/connection.py +++ b/hpOneView/connection.py @@ -640,7 +640,11 @@ def disable_etag_validation(self): # ------------------------------------ # Uncategorized # ------------------------------------ - 'unmanaged-devices': '/rest/unmanaged-devices' + 'unmanaged-devices': '/rest/unmanaged-devices', + # ------------------------------------ + # Hypervisors + # ------------------------------------ + 'hypervisor-managers': '/rest/hypervisor-managers' } ############################################################################ diff --git a/hpOneView/oneview_client.py b/hpOneView/oneview_client.py index ab8c64a58..d1669f76b 100755 --- a/hpOneView/oneview_client.py +++ b/hpOneView/oneview_client.py @@ -107,6 +107,7 @@ from hpOneView.resources.settings.appliance_node_information import ApplianceNodeInformation from hpOneView.resources.settings.appliance_time_and_locale_configuration import ApplianceTimeAndLocaleConfiguration from hpOneView.resources.settings.versions import Versions +from hpOneView.resources.hypervisors.hypervisor_managers import HypervisorManagers ONEVIEW_CLIENT_INVALID_PROXY = 'Invalid Proxy format' @@ -198,6 +199,7 @@ def __init__(self, config): self.__backups = None self.__login_details = None self.__licenses = None + self.__hypervisor_managers = None @classmethod def from_json_file(cls, file_name): @@ -1171,3 +1173,15 @@ def licenses(self): if not self.__licenses: self.__licenses = Licenses(self.__connection) return self.__licenses + + @property + def hypervisor_managers(self): + """ + Gets the Hypervisor Managers API client. + + Returns: + HypervisorManagers + """ + if not self.__hypervisor_managers: + self.__hypervisor_managers = HypervisorManagers(self.__connection) + return self.__hypervisor_managers diff --git a/hpOneView/resources/hypervisors/__init__.py b/hpOneView/resources/hypervisors/__init__.py new file mode 100755 index 000000000..e69de29bb diff --git a/hpOneView/resources/hypervisors/hypervisor_managers.py b/hpOneView/resources/hypervisors/hypervisor_managers.py new file mode 100755 index 000000000..c67ed380c --- /dev/null +++ b/hpOneView/resources/hypervisors/hypervisor_managers.py @@ -0,0 +1,165 @@ +# -*- coding: utf-8 -*- +### +# (C) Copyright [2019] 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. +### + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals +from future import standard_library + +standard_library.install_aliases() + +from hpOneView.resources.resource import ResourceClient + + +class HypervisorManagers(object): + URI = '/rest/hypervisor-managers' + + def __init__(self, con): + self._connection = con + self._client = ResourceClient(con, self.URI) + + def get_all(self, start=0, count=-1, filter='', fields='', query='', sort='', view='', scope_uris=''): + """ + Gets a list of Hypervisor Managers based on optional sorting and filtering, and constrained by start and count + parameters. + + Args: + start: + The first item to return, using 0-based indexing. + If not specified, the default is 0 - start with the first available item. + count: + The number of resources to return. A count of -1 requests all items. + The actual number of items in the response might differ from the requested + count if the sum of start and count exceeds the total number of items. + filter (list or str): + A general filter/query string to narrow the list of items returned. The + default is no filter; all resources are returned. + fields: + Specifies which fields should be returned in the result set. + query: + A general query string to narrow the list of resources returned. The default + is no query - all resources are returned. + sort: + The sort order of the returned data set. By default, the sort order is based + on create time with the oldest entry first. + view: + Return a specific subset of the attributes of the resource or collection, by + specifying the name of a predefined view. The default view is expand - show all + attributes of the resource and all elements of collections of resources. + scope_uris: + An expression to restrict the resources returned according to the scopes to + which they are assigned. + + Returns: + list: Hypervisor Managers + """ + return self._client.get_all(start, count, filter=filter, sort=sort, query=query, fields=fields, view=view, scope_uris=scope_uris) + + def get(self, id_or_uri): + """ + Get the details of the particular Hypervisor Manager based on its URI or ID. + + Args: + id_or_uri: + Can be either the Hypervisor Manager ID or the URI + + Returns: + dict: Hypervisor Manager + """ + return self._client.get(id_or_uri) + + def get_by(self, field, value): + """ + Gets all hypervisor managers that match the filter + The search is case-insensitive + + Args: + field: field name to filter + value: value to filter + + Returns: + dict: hypervisor managers + """ + return self._client.get_by(field, value) + + def get_by_name(self, name): + """ + Gets the Hypervisor Manager by name. + + Args: + name: Name of the Hypervisor Manager + + Returns: + dict: Hypervisor Manager + """ + return self._client.get_by_name(name) + + def add(self, resource, timeout=-1): + """ + Adds a Hypervisor Manager using the information provided in the request body. + + Args: + resource (dict): + Hypervisor Manager resource. + timeout: + Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation + in OneView, just stop waiting for its completion. + + Returns: + dict: The added resource. + """ + return self._client.create(resource, timeout=timeout) + + def update(self, resource, force=False, timeout=-1): + """ + Updates the Hypervisor Manager resource. The properties that are omitted (not included as part + of the request body) are ignored. + + Args: + resource (dict): Object to update. + force: + If set to true, the operation completes despite any problems with network connectivity or errors on + the resource itself. The default is false. + timeout: + Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation + in OneView, just stops waiting for its completion. + + Returns: + Updated resource. + """ + return self._client.update(resource, timeout=timeout, force=force) + + def delete(self, resource, force=False, timeout=-1): + """ + Deletes a Hypervisor Manager object based on its UUID or URI. + + Args: + resource (dict): + Object to delete. + force: + If set to true, the operation completes despite any problems with + network connectivity or errors on the resource itself. The default is false. + timeout: + Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation + in OneView; it just stops waiting for its completion. + + Returns: + bool: Indicates if the hypervisor was successfully deleted. + """ + + return self._client.delete(resource, force=force, timeout=timeout) diff --git a/tests/unit/resources/hypervisors/__init__.py b/tests/unit/resources/hypervisors/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/unit/resources/hypervisors/test_hypervisor_managers.py b/tests/unit/resources/hypervisors/test_hypervisor_managers.py new file mode 100644 index 000000000..60ff2e6ee --- /dev/null +++ b/tests/unit/resources/hypervisors/test_hypervisor_managers.py @@ -0,0 +1,142 @@ +# -*- coding: utf-8 -*- +### +# (C) Copyright [2019] 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. +### + +from unittest import TestCase + +import mock + +from hpOneView.connection import connection +from hpOneView.resources.hypervisors.hypervisor_managers import HypervisorManagers +from hpOneView.resources.resource import ResourceClient + + +class HypervisorManagersTest(TestCase): + def setUp(self): + self.host = '127.0.0.1' + self.connection = connection(self.host) + self._hypervisor_managers = HypervisorManagers(self.connection) + + @mock.patch.object(ResourceClient, 'create') + def test_create_called_once(self, mock_create): + resource = dict( + type="HypervisorManagerV2", + name="172.18.13.11", + displayName="vcenter", + hypervisorType="Vmware", + username="dcs", + password="dcs", + initialScopeUris=[] + ) + mock_create.return_value = {} + self._hypervisor_managers.add(resource, 70) + mock_create.assert_called_once_with(resource.copy(), timeout=70) + + @mock.patch.object(ResourceClient, 'create') + def test_add_called_once_with_defaults(self, mock_create): + resource = dict( + type="HypervisorManagerV2", + name="172.18.13.11", + displayName="vcenter", + hypervisorType="Vmware", + username="dcs", + password="dcs", + initialScopeUris=[], + ) + self._hypervisor_managers.add(resource) + mock_create.assert_called_once_with(resource.copy(), timeout=-1) + + @mock.patch.object(ResourceClient, 'get_all') + def test_get_all_called_once(self, mock_get_all): + filter = 'name=TestName' + sort = 'name:ascending' + fields = 'name' + view = 'expand' + query = 'query' + scope_uris = 'rest/scopes/cd237b60-09e2-45c4-829e-082e318a6d2a' + + self._hypervisor_managers.get_all(2, 500, filter=filter, sort=sort, fields=fields, view=view, query=query, scope_uris=scope_uris) + mock_get_all.assert_called_once_with(2, 500, filter=filter, sort=sort, fields=fields, view=view, query=query, scope_uris=scope_uris) + + @mock.patch.object(ResourceClient, 'get_all') + def test_get_all_called_once_with_default(self, mock_get_all): + self._hypervisor_managers.get_all() + mock_get_all.assert_called_once_with(0, -1, filter='', sort='', fields='', view='', query='', scope_uris='') + + @mock.patch.object(ResourceClient, 'get') + def test_get_by_id_called_once(self, mock_get): + uri = "/rest/hypervisor-managers/f0a0a113-ec97-41b4-83ce-d7c92b900e7c" + self._hypervisor_managers.get(uri) + mock_get.assert_called_once_with(uri) + + @mock.patch.object(ResourceClient, 'get') + def test_get_by_uri_called_once(self, mock_get): + id = "f0a0a113-ec97-41b4-83ce-d7c92b900e7c" + self._hypervisor_managers.get(id) + mock_get.assert_called_once_with(id) + + @mock.patch.object(ResourceClient, 'get_by') + def test_get_by_called_once(self, mock_get_by): + hypervisor_managers = [{'name': 'name1', 'displayName': 'display1'}, {'name': 'name2', 'displayName': 'display2'}] + mock_get_by.return_value = hypervisor_managers + result = self._hypervisor_managers.get_by("displayName", "display1") + mock_get_by.assert_called_once_with("displayName", "display1") + self.assertEqual(result, hypervisor_managers) + + @mock.patch.object(ResourceClient, 'get_by') + def test_get_by_name_should_return_none_when_resource_is_not_found(self, mock_get_by): + mock_get_by.return_value = [] + response = self._hypervisor_managers.get_by_name("test") + mock_get_by.assert_called_once_with("name", "test") + self.assertEqual(response, None) + + @mock.patch.object(ResourceClient, 'get_by') + def test_get_by_name_called_once(self, mock_get_by): + hypervisor_managers = [{'name': 'test name', 'id': 1}, {'name': 'test name', 'id': 2}] + mock_get_by.return_value = hypervisor_managers + result = self._hypervisor_managers.get_by_name("test name") + mock_get_by.assert_called_once_with("name", "test name") + self.assertEqual(result, {'name': 'test name', 'id': 1}) + + @mock.patch.object(ResourceClient, 'update') + def test_update_called_once_with_default(self, mock_update): + hypervisor_manager = { + "id": "4b4b87e2-eea8-4c90-8eca-b92eaaeecfff", + "name": "HypervisorManager" + } + self._hypervisor_managers.update(hypervisor_manager) + mock_update.assert_called_once_with(hypervisor_manager, force=False, timeout=-1) + + @mock.patch.object(ResourceClient, 'update') + def test_update_called_once(self, mock_update): + hypervisor_manager = { + "id": "4b4b87e2-eea8-4c90-8eca-b92eaaeecfff", + "name": "HypervisorManager" + } + self._hypervisor_managers.update(hypervisor_manager, True, 70) + mock_update.assert_called_once_with(hypervisor_manager, force=True, timeout=70) + + @mock.patch.object(ResourceClient, 'delete') + def test_delete_called_once(self, mock_delete): + uri = '/rest/hypervisor-managers/ad28cf21-8b15-4f92-bdcf-51cb2042db32' + self._hypervisor_managers.delete(uri, force=True, timeout=50) + mock_delete.assert_called_once_with(uri, force=True, timeout=50) + + @mock.patch.object(ResourceClient, 'delete') + def test_delete_called_once_with_defaults(self, mock_delete): + id = 'ad28cf21-8b15-4f92-bdcf-51cb2042db32' + self._hypervisor_managers.delete(id) + mock_delete.assert_called_once_with(id, force=False, timeout=-1) From dd424cb04675ba0885aae4da684a400a1a845877 Mon Sep 17 00:00:00 2001 From: VenkateshRavula Date: Tue, 7 Apr 2020 16:24:58 +0530 Subject: [PATCH 2/8] Added Unit Test for oneview client --- tests/unit/test_oneview_client.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/unit/test_oneview_client.py b/tests/unit/test_oneview_client.py index 5428ab603..a6dbf0d65 100755 --- a/tests/unit/test_oneview_client.py +++ b/tests/unit/test_oneview_client.py @@ -79,6 +79,7 @@ from hpOneView.resources.settings.versions import Versions from tests.test_utils import mock_builtin from hpOneView.resources.settings.licenses import Licenses +from hpOneView.resources.hypervisors.hypervisor_managers import HypervisorManagers OS_ENVIRON_CONFIG_MINIMAL = { 'ONEVIEWSDK_IP': '172.16.100.199', @@ -922,3 +923,10 @@ def test_should_get_appliance_current_version_and_minimum_version(self): def test_lazy_loading_appliance_version_information(self): versions = self._oneview.versions self.assertEqual(versions, self._oneview.versions) + + def test_hypervisor_managers_has_right_type(self): + self.assertIsInstance(self._oneview.hypervisor_managers, HypervisorManagers) + + def test_lazy_loading_hypervisor_managers(self): + hypervisor_managers = self._oneview.hypervisor_managers + self.assertEqual(hypervisor_managers, self._oneview.hypervisor_managers) From d9b4f841b676ab312c0b9e2319b985115a6dcdb8 Mon Sep 17 00:00:00 2001 From: VenkateshRavula Date: Thu, 9 Apr 2020 14:43:03 +0530 Subject: [PATCH 3/8] Refactored Hypervisor Manager code with latest changes --- CHANGELOG.md | 9 +- examples/hypervisor_managers.py | 79 +++++----- hpOneView/oneview_client.py | 4 +- .../hypervisors/hypervisor_managers.py | 136 ++++-------------- .../hypervisors/test_hypervisor_managers.py | 127 ++++++++-------- tests/unit/test_oneview_client.py | 2 +- 6 files changed, 141 insertions(+), 216 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 768dae439..4f3958421 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,4 +68,11 @@ Extends support of the SDK to OneView REST API version 1200 (OneView v5.00). - Storage volume template - Switch type - Uplink set -- Hypervisor managers + + +# 5.1.0 (unreleased version) +#### Notes +Provides SDK support to OneView REST API version 800, 1000 and 1200 (OneView v5.10). + +#### New Resource +- Hypervisor Managers diff --git a/examples/hypervisor_managers.py b/examples/hypervisor_managers.py index b8131c9b8..334e7fead 100644 --- a/examples/hypervisor_managers.py +++ b/examples/hypervisor_managers.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ### -# (C) Copyright [2019] 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. @@ -15,6 +15,8 @@ # limitations under the License. ### +from pprint import pprint + from config_loader import try_load_from_file from hpOneView.oneview_client import OneViewClient @@ -26,7 +28,7 @@ } } -hypervisor_manager_information = { +options = { "type": "HypervisorManagerV2", "name": "172.18.13.11", "displayName": "vcenter", @@ -39,44 +41,53 @@ # Try load config from a file (if there is a config file) config = try_load_from_file(config) oneview_client = OneViewClient.config() +hypervisor_managers = oneview_client.hypervisor_managers -# Add a hypervisor manager -hypervisor_manager_added = oneview_client.hypervisor_managers.add(hypervisor_manager_information) -print('Added hypervisor manager "{name}" successfully\n'.format(**hypervisor_manager_added)) +# Find recently created hypervisor manager by name +print("\nGet Hypervisor Manager by name") +hypervisor_manager = hypervisor_managers.get_by_name(options['name']) -# Retrieve hypervisor manager by URI -hypervisor_manager = oneview_client.hypervisor_managers.get(hypervisor_manager_added['uri']) -print('Get hypervisor manager by URI "{uri}", retrieved "{name}" successfully\n'.format(**hypervisor_manager)) +if hypervisor_manager: + print("\nFound hypervisor-manager by name: {}.\n uri = {}".format(hypervisor_manager.data['name'], hypervisor_manager.data['uri'])) +else: + # Create a HypervisorManager with the options provided + hypervisor_manager = hypervisor_managers.create(data=options) + print("\nCreated a hypervisor-manager with name: {}.\n uri = {}".format(hypervisor_manager.data['name'], hypervisor_manager.data['uri'])) -# Retrieve hypervisor manager by FILTER -hypervisor_manager_list = oneview_client.hypervisor_managers.get_by('hypervisorType', 'Vmware') -print('Get hypervisor manager by FILTER "{hypervisorType}", retrieved "{name}" successfully\n'.format(**hypervisor_manager_list[0])) +# Get all, with defaults +print("\nGet all hypervisor managers") +hyp_managers_all = hypervisor_manager.get_all() +for hyp in hyp_managers_all: + print(' - {}'.format(hyp['name'])) -# Update the hypervisor manager -hypervisor_manager['displayName'] = "New hypervisor" -hypervisor_manager = oneview_client.hypervisor_managers.update(hypervisor_manager) -print('Hypervisor manager "{displayName}" updated successfully\n'.format(**hypervisor_manager)) +# Get the first 10 records +print("\nGet the first ten hypervisor managers") +hyp_mgrs_top_ten = hypervisor_managers.get_all(0, 10) +for hyp in hyp_mgrs_top_ten: + print(' - {}'.format(hyp['name'])) -# Retrieve hypervisor manager by NAME -hypervisor_manager = oneview_client.hypervisor_managers.get_by_name(hypervisor_manager['name']) -print('Get hypervisor manager by NAME "{name}", retrieved "{uri}" successfully\n'.format(**hypervisor_manager)) +# Filter by hypervisor type +print("\nGet all hypervisor managers filtering by hypervisor type") +hyp_mgrs_filtered = hypervisor_managers.get_all(filter="\"'hypervisorType'='Vmware'\"") +for hyp in hyp_mgrs_filtered: + print("Hypervisor with type 'Vmware' - {}".format(hyp['name'])) -# Update the hypervisor manager forcefully -hypervisor_manager['displayName'] = "Update hypervisor force" -hypervisor_manager = oneview_client.hypervisor_managers.update(hypervisor_manager, force=True) -print('Hypervisor manager "{displayName}" updated forcefully\n'.format(**hypervisor_manager)) +# Get all sorting by name descending +print("\nGet all hypervisor managers sorting by name") +hyp_mgrs_sorted = hypervisor_managers.get_all(sort='name:descending') +pprint(hyp_mgrs_sorted) -# Get all hypervisor managers -print("Get all hypervisor managers:") -hypervisor_manager_all = oneview_client.hypervisor_managers.get_all() -for hyp_mgr in hypervisor_manager_all: - print(" - " + hyp_mgr['name']) +# Get by uri +print("\nGet a hypervisor managers by uri") +hyp_mgrs_by_uri = hypervisor_managers.get_by_uri(hypervisor_manager.data['uri']) +pprint(hyp_mgrs_by_uri.data) -# Remove added hypervisor manager -oneview_client.hypervisor_managers.delete(hypervisor_manager) -print('Successfully removed the hypervisor manager "{name}"\n'.format(**hypervisor_manager)) +# Update display name of recently created hypervisor manager +data_to_update = {'displayName': 'Updated vcenter'} +hypervisor_manager.update(data=data_to_update) +print("\nUpdated hypervisor manager {} successfully.\n uri = {}".format(hypervisor_manager.data['name'], hypervisor_manager.data['uri'])) +print(" with attribute 'displayName': {}".format(hypervisor_manager.data['displayName'])) -# Add another hypervisor manager and remove forcefully -hypervisor_manager_added = oneview_client.hypervisor_managers.add(hypervisor_manager_information) -oneview_client.hypervisor_managers.delete(hypervisor_manager_added, force=True) -print("Successfully added and removed the hypervisor manager forcefully") +# Delete the created hypervisor manager +hypervisor_manager.delete() +print("\nSuccessfully deleted hypervisor manager") diff --git a/hpOneView/oneview_client.py b/hpOneView/oneview_client.py index d1669f76b..163b39830 100755 --- a/hpOneView/oneview_client.py +++ b/hpOneView/oneview_client.py @@ -1182,6 +1182,4 @@ def hypervisor_managers(self): Returns: HypervisorManagers """ - if not self.__hypervisor_managers: - self.__hypervisor_managers = HypervisorManagers(self.__connection) - return self.__hypervisor_managers + return HypervisorManagers(self.__connection) diff --git a/hpOneView/resources/hypervisors/hypervisor_managers.py b/hpOneView/resources/hypervisors/hypervisor_managers.py index c67ed380c..03dc8ecdd 100755 --- a/hpOneView/resources/hypervisors/hypervisor_managers.py +++ b/hpOneView/resources/hypervisors/hypervisor_managers.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ### -# (C) Copyright [2019] 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. @@ -21,19 +21,31 @@ from __future__ import unicode_literals from future import standard_library +from copy import deepcopy + standard_library.install_aliases() -from hpOneView.resources.resource import ResourceClient + +from hpOneView.resources.resource import Resource, ResourcePatchMixin -class HypervisorManagers(object): +class HypervisorManagers(ResourcePatchMixin, Resource): + """ + Hypervisor Managers API client. + + """ URI = '/rest/hypervisor-managers' - def __init__(self, con): - self._connection = con - self._client = ResourceClient(con, self.URI) + DEFAULT_VALUES = { + '800': {"type": "HypervisorManagerV2"}, + '1000': {"type": "HypervisorManagerV2"}, + '1200': {"type": "HypervisorManagerV2"} + } + + def __init__(self, connection, data=None): + super(HypervisorManagers, self).__init__(connection, data) - def get_all(self, start=0, count=-1, filter='', fields='', query='', sort='', view='', scope_uris=''): + def get_all(self, start=0, count=-1, filter='', sort='', query='', scope_uris=''): """ Gets a list of Hypervisor Managers based on optional sorting and filtering, and constrained by start and count parameters. @@ -49,117 +61,17 @@ def get_all(self, start=0, count=-1, filter='', fields='', query='', sort='', vi filter (list or str): A general filter/query string to narrow the list of items returned. The default is no filter; all resources are returned. - fields: - Specifies which fields should be returned in the result set. - query: - A general query string to narrow the list of resources returned. The default - is no query - all resources are returned. sort: The sort order of the returned data set. By default, the sort order is based on create time with the oldest entry first. - view: - Return a specific subset of the attributes of the resource or collection, by - specifying the name of a predefined view. The default view is expand - show all - attributes of the resource and all elements of collections of resources. + query: + A general query string to narrow the list of resources returned. The default + is no query - all resources are returned. scope_uris: An expression to restrict the resources returned according to the scopes to which they are assigned. Returns: - list: Hypervisor Managers + list: List of Hypervisor Managers """ - return self._client.get_all(start, count, filter=filter, sort=sort, query=query, fields=fields, view=view, scope_uris=scope_uris) - - def get(self, id_or_uri): - """ - Get the details of the particular Hypervisor Manager based on its URI or ID. - - Args: - id_or_uri: - Can be either the Hypervisor Manager ID or the URI - - Returns: - dict: Hypervisor Manager - """ - return self._client.get(id_or_uri) - - def get_by(self, field, value): - """ - Gets all hypervisor managers that match the filter - The search is case-insensitive - - Args: - field: field name to filter - value: value to filter - - Returns: - dict: hypervisor managers - """ - return self._client.get_by(field, value) - - def get_by_name(self, name): - """ - Gets the Hypervisor Manager by name. - - Args: - name: Name of the Hypervisor Manager - - Returns: - dict: Hypervisor Manager - """ - return self._client.get_by_name(name) - - def add(self, resource, timeout=-1): - """ - Adds a Hypervisor Manager using the information provided in the request body. - - Args: - resource (dict): - Hypervisor Manager resource. - timeout: - Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation - in OneView, just stop waiting for its completion. - - Returns: - dict: The added resource. - """ - return self._client.create(resource, timeout=timeout) - - def update(self, resource, force=False, timeout=-1): - """ - Updates the Hypervisor Manager resource. The properties that are omitted (not included as part - of the request body) are ignored. - - Args: - resource (dict): Object to update. - force: - If set to true, the operation completes despite any problems with network connectivity or errors on - the resource itself. The default is false. - timeout: - Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation - in OneView, just stops waiting for its completion. - - Returns: - Updated resource. - """ - return self._client.update(resource, timeout=timeout, force=force) - - def delete(self, resource, force=False, timeout=-1): - """ - Deletes a Hypervisor Manager object based on its UUID or URI. - - Args: - resource (dict): - Object to delete. - force: - If set to true, the operation completes despite any problems with - network connectivity or errors on the resource itself. The default is false. - timeout: - Timeout in seconds. Wait for task completion by default. The timeout does not abort the operation - in OneView; it just stops waiting for its completion. - - Returns: - bool: Indicates if the hypervisor was successfully deleted. - """ - - return self._client.delete(resource, force=force, timeout=timeout) + return self._helper.get_all(start, count, filter=filter, sort=sort, query=query, scope_uris=scope_uris) diff --git a/tests/unit/resources/hypervisors/test_hypervisor_managers.py b/tests/unit/resources/hypervisors/test_hypervisor_managers.py index 60ff2e6ee..a1b0e44ca 100644 --- a/tests/unit/resources/hypervisors/test_hypervisor_managers.py +++ b/tests/unit/resources/hypervisors/test_hypervisor_managers.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ### -# (C) Copyright [2019] 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. @@ -16,21 +16,26 @@ ### from unittest import TestCase +from pprint import pprint import mock from hpOneView.connection import connection from hpOneView.resources.hypervisors.hypervisor_managers import HypervisorManagers -from hpOneView.resources.resource import ResourceClient +from hpOneView.resources.resource import Resource, ResourceHelper class HypervisorManagersTest(TestCase): + RESOURCE_ID = "81decf85-0dff-4a5e-8a95-52994eeb6493" + def setUp(self): self.host = '127.0.0.1' self.connection = connection(self.host) self._hypervisor_managers = HypervisorManagers(self.connection) + self.uri = "/rest/hypervisor-managers/f0a0a113-ec97-41b4-83ce-d7c92b900e7c" + self._hypervisor_managers.data = {"uri": self.uri} - @mock.patch.object(ResourceClient, 'create') + @mock.patch.object(Resource, 'create') def test_create_called_once(self, mock_create): resource = dict( type="HypervisorManagerV2", @@ -39,13 +44,16 @@ def test_create_called_once(self, mock_create): hypervisorType="Vmware", username="dcs", password="dcs", - initialScopeUris=[] + initialScopeUris=[], ) + + resource_rest_call = resource.copy() mock_create.return_value = {} - self._hypervisor_managers.add(resource, 70) - mock_create.assert_called_once_with(resource.copy(), timeout=70) - @mock.patch.object(ResourceClient, 'create') + self._hypervisor_managers.create(resource, timeout=70) + mock_create.assert_called_once_with(resource_rest_call, timeout=70) + + @mock.patch.object(Resource, 'create') def test_add_called_once_with_defaults(self, mock_create): resource = dict( type="HypervisorManagerV2", @@ -56,39 +64,35 @@ def test_add_called_once_with_defaults(self, mock_create): password="dcs", initialScopeUris=[], ) - self._hypervisor_managers.add(resource) - mock_create.assert_called_once_with(resource.copy(), timeout=-1) - @mock.patch.object(ResourceClient, 'get_all') + resource_rest_call = resource.copy() + mock_create.return_value = {} + + self._hypervisor_managers.create(resource) + mock_create.assert_called_once_with(resource_rest_call) + + @mock.patch.object(ResourceHelper, 'get_all') def test_get_all_called_once(self, mock_get_all): filter = 'name=TestName' sort = 'name:ascending' - fields = 'name' - view = 'expand' query = 'query' scope_uris = 'rest/scopes/cd237b60-09e2-45c4-829e-082e318a6d2a' - self._hypervisor_managers.get_all(2, 500, filter=filter, sort=sort, fields=fields, view=view, query=query, scope_uris=scope_uris) - mock_get_all.assert_called_once_with(2, 500, filter=filter, sort=sort, fields=fields, view=view, query=query, scope_uris=scope_uris) + self._hypervisor_managers.get_all(2, 500, filter=filter, sort=sort, query=query, scope_uris=scope_uris) + mock_get_all.assert_called_once_with(2, 500, filter=filter, sort=sort, query=query, scope_uris=scope_uris) - @mock.patch.object(ResourceClient, 'get_all') + @mock.patch.object(ResourceHelper, 'get_all') def test_get_all_called_once_with_default(self, mock_get_all): self._hypervisor_managers.get_all() - mock_get_all.assert_called_once_with(0, -1, filter='', sort='', fields='', view='', query='', scope_uris='') + mock_get_all.assert_called_once_with(0, -1, filter='', sort='', query='', scope_uris='') - @mock.patch.object(ResourceClient, 'get') - def test_get_by_id_called_once(self, mock_get): + @mock.patch.object(Resource, 'get_by_uri') + def test_get_by_uri_called_once(self, mock_get_by_uri): uri = "/rest/hypervisor-managers/f0a0a113-ec97-41b4-83ce-d7c92b900e7c" - self._hypervisor_managers.get(uri) - mock_get.assert_called_once_with(uri) - - @mock.patch.object(ResourceClient, 'get') - def test_get_by_uri_called_once(self, mock_get): - id = "f0a0a113-ec97-41b4-83ce-d7c92b900e7c" - self._hypervisor_managers.get(id) - mock_get.assert_called_once_with(id) + self._hypervisor_managers.get_by_uri(uri) + mock_get_by_uri.assert_called_once_with(uri) - @mock.patch.object(ResourceClient, 'get_by') + @mock.patch.object(Resource, 'get_by') def test_get_by_called_once(self, mock_get_by): hypervisor_managers = [{'name': 'name1', 'displayName': 'display1'}, {'name': 'name2', 'displayName': 'display2'}] mock_get_by.return_value = hypervisor_managers @@ -96,47 +100,40 @@ def test_get_by_called_once(self, mock_get_by): mock_get_by.assert_called_once_with("displayName", "display1") self.assertEqual(result, hypervisor_managers) - @mock.patch.object(ResourceClient, 'get_by') - def test_get_by_name_should_return_none_when_resource_is_not_found(self, mock_get_by): - mock_get_by.return_value = [] - response = self._hypervisor_managers.get_by_name("test") - mock_get_by.assert_called_once_with("name", "test") - self.assertEqual(response, None) - - @mock.patch.object(ResourceClient, 'get_by') + @mock.patch.object(Resource, 'get_by') def test_get_by_name_called_once(self, mock_get_by): - hypervisor_managers = [{'name': 'test name', 'id': 1}, {'name': 'test name', 'id': 2}] + hypervisor_managers = [{'name': 'test name1', 'id': 1}, {'name': 'test name2', 'id': 2}] mock_get_by.return_value = hypervisor_managers - result = self._hypervisor_managers.get_by_name("test name") - mock_get_by.assert_called_once_with("name", "test name") - self.assertEqual(result, {'name': 'test name', 'id': 1}) - - @mock.patch.object(ResourceClient, 'update') - def test_update_called_once_with_default(self, mock_update): - hypervisor_manager = { - "id": "4b4b87e2-eea8-4c90-8eca-b92eaaeecfff", - "name": "HypervisorManager" + result = self._hypervisor_managers.get_by_name("test name1") + mock_get_by.assert_called_once_with("name", "test name1") + self.assertEqual(result.data['id'], 1) + + @mock.patch.object(Resource, 'ensure_resource_data') + @mock.patch.object(ResourceHelper, 'update') + def test_update_called_once_with_default(self, mock_update, mock_ensure_client): + resource = { + "name": "HypervisorManagerNew", + "uri": self.uri } - self._hypervisor_managers.update(hypervisor_manager) - mock_update.assert_called_once_with(hypervisor_manager, force=False, timeout=-1) - - @mock.patch.object(ResourceClient, 'update') - def test_update_called_once(self, mock_update): - hypervisor_manager = { - "id": "4b4b87e2-eea8-4c90-8eca-b92eaaeecfff", - "name": "HypervisorManager" + self._hypervisor_managers.update(resource) + mock_update.assert_called_once_with(resource, self.uri, False, -1, None) + + @mock.patch.object(Resource, 'ensure_resource_data') + @mock.patch.object(ResourceHelper, 'update') + def test_update_called_once(self, mock_update, mock_ensure_client): + resource = { + "uri": self.uri, + "name": "NewHypervisorManager" } - self._hypervisor_managers.update(hypervisor_manager, True, 70) - mock_update.assert_called_once_with(hypervisor_manager, force=True, timeout=70) + self._hypervisor_managers.update(resource, 70) + mock_update.assert_called_once_with(resource, self.uri, False, 70, None) - @mock.patch.object(ResourceClient, 'delete') + @mock.patch.object(ResourceHelper, 'delete') def test_delete_called_once(self, mock_delete): - uri = '/rest/hypervisor-managers/ad28cf21-8b15-4f92-bdcf-51cb2042db32' - self._hypervisor_managers.delete(uri, force=True, timeout=50) - mock_delete.assert_called_once_with(uri, force=True, timeout=50) - - @mock.patch.object(ResourceClient, 'delete') - def test_delete_called_once_with_defaults(self, mock_delete): - id = 'ad28cf21-8b15-4f92-bdcf-51cb2042db32' - self._hypervisor_managers.delete(id) - mock_delete.assert_called_once_with(id, force=False, timeout=-1) + self._hypervisor_managers.delete(force=False) + mock_delete.assert_called_once_with(self.uri, custom_headers=None, force=False, timeout=-1) + + @mock.patch.object(ResourceHelper, 'delete') + def test_delete_called_once_with_force(self, mock_delete): + self._hypervisor_managers.delete(force=True) + mock_delete.assert_called_once_with(self.uri, custom_headers=None, force=True, timeout=-1) diff --git a/tests/unit/test_oneview_client.py b/tests/unit/test_oneview_client.py index a6dbf0d65..8799573be 100755 --- a/tests/unit/test_oneview_client.py +++ b/tests/unit/test_oneview_client.py @@ -929,4 +929,4 @@ def test_hypervisor_managers_has_right_type(self): def test_lazy_loading_hypervisor_managers(self): hypervisor_managers = self._oneview.hypervisor_managers - self.assertEqual(hypervisor_managers, self._oneview.hypervisor_managers) + self.assertNotEqual(hypervisor_managers, self._oneview.hypervisor_managers) From 9e6275079cba829000d062a178f6d870118c54ae Mon Sep 17 00:00:00 2001 From: VenkateshRavula Date: Thu, 9 Apr 2020 16:45:02 +0530 Subject: [PATCH 4/8] Resolved build check errors --- hpOneView/resources/hypervisors/hypervisor_managers.py | 2 -- tests/unit/resources/hypervisors/test_hypervisor_managers.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/hpOneView/resources/hypervisors/hypervisor_managers.py b/hpOneView/resources/hypervisors/hypervisor_managers.py index 03dc8ecdd..a8fbb9b70 100755 --- a/hpOneView/resources/hypervisors/hypervisor_managers.py +++ b/hpOneView/resources/hypervisors/hypervisor_managers.py @@ -21,8 +21,6 @@ from __future__ import unicode_literals from future import standard_library -from copy import deepcopy - standard_library.install_aliases() diff --git a/tests/unit/resources/hypervisors/test_hypervisor_managers.py b/tests/unit/resources/hypervisors/test_hypervisor_managers.py index a1b0e44ca..7380c13b4 100644 --- a/tests/unit/resources/hypervisors/test_hypervisor_managers.py +++ b/tests/unit/resources/hypervisors/test_hypervisor_managers.py @@ -16,7 +16,6 @@ ### from unittest import TestCase -from pprint import pprint import mock @@ -26,7 +25,6 @@ class HypervisorManagersTest(TestCase): - RESOURCE_ID = "81decf85-0dff-4a5e-8a95-52994eeb6493" def setUp(self): self.host = '127.0.0.1' From 6f6361dfb9f7e9cad9eb07dc41000332e13af7cc Mon Sep 17 00:00:00 2001 From: VenkateshRavula Date: Mon, 13 Apr 2020 13:21:02 +0530 Subject: [PATCH 5/8] modified change log file --- CHANGELOG.md | 15 +++++++-------- examples/hypervisor_managers.py | 2 +- .../resources/hypervisors/hypervisor_managers.py | 4 ++-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f3958421..daa037c0d 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# 5.1.0 (unreleased version) +#### Notes +Provides SDK support to OneView REST API version 800, 1000 and 1200 (OneView v5.10). + +#### New Resource +- Hypervisor Managers + # 5.0.0 #### Notes Extends support of the SDK to OneView REST API version 1200 (OneView v5.00). @@ -68,11 +75,3 @@ Extends support of the SDK to OneView REST API version 1200 (OneView v5.00). - Storage volume template - Switch type - Uplink set - - -# 5.1.0 (unreleased version) -#### Notes -Provides SDK support to OneView REST API version 800, 1000 and 1200 (OneView v5.10). - -#### New Resource -- Hypervisor Managers diff --git a/examples/hypervisor_managers.py b/examples/hypervisor_managers.py index 334e7fead..9e827d578 100644 --- a/examples/hypervisor_managers.py +++ b/examples/hypervisor_managers.py @@ -56,7 +56,7 @@ # Get all, with defaults print("\nGet all hypervisor managers") -hyp_managers_all = hypervisor_manager.get_all() +hyp_managers_all = hypervisor_managers.get_all() for hyp in hyp_managers_all: print(' - {}'.format(hyp['name'])) diff --git a/hpOneView/resources/hypervisors/hypervisor_managers.py b/hpOneView/resources/hypervisors/hypervisor_managers.py index a8fbb9b70..a653e22b1 100755 --- a/hpOneView/resources/hypervisors/hypervisor_managers.py +++ b/hpOneView/resources/hypervisors/hypervisor_managers.py @@ -24,10 +24,10 @@ standard_library.install_aliases() -from hpOneView.resources.resource import Resource, ResourcePatchMixin +from hpOneView.resources.resource import Resource -class HypervisorManagers(ResourcePatchMixin, Resource): +class HypervisorManagers(Resource): """ Hypervisor Managers API client. From 5d11e03ac2058f7d2035ae9c46da30fed1533d30 Mon Sep 17 00:00:00 2001 From: VenkateshRavula Date: Mon, 13 Apr 2020 14:18:26 +0530 Subject: [PATCH 6/8] Re-arranged endpoints in alphabetical order --- endpoints-support.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/endpoints-support.md b/endpoints-support.md index ccffa677c..f81dad0a2 100755 --- a/endpoints-support.md +++ b/endpoints-support.md @@ -73,6 +73,12 @@ |/rest/fcoe-networks/{id} | PATCH | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | |/rest/fcoe-networks/{id} | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: | |/rest/fcoe-networks/{id} | DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| **Hypervisor Managers** +|/rest/hypervisor-managers |POST | :white_check_mark: | :white_check_mark: | :white_check_mark: | +|/rest/hypervisor-managers |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | +|/rest/hypervisor-managers/{id} |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | +|/rest/hypervisor-managers/{id} |PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: | +|/rest/hypervisor-managers/{id} |DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: | | **Interconnects** |/rest/interconnects | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | |/rest/interconnects/{id} | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | @@ -306,13 +312,6 @@ |/rest/storage-volumes/{id}/snapshots | POST | :white_check_mark: | :white_check_mark: | :white_check_mark: | |/rest/storage-volumes/{id}/snapshots/{snapshotId} | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | |/rest/storage-volumes/{id}/snapshots/{snapshotId} | DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| **Hypervisor Managers** -|/rest/hypervisor-managers |POST | :white_check_mark: | :white_check_mark: | :white_check_mark: | -|/rest/hypervisor-managers |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | -|/rest/hypervisor-managers/{id} |GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | -|/rest/hypervisor-managers/{id} |PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: | -|/rest/hypervisor-managers/{id} |DELETE | :white_check_mark: | :white_check_mark: | :white_check_mark: | - ## HPE Synergy Image Streamer From a4546480ff716574e3ee5e6f3d5d9e19f308fc68 Mon Sep 17 00:00:00 2001 From: VenkateshRavula Date: Mon, 13 Apr 2020 16:46:50 +0530 Subject: [PATCH 7/8] Modified the oneview release version --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index daa037c0d..f45fb9643 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ -# 5.1.0 (unreleased version) +# 5.11.0 (unreleased version) #### Notes -Provides SDK support to OneView REST API version 800, 1000 and 1200 (OneView v5.10). +Extends support of the SDK to OneView REST API version 800, 1000 and 1200. -#### New Resource +#### Features supported - Hypervisor Managers # 5.0.0 From df62e133b3b0734bfa1e47f4c4d2a8fcc1174337 Mon Sep 17 00:00:00 2001 From: VenkateshRavula Date: Mon, 13 Apr 2020 17:49:32 +0530 Subject: [PATCH 8/8] corrected oneview release version --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f45fb9643..5a8c04b90 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 5.11.0 (unreleased version) +# 5.1.0 (unreleased version) #### Notes Extends support of the SDK to OneView REST API version 800, 1000 and 1200.