PyPowerStore 3.1.0.0__tar.gz → 3.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 (25) hide show
  1. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PKG-INFO +1 -1
  2. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore/__init__.py +1 -1
  3. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore/protection.py +2 -2
  4. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore/provisioning.py +49 -4
  5. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore/utils/constants.py +19 -1
  6. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore/utils/exception.py +1 -1
  7. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore/utils/helpers.py +17 -7
  8. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore.egg-info/PKG-INFO +1 -1
  9. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/setup.py +1 -1
  10. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore/client.py +0 -0
  11. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore/configuration.py +0 -0
  12. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore/objects/__init__.py +0 -0
  13. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore/objects/file_dns.py +0 -0
  14. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore/objects/file_interface.py +0 -0
  15. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore/objects/file_nis.py +0 -0
  16. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore/objects/nfs_server.py +0 -0
  17. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore/objects/smb_server.py +0 -0
  18. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore/powerstore_conn.py +0 -0
  19. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore/utils/__init__.py +0 -0
  20. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore.egg-info/SOURCES.txt +0 -0
  21. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore.egg-info/dependency_links.txt +0 -0
  22. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore.egg-info/requires.txt +0 -0
  23. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/PyPowerStore.egg-info/top_level.txt +0 -0
  24. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/README.md +0 -0
  25. {PyPowerStore-3.1.0.0 → PyPowerStore-3.3.0.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: PyPowerStore
3
- Version: 3.1.0.0
3
+ Version: 3.3.0.0
4
4
  Summary: Python Library for Dell PowerStore
5
5
  Home-page: https://github.com/dell/python-powerstore
6
6
  Author: Ansible Team at Dell
@@ -3,6 +3,6 @@
3
3
  """__init__.py."""
4
4
 
5
5
  __title__ = 'PyPowerStore'
6
- __version__ = '3.1.0.0'
6
+ __version__ = '3.3.0.0'
7
7
  __author__ = 'Dell Technologies or its subsidiaries'
8
8
  __copyright__ = 'Copyright 2024 Dell Technologies'
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright: (c) 2019, Dell Technologies
3
- # Copyright: (c) 2019, Ivan Pchelintsev <Ivan.Pchelintsev@emc.com>
2
+ # Copyright: (c) 2024, Dell Technologies
3
+ # Copyright: (c) 2024, Ivan Pchelintsev <Ivan.Pchelintsev@emc.com>
4
4
 
5
5
  """Collection of protection related functions for PowerStore"""
6
6
 
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright: (c) 2019, Dell Technologies
2
+ # Copyright: (c) 2024, Dell Technologies
3
3
 
4
4
  """Collection of provisioning related functions for PowerStore"""
5
5
 
@@ -642,7 +642,9 @@ class Provisioning:
642
642
  """
643
643
  LOG.info("Getting volume details by ID: '%s'" % volume_id)
644
644
  querystring = constants.SELECT_ALL_VOLUME
645
- if helpers.is_foot_hill_prime_or_higher():
645
+ if helpers.is_victory_or_higher():
646
+ querystring = constants.VICTORY_VOLUME_DETAILS_QUERY
647
+ elif helpers.is_foot_hill_prime_or_higher():
646
648
  querystring = constants.FHP_VOLUME_DETAILS_QUERY
647
649
  elif helpers.is_foot_hill_or_higher():
648
650
  querystring = constants.FHC_VOLUME_DETAILS_QUERY
@@ -668,7 +670,9 @@ class Provisioning:
668
670
  """
669
671
  LOG.info("Getting volume details by name: '%s'" % volume_name)
670
672
  querystring = constants.SELECT_ALL_VOLUME
671
- if helpers.is_foot_hill_prime_or_higher():
673
+ if helpers.is_victory_or_higher():
674
+ querystring = constants.VICTORY_VOLUME_DETAILS_QUERY
675
+ elif helpers.is_foot_hill_prime_or_higher():
672
676
  querystring = constants.FHP_VOLUME_DETAILS_QUERY
673
677
  elif helpers.is_foot_hill_or_higher():
674
678
  querystring = constants.FHC_VOLUME_DETAILS_QUERY
@@ -2006,7 +2010,7 @@ class Provisioning:
2006
2010
  LOG.info("Getting smbshares with filter: '%s' and all_pages: %s"
2007
2011
  % (filter_dict, all_pages))
2008
2012
  querystring = helpers.prepare_querystring(
2009
- constants.SELECT_ID_AND_NAME, filter_dict)
2013
+ constants.SELECT_ALL_SMB_SHARE, filter_dict)
2010
2014
  LOG.info("Querystring: '%s'" % querystring)
2011
2015
  return self.client.request(constants.GET,
2012
2016
  constants.GET_SMB_SHARE_LIST_URL.format
@@ -2105,6 +2109,47 @@ class Provisioning:
2105
2109
  self.server_ip, share_id))
2106
2110
  # SMB Share Methods End
2107
2111
 
2112
+ # ACL Methods
2113
+
2114
+ def get_acl(self, share_id):
2115
+ """
2116
+ Retrieves the Access Control List (ACL) details for a given share ID.
2117
+
2118
+ :param share_id: The ID of the share for which to retrieve the ACL details.
2119
+ :type share_id: str
2120
+ :return: The response from the client's request to retrieve the ACL details.
2121
+ :rtype: dict
2122
+ """
2123
+ LOG.info(f"Getting ACL details: '{share_id}'")
2124
+ return self.client.request(
2125
+ constants.POST,
2126
+ constants.GET_ACL_DETAILS.format(self.server_ip, share_id),
2127
+ )
2128
+
2129
+ def set_acl(self, share_id, add_aces=None, remove_aces=None):
2130
+ """
2131
+ Sets the access control list (ACL) for a given share.
2132
+ Args:
2133
+ share_id (str): The ID of the share.
2134
+ add_aces (list, optional): A list of access control entries
2135
+ (ACEs) to add to the ACL. Defaults to None.
2136
+ remove_aces (list, optional): A list of access control entries
2137
+ (ACEs) to remove from the ACL. Defaults to None.
2138
+
2139
+ Returns:
2140
+ dict: The response from the server after setting the ACL.
2141
+ """
2142
+ payload = dict()
2143
+ if add_aces:
2144
+ payload["add_aces"] = add_aces
2145
+ if remove_aces:
2146
+ payload["remove_aces"] = remove_aces
2147
+ return self.client.request(
2148
+ constants.POST, constants.SET_ACL_DETAILS.format(
2149
+ self.server_ip, share_id), payload=payload)
2150
+
2151
+ # ACL Methods End
2152
+
2108
2153
  # FS Quota Methods
2109
2154
  def get_file_tree_quotas(self, filter_dict=None, all_pages=False):
2110
2155
  """Get a list of file tree quotas.
@@ -22,8 +22,12 @@ OFFSET = 100
22
22
  # max number of items limit in a response
23
23
  MAX_LIMIT = 2000
24
24
 
25
- # Foot Hill Prime Plus Version
25
+ # Platform Versions
26
+ FOOTHILL_VERSION = '2.0.0.0'
27
+ MALKA_VERSION = '2.1.0.0'
28
+ FOOTHILL_PRIME_VERSION = '3.0.0.0'
26
29
  FOOTHILL_PRIME_PLUS_VERSION = '3.2.0.0'
30
+ VICTORY_VERSION = '4.0.0.0'
27
31
 
28
32
  # Query params
29
33
 
@@ -64,6 +68,16 @@ FHP_VOLUME_DETAILS_QUERY = {
64
68
  "migration_session_id"
65
69
  }
66
70
 
71
+ VICTORY_VOLUME_DETAILS_QUERY = {
72
+ "select": "id,name,description,type,wwn,nsid,nguid,appliance_id,state,"
73
+ "size,logical_used,node_affinity,creation_timestamp,"
74
+ "protection_policy_id,performance_policy_id,qos_performance_policy_id,"
75
+ "is_replication_destination,migration_session_id,metro_replication_session_id,"
76
+ "is_host_access_available,protection_data,location_history,"
77
+ "app_type,app_type_other,type_l10n,state_l10n,node_affinity_l10n,app_type_l10n,"
78
+ "volume_groups(name,id), protection_policy(name,id)"
79
+ }
80
+
67
81
  # Host Query
68
82
  SELECT_ALL_HOST = {
69
83
  "select": "id,name,description,os_type,"
@@ -626,6 +640,10 @@ GET_SMB_SHARE_DETAILS_URL = 'https://{0}/api/rest/smb_share/{1}'
626
640
  MODIFY_SMB_SHARE_URL = GET_SMB_SHARE_DETAILS_URL
627
641
  DELETE_SMB_SHARE_URL = GET_SMB_SHARE_DETAILS_URL
628
642
 
643
+ # SMB Share ACL endpoints
644
+ GET_ACL_DETAILS = 'https://{0}/api/rest/smb_share/{1}/get_acl'
645
+ SET_ACL_DETAILS = 'https://{0}/api/rest/smb_share/{1}/set_acl'
646
+
629
647
  # File Tree Quota endpoints
630
648
  GET_TREE_QUOTA_LIST_URL = 'https://{0}/api/rest/file_tree_quota'
631
649
  CREATE_TREE_QUOTA_URL = GET_TREE_QUOTA_LIST_URL
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright: (c) 2019, Dell Technologies
2
+ # Copyright: (c) 2024, Dell Technologies
3
3
 
4
4
  """PowerStore exceptions"""
5
5
 
@@ -1,9 +1,10 @@
1
1
  # -*- coding: utf-8 -*-
2
- # Copyright: (c) 2019, Dell Technologies
2
+ # Copyright: (c) 2024, Dell Technologies
3
3
 
4
4
  """Helper module for PowerStore"""
5
5
  import logging
6
6
  from pkg_resources import parse_version
7
+ from PyPowerStore.utils import constants
7
8
 
8
9
  provisioning_obj = None
9
10
 
@@ -52,10 +53,9 @@ def is_foot_hill_or_higher():
52
53
  :return: True if foot hill or higher
53
54
  :rtype: bool
54
55
  """
55
- foot_hill_version = '2.0.0.0'
56
56
  array_version = provisioning_obj.get_array_version()
57
57
  if array_version and (
58
- parse_version(array_version[0:7]) >= parse_version(foot_hill_version)):
58
+ parse_version(array_version[0:7]) >= parse_version(constants.FOOTHILL_VERSION)):
59
59
  return True
60
60
  return False
61
61
 
@@ -65,10 +65,9 @@ def is_malka_or_higher():
65
65
  :return: True if array version is Malka or higher
66
66
  :rtype: bool
67
67
  """
68
- malka_version = '2.1.0.0'
69
68
  array_version = provisioning_obj.get_array_version()
70
69
  if array_version and (
71
- parse_version(array_version[0:7]) >= parse_version(malka_version)):
70
+ parse_version(array_version[0:7]) >= parse_version(constants.MALKA_VERSION)):
72
71
  return True
73
72
  return False
74
73
 
@@ -78,10 +77,21 @@ def is_foot_hill_prime_or_higher():
78
77
  :return: True if foothill prime or higher
79
78
  :rtype: bool
80
79
  """
81
- foot_hill_prime_version = '3.0.0.0'
82
80
  array_version = provisioning_obj.get_array_version()
83
81
  if array_version and (
84
- parse_version(array_version[0:7]) >= parse_version(foot_hill_prime_version)):
82
+ parse_version(array_version[0:7]) >= parse_version(constants.FOOTHILL_PRIME_VERSION)):
83
+ return True
84
+ return False
85
+
86
+ def is_victory_or_higher():
87
+ """Returns true if the array version is victory or higher.
88
+
89
+ :return: True if victory or higher
90
+ :rtype: bool
91
+ """
92
+ array_version = provisioning_obj.get_array_version()
93
+ if array_version and (
94
+ parse_version(array_version[0:7]) >= parse_version(constants.VICTORY_VERSION)):
85
95
  return True
86
96
  return False
87
97
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: PyPowerStore
3
- Version: 3.1.0.0
3
+ Version: 3.3.0.0
4
4
  Summary: Python Library for Dell PowerStore
5
5
  Home-page: https://github.com/dell/python-powerstore
6
6
  Author: Ansible Team at Dell
@@ -10,7 +10,7 @@ except ImportError:
10
10
 
11
11
 
12
12
  setup(name='PyPowerStore',
13
- version='3.1.0.0',
13
+ version='3.3.0.0',
14
14
  description='Python Library for Dell PowerStore',
15
15
  author='Ansible Team at Dell',
16
16
  author_email='ansible.team@dell.com',
File without changes
File without changes