Repository: HewlettPackard/oneview-python

Issue:
In correct endpoint passed when uploading a downloaded appliance backup
The library uses the URI `/rest/backups` instead of `/rest/backups/archive` resulting in **HPOneViewExection** being raised. This is expected due to an internal error.

Discussion:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b0c6e05b..cc1d1195 100755
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@
 Added code to handle login acknowledgement.
 
 #### Bug fixes & Enhancements
+- #21 In correct endpoint passed when uploading a downloaded appliance backup
 - #58 loginMsgAck is not handled in python code
 - #60 SPT type for api1600 should be ServerProfileTemplateV8
 
diff --git a/hpOneView/resources/settings/backups.py b/hpOneView/resources/settings/backups.py
index b3d87b6f..950031fc 100644
--- a/hpOneView/resources/settings/backups.py
+++ b/hpOneView/resources/settings/backups.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.
@@ -102,7 +102,7 @@ class Backups(object):
         Returns:
             dict: Details of the uploaded backup.
         """
-        return self._client.upload(file_path)
+        return self._client.upload(file_path, self.URI + '/archive')
 
     def get_config(self):
         """


Test patch:
diff --git a/tests/unit/resources/settings/test_backups.py b/tests/unit/resources/settings/test_backups.py
index 7d8042e0..3c815df4 100644
--- a/tests/unit/resources/settings/test_backups.py
+++ b/tests/unit/resources/settings/test_backups.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.
@@ -73,7 +73,7 @@ class BackupsTest(TestCase):
 
         self._client.upload(filepath)
 
-        mock_upload.assert_called_once_with(filepath)
+        mock_upload.assert_called_once_with(filepath, '/rest/backups/archive')
 
     @mock.patch.object(ResourceClient, 'get')
     def test_get_config_called_once(self, mock_get):