PyU4V 10.2.0.2__tar.gz → 10.3.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. pyu4v-10.3.0.0/LICENSE +174 -0
  2. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PKG-INFO +9 -8
  3. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/__init__.py +3 -2
  4. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/common.py +4 -1
  5. pyu4v-10.3.0.0/PyU4V/enhanced_api.py +112 -0
  6. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/metro_dr.py +11 -10
  7. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/performance.py +26 -12
  8. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/performance_enhanced.py +19 -2
  9. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/replication.py +13 -4
  10. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/rest_requests.py +2 -11
  11. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/scripts/replace_version.py +1 -0
  12. pyu4v-10.3.0.0/PyU4V/settings.py +733 -0
  13. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/system.py +18 -0
  14. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/tools/generate_functions.py +5 -4
  15. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/univmax_conn.py +5 -0
  16. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/utils/constants.py +4 -4
  17. pyu4v-10.3.0.0/PyU4V/version.py +6 -0
  18. pyu4v-10.3.0.0/PyU4V/workload_planner.py +42 -0
  19. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/README.rst +7 -7
  20. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/pyu4v.egg-info/PKG-INFO +9 -8
  21. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/pyu4v.egg-info/SOURCES.txt +3 -0
  22. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/setup.py +1 -1
  23. pyu4v-10.2.0.2/PyU4V/version.py +0 -6
  24. pyu4v-10.2.0.2/PyU4V/workload_planner.py +0 -102
  25. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/clone.py +0 -0
  26. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/migration.py +0 -0
  27. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/provisioning.py +0 -0
  28. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/real_time.py +0 -0
  29. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/scripts/__init__.py +0 -0
  30. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/serviceability.py +0 -0
  31. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/snapshot_policy.py +0 -0
  32. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/storage_groups.py +0 -0
  33. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/tools/__init__.py +0 -0
  34. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/tools/openstack/__init__.py +0 -0
  35. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/tools/openstack/migrate.py +0 -0
  36. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/tools/openstack/migrate_utils.py +0 -0
  37. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/utils/__init__.py +0 -0
  38. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/utils/config_handler.py +0 -0
  39. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/utils/console.py +0 -0
  40. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/utils/decorators.py +0 -0
  41. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/utils/exception.py +0 -0
  42. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/utils/file_handler.py +0 -0
  43. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/utils/performance_category_map.py +0 -0
  44. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/utils/performance_constants.py +0 -0
  45. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/utils/time_handler.py +0 -0
  46. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/utils/utils.py +0 -0
  47. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/PyU4V/volumes.py +0 -0
  48. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/pyu4v.egg-info/dependency_links.txt +0 -0
  49. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/pyu4v.egg-info/requires.txt +1 -1
  50. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/pyu4v.egg-info/top_level.txt +0 -0
  51. {pyu4v-10.2.0.2 → pyu4v-10.3.0.0}/setup.cfg +0 -0
pyu4v-10.3.0.0/LICENSE ADDED
@@ -0,0 +1,174 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyu4v
3
- Version: 10.2.0.2
3
+ Version: 10.3.0.0
4
4
  Summary: A Python library for use with Dell EMC's Unisphere for PowerMax REST API.
5
5
  Home-page: https://github.com/dell/PyU4V/
6
6
  Author: Dell Inc. or its subsidiaries
7
7
  Author-email: paule.martin@dell.com
8
8
  License: Apache 2.0
9
- Description: Welcome to PyU4V 10.2
9
+ Description: Welcome to PyU4V 10.3
10
10
  =====================
11
11
 
12
12
  | |Maintenance| |OpenSource| |AskUs| |License| |Test| |Build| |Docs|
@@ -28,15 +28,15 @@ Description: Welcome to PyU4V 10.2
28
28
  where ``{ip-address}`` is the IP address of your Unisphere server and
29
29
  ``{port}`` is the port it is listening on.
30
30
 
31
- PyU4V Version 10.2
31
+ PyU4V Version 10.3
32
32
  ------------------
33
33
 
34
34
  +-------------------------------+----------------------------+
35
35
  | **Author** | Dell EMC |
36
36
  +-------------------------------+----------------------------+
37
- | **PyU4V Version** | 10.2.0.2 |
37
+ | **PyU4V Version** | 10.3.0.0 |
38
38
  +-------------------------------+----------------------------+
39
- | **Minimum Unisphere Version** | 10.2.0 |
39
+ | **Minimum Unisphere Version** | 10.3.0 |
40
40
  +-------------------------------+----------------------------+
41
41
  | **Array Model** | VMAX-3, VMAX AFA, PowerMax |
42
42
  +-------------------------------+----------------------------+
@@ -44,7 +44,7 @@ Description: Welcome to PyU4V 10.2
44
44
  +-------------------------------+----------------------------+
45
45
  | **Platforms** | Linux, Windows |
46
46
  +-------------------------------+----------------------------+
47
- | **Python** | 3.6, 3.7, 3.8, 3.9 |
47
+ | **Python** | 3.6 - 3.12 |
48
48
  +-------------------------------+----------------------------+
49
49
  | **Requires** | Requests_, Six_, urllib3_ |
50
50
  +-------------------------------+----------------------------+
@@ -55,7 +55,7 @@ Description: Welcome to PyU4V 10.2
55
55
  version of Unisphere older than 9.1.x
56
56
 
57
57
  Note
58
- PyU4V version 10.2 is compatible with scripts written for PyU4V versions
58
+ PyU4V version 10.3 is compatible with scripts written for PyU4V versions
59
59
  >= 9.2. Please ensure to check change log to ensure that you are not
60
60
  using functions that have been marked as depreciated.
61
61
 
@@ -171,7 +171,7 @@ Description: Welcome to PyU4V 10.2
171
171
 
172
172
  conn = PyU4V.U4VConn()
173
173
  conn.common.get_unisphere_version()
174
- >> {'version': '10.2.0.2'}
174
+ >> {'version': '10.3.0.0'}
175
175
 
176
176
  If you wish to query another array without changing the configuration file,
177
177
  call the connection ``set_array_id()`` function:
@@ -281,3 +281,4 @@ Classifier: Topic :: Internet :: WWW/HTTP
281
281
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
282
282
  Requires-Python: >=3.6, <4.0
283
283
  Description-Content-Type: text/x-rst
284
+ License-File: LICENSE
@@ -22,8 +22,9 @@
22
22
 
23
23
  from .univmax_conn import U4VConn # noqa: F401
24
24
  from . import version
25
+
25
26
  __title__ = 'pyu4v'
26
27
  __version__ = version.VERSION
27
- __author__ = 'Dell EMC or its subsidiaries'
28
+ __author__ = 'Dell Technologies'
28
29
  __license__ = 'Apache 2.0'
29
- __copyright__ = 'Copyright 2023 Dell EMC Inc'
30
+ __copyright__ = 'Copyright 2025 Dell Technologies'
@@ -166,6 +166,10 @@ class CommonFunctions(object):
166
166
  :param message: server response -- str
167
167
  :raises: VolumeBackendAPIException
168
168
  """
169
+ if status_code == None:
170
+ raise exception.VolumeBackendAPIException(
171
+ data="Server unavailable or IP incorrect")
172
+
169
173
  if status_code not in [STATUS_200, STATUS_201,
170
174
  STATUS_202, STATUS_204]:
171
175
  exception_message = (
@@ -176,7 +180,6 @@ class CommonFunctions(object):
176
180
  data=exception_message)
177
181
  if status_code == STATUS_401:
178
182
  raise exception.UnauthorizedRequestException()
179
-
180
183
  raise exception.VolumeBackendAPIException(
181
184
  data=exception_message)
182
185
 
@@ -0,0 +1,112 @@
1
+ # Copyright (c) 2023 Dell Inc. or its subsidiaries.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ """enhanced_api.py."""
15
+
16
+ import logging
17
+
18
+ from PyU4V.common import CommonFunctions
19
+ from PyU4V.utils import constants
20
+
21
+ LOG = logging.getLogger(__name__)
22
+
23
+
24
+ class EnhancedAPIFunctions(object):
25
+ """Enhanced Functions for retrieving data about provisioned storage
26
+ objects."""
27
+
28
+ def __init__(self, array_id, rest_client):
29
+ """__init__."""
30
+ self.common = CommonFunctions(rest_client)
31
+ self.get_resource = self.common.get_resource
32
+ self.array_id = array_id
33
+ self.enhanced_api_version = constants.ENHANCED_API_VERSION
34
+
35
+ def get_storage_object_meta_data(self, storage_object):
36
+ """Get details on available metadata for storage objects of the
37
+ specified type.
38
+
39
+ :param: storage_object, the storage object to get metadata for,
40
+ valid values are directors, hosts, initiators,
41
+ ip-interfaces, ip-routes, masking-views, port-groups, ports,
42
+ rdf-groups, storage-groups, volumes -- string
43
+ :returns: dictionary with list of attributes and descriptions of
44
+ attribute types used for filtering and selection -- dict
45
+ """
46
+ response = self.common.get_request(
47
+ target_uri=f"/{self.enhanced_api_version}/systems"
48
+ f"/{storage_object}/metadata",
49
+ resource_type=None)
50
+ return response
51
+
52
+ def get_storage_object_details(
53
+ self, storage_object, array_id=None, filters=None, select=None,
54
+ exclude=None):
55
+ """Get list of volumes from array with selected parameters.
56
+
57
+ :param: storage_object, the storage object to get metadata for,
58
+ valid values are directors, hosts, initiators,
59
+ ip-interfaces, ip-routes, masking-views, port-groups, ports,
60
+ rdf-groups, storage-groups, volumes -- string
61
+ :param array_id: The storage array ID -- string
62
+ :param filters: filter parameters, used to narrow down the result
63
+ list, filters can be any of the volume attributes,
64
+ and operators vary depending on type,
65
+ 'eq','ne','gt','ge','lt','le', equal, not equal,
66
+ greater than, greater than or equal, less than,
67
+ less than or equal, additional operators are
68
+ 'like','ilike' for string match, or case in-sensitive
69
+ string match, example
70
+ filters=['num_of_storage_groups eq 1',
71
+ 'identifier ilike findme'] -- list
72
+ :param select: selection of attributes to be in return, attributes
73
+ can be listed using get_volumes_meta_data function
74
+ If none selected base set of top level attributes are
75
+ returned, by default API will only return id,
76
+ to achieve this pass a list with empty string [''],
77
+ to extend the list of attributes returned to include
78
+ second level attributes you can pass along with list
79
+ from get_volumes_meta_data() e.g.
80
+ select=api.volumes.get_volumes_meta_data() +
81
+ ['snapshots.name'] -- list
82
+ :param exclude: list of attributes to exclude, by default rdf_infos
83
+ and snapshot details have been excluded as these can
84
+ extend the running of the API call, to override
85
+ simply pass an empty list or specify a list of
86
+ attribute names that you want to exclude from the
87
+ return, if values are passed in by select exclude is
88
+ ignored -- list
89
+ :returns: dict
90
+ """
91
+ array_id = array_id if array_id else self.array_id
92
+ if not exclude:
93
+ exclude = ['rdf_infos', 'snapshots']
94
+ if not select:
95
+ select = []
96
+ volume_metadata = self.get_storage_object_meta_data(
97
+ storage_object=storage_object)
98
+ for attribute in volume_metadata:
99
+ if attribute['name'] not in exclude:
100
+ select.append(attribute['name'])
101
+ select.append(attribute['name'])
102
+ select = ','.join(select)
103
+ if filters:
104
+ filters = '&filter=' + ','.join(filters)
105
+ else:
106
+ filters = ''
107
+ response = self.common.get_request(
108
+ target_uri=f"/{self.enhanced_api_version}/systems"
109
+ f"/{array_id}/{storage_object}"
110
+ f"?select={select}{filters}",
111
+ resource_type=None)
112
+ return response
@@ -112,14 +112,12 @@ class MetroDRFunctions(object):
112
112
  :param dr_storage_group_name: Name for Storage Group at DR,
113
113
  only used if group naming is required
114
114
  to be different from source - str
115
- :param force_new_metro_r1_dr_rdfg: whether or not to create a new RDFG
116
- to be created for Metro R1 array
117
- to DR array, or will autoselect
118
- from existing -- bool
119
- :param force_new_metro_r2_dr_rdfg: whether or not to create a new RDFG
120
- to be created for Metro R2 array
121
- to DR array, or will autoselect
122
- from existing -- bool
115
+ :param force_new_metro_r1_dr_rdfg: this parameter is ignored and
116
+ only present for backward
117
+ compatibility-- bool
118
+ :param force_new_metro_r2_dr_rdfg: this parameter is ignored and
119
+ only present for backward
120
+ compatibility-- bool
123
121
  :param _async: if call should be executed asynchronously or
124
122
  synchronously -- bool
125
123
  :returns: details of newly created metro dr environment-- dict
@@ -128,6 +126,11 @@ class MetroDRFunctions(object):
128
126
  dr_storage_group_name = storage_group_name
129
127
  if not metro_r2_storage_group_name:
130
128
  metro_r2_storage_group_name = storage_group_name
129
+ if force_new_metro_r1_dr_rdfg or force_new_metro_r2_dr_rdfg:
130
+ LOG.warning(
131
+ "Parameter 'force_new__group' is no longer "
132
+ "supported and will be ignored. Default behavior is to "
133
+ "do this automatically")
131
134
 
132
135
  if dr_replication_mode:
133
136
  if 'ASYNCHRONOUS' in dr_replication_mode.upper():
@@ -149,8 +152,6 @@ class MetroDRFunctions(object):
149
152
  'metro_r2_array_id': metro_r2_array_id,
150
153
  'metro_r2_storage_group_name': metro_r2_storage_group_name,
151
154
  'dr_array_id': dr_array_id,
152
- 'force_new_metro_r1_dr_rdfg': force_new_metro_r1_dr_rdfg,
153
- 'force_new_metro_r2_dr_rdfg': force_new_metro_r2_dr_rdfg,
154
155
  'dr_replication_mode': dr_replication_mode,
155
156
  'dr_storage_group_name': dr_storage_group_name,
156
157
  'metro_establish': True,
@@ -892,6 +892,9 @@ class PerformanceFunctions(object):
892
892
  :param output_csv_path: filename for CSV to be generated -- str
893
893
  :param category: threshold specific category -- str
894
894
  """
895
+ LOG.warning("Warning: This function is deprecated and will be removed "
896
+ "in future version 10.4. Please explore API Calls in new "
897
+ "settings Category for getting and setting thresholds")
895
898
  category_list = (
896
899
  self.get_threshold_categories() if not category else [category])
897
900
  data_for_csv = list()
@@ -900,12 +903,11 @@ class PerformanceFunctions(object):
900
903
  for category in category_list:
901
904
  metric_setting = self.get_threshold_category_settings(category)
902
905
  threshold_settings = metric_setting.get(pc.PERF_THRESH)
903
- print(threshold_settings)
904
906
  for threshold in threshold_settings:
905
907
  data_for_csv.append([
906
908
  category, threshold.get(pc.METRIC),
907
- int(threshold.get(pc.FIRST_THRESH)),
908
- int(threshold.get(pc.SEC_THRESH)),
909
+ threshold.get("firstUpperThreshold"),
910
+ threshold.get("secondUpperThreshold"),
909
911
  threshold.get(pc.ALERT_ERR), threshold.get(pc.KPI)])
910
912
  file_handler.write_to_csv_file(output_csv_path, data_for_csv)
911
913
 
@@ -923,22 +925,31 @@ class PerformanceFunctions(object):
923
925
  :param csv_file_path: path to CSV file -- str
924
926
  :param kpi_only: set only KPI thresholds -- bool
925
927
  """
928
+ LOG.warning("Warning: This function is deprecated and will be removed "
929
+ "in version 10.4. Please explore API Calls in new "
930
+ "settings Category for getting and setting thresholds")
931
+
926
932
  def _str_to_bool(str_in):
927
933
  return str_in == 'True'
928
934
 
929
935
  data = file_handler.read_csv_values(csv_file_path)
930
-
931
936
  category_list = data.get(pc.CATEGORY)
932
937
  metric_list = data.get(pc.METRIC)
933
938
  notify_list = data.get(pc.ALERT_ERR)
934
- f_threshold_list = data.get(pc.FIRST_THRESH)
935
- s_threshold_list = data.get(pc.SEC_THRESH)
939
+ f_threshold_list = data.get("firstThreshold")
940
+ s_threshold_list = data.get("secondThreshold")
936
941
  is_kpi = data.get(pc.KPI)
937
942
 
938
943
  for i in range(0, len(metric_list)):
939
944
  if not _str_to_bool(is_kpi[i]) and kpi_only:
940
945
  continue
941
- if int(f_threshold_list[i]) >= int(s_threshold_list[i]):
946
+ if not (f_threshold_list[i]) or not (s_threshold_list[i]):
947
+ LOG.warning(
948
+ 'Not setting performance metric {m} threshold as '
949
+ 'values are not in file'.format(
950
+ m=metric_list[i], ))
951
+ continue
952
+ if (f_threshold_list[i]) >= (s_threshold_list[i]):
942
953
  LOG.warning(
943
954
  'Not setting performance metric {m} threshold, second '
944
955
  'threshold value {f} must be greater than first threshold '
@@ -946,11 +957,14 @@ class PerformanceFunctions(object):
946
957
  m=metric_list[i], f=f_threshold_list[i],
947
958
  s=s_threshold_list[i]))
948
959
  continue
949
- self.update_threshold_settings(
950
- category=category_list[i], metric=metric_list[i],
951
- alert=notify_list[i], first_threshold=f_threshold_list[i],
952
- second_threshold=s_threshold_list[i],
953
- include_realtime_trace=False)
960
+ try:
961
+ self.update_threshold_settings(
962
+ category=category_list[i], metric=metric_list[i],
963
+ alert=notify_list[i], first_threshold=f_threshold_list[i],
964
+ second_threshold=s_threshold_list[i],
965
+ include_realtime_trace=False)
966
+ except Exception as e:
967
+ LOG.error('Error updating threshold settings: {e}'.format(e=e))
954
968
 
955
969
  def get_array_keys(self):
956
970
  """List Arrays registered for performance data collection.
@@ -76,19 +76,36 @@ class EnhancedPerformanceFunctions(object):
76
76
  full_metric_collection.append(response)
77
77
  return full_metric_collection
78
78
 
79
- def get_category_metrics(self, category, array_id=None):
79
+ def get_category_metrics(self, category: str, array_id=None, filters=None):
80
80
  """Get latest data for KPI metrics for specificied performance
81
81
  category.
82
82
 
83
83
  :param array_id: 12 Digit Serial Number of Array -- int
84
+ :param filters: users can filter on the time_range and component id,
85
+ these can be combined in single query,
86
+ e.g. filters=['time_range eq 1','id ilike Oracle',
87
+ 'data_format eq Maximum']
88
+ valid values for time range are 1,2,4,8,12,
89
+ 24 in hours, you can also specify data_format to
90
+ return Average or Maximum values, note for max
91
+ values to be retuned you must be registered for
92
+ realtime statistics -- list
84
93
  :returns: full list of all KPI metrics for latest diagnostic
85
94
  timestamp for the specified array and performance category --
86
95
  dict
87
96
  """
88
97
  array_id = array_id if array_id else self.array_id
98
+ """Build the optional filter part – empty string when no filters are
99
+ given.
100
+ """
101
+ filter_part = ''
102
+ if filters: # filters is not None/empty
103
+ filter_part = '?filter=' + ','.join(filters)
104
+
89
105
  response = self.common.get_request(
90
106
  target_uri=f"/{self.enhanced_api_version}/systems"
91
107
  f"/{array_id}/performance-categories/"
92
- f"{category}",
108
+ f"{category}{filter_part}",
93
109
  resource_type=None)
110
+
94
111
  return response
@@ -920,7 +920,8 @@ class ReplicationFunctions(object):
920
920
  :param establish: establish srdf -- bool
921
921
  :param _async: if call should be async -- bool
922
922
  :param rdfg_number: rdf group number -- int
923
- :param force_new_rdf_group: if force command should be applied -- bool
923
+ :param force_new_rdf_group: ignored, present for backward
924
+ compatibility -- bool
924
925
  :returns: storage group rdf details -- dict
925
926
  """
926
927
  establish_sg = 'True' if establish else 'False'
@@ -930,10 +931,11 @@ class ReplicationFunctions(object):
930
931
  'establish': establish_sg}
931
932
  if rdfg_number is not None:
932
933
  rdf_payload['rdfgNumber'] = rdfg_number
933
- if force_new_rdf_group:
934
- rdf_payload.update({'forceNewRdfGroup': True})
935
934
  if _async:
936
935
  rdf_payload.update(ASYNC_UPDATE)
936
+ if force_new_rdf_group:
937
+ LOG.warning("Parameter 'force_new_rdf_group' is no longer "
938
+ "supported and will be ignored.")
937
939
  return self.create_resource(
938
940
  category=REPLICATION,
939
941
  resource_level=SYMMETRIX, resource_level_id=self.array_id,
@@ -1221,7 +1223,8 @@ class ReplicationFunctions(object):
1221
1223
 
1222
1224
  def modify_rdf_group(self, action, srdf_group_number, array_id=None,
1223
1225
  port_list=None, label=None, dev_list=None,
1224
- target_rdf_group=None, consistency_exempt=None):
1226
+ target_rdf_group=None, consistency_exempt=None,
1227
+ keepR1=None, keepR2=None):
1225
1228
  """Function to Modify Ports, devices or change label of RDF group.
1226
1229
 
1227
1230
  Function can be used to Add ports, move volumes between rdf groups,
@@ -1237,6 +1240,8 @@ class ReplicationFunctions(object):
1237
1240
  :param dev_list: list of volumes to be moved between RDF groups -- list
1238
1241
  :param target_rdf_group: rdfg group to move volumes to -- int
1239
1242
  :param consistency_exempt: ignore device for consistency checks -- bool
1243
+ :param keepR1: preserves data on R1 -- bool
1244
+ :param keepR2: preserves data on R2 -- bool
1240
1245
  """
1241
1246
 
1242
1247
  rdfg_action = constants.RDFG_ACTIONS.get(action.upper())
@@ -1258,6 +1263,10 @@ class ReplicationFunctions(object):
1258
1263
  'volumesToMove': dev_list,
1259
1264
  'exempt': consistency_exempt},
1260
1265
  'action': 'Move'}
1266
+ if keepR1 is not None:
1267
+ payload['move']['keepR1'] = keepR1
1268
+ if keepR2 is not None:
1269
+ payload['move']['keepR2'] = keepR2
1261
1270
 
1262
1271
  elif rdfg_action == 'set_label':
1263
1272
  payload = {
@@ -132,17 +132,8 @@ class RestRequests(object):
132
132
 
133
133
  except requests.Timeout as error:
134
134
  LOG.error(
135
- 'The {} request to URL {} timed-out, but may have '
136
- 'been successful. Please check Unisphere Server for any '
137
- 'slowness, long-running API calls are a symptom of '
138
- 'Unisphere Server limits being reached. {}. See '
139
- 'https://developer.dell.com/apis/4458/versions/10.0/docs'
140
- '/Getting%20Started/4.concurrent_operations.md, To ensure '
141
- 'limits are not being exceeded verify the number of '
142
- 'connections and calls in Unisphere for PowerMax under '
143
- 'Support > Management Server Resources or using system '
144
- 'call get_management_server_resources()'
145
- ''.format(method, url, error))
135
+ 'The {} request to URL {} timed-out, Check Unisphere '
136
+ 'connection.'.format(method, url, error))
146
137
  return None, None
147
138
 
148
139
  except r_exc.SSLError as error:
@@ -41,6 +41,7 @@ def main():
41
41
  copy_file(original, new)
42
42
 
43
43
  update_version(version_files)
44
+ print("Please verify formatting on readme.rst line 50-53")
44
45
 
45
46
 
46
47
  if __name__ == '__main__':