Skip to content

Commit a1eb376

Browse files
authored
Release 1.72.0 (#201)
1 parent 3daa385 commit a1eb376

File tree

858 files changed

+202611
-979
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

858 files changed

+202611
-979
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "py-pure-client"
3-
version = "1.71.0"
3+
version = "1.72.0"
44
description = "Pure Storage Python clients for FlashArray, FlashBlade, and Pure1 APIs"
55
authors = [
66
{ name = "Pure Storage", email = "support@purestorage.com" }

pypureclient/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__name__ = 'py-pure-client'
2-
__version__ = '1.71.0'
2+
__version__ = '1.72.0'
33
__default_user_agent__ = 'pure/{}/{}'.format(__name__, __version__)

pypureclient/api_token_manager.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class APITokenManager(object):
1717
A valid session token is stored in memory.
1818
"""
1919

20-
def __init__(self, token_endpoint, api_token, configuration: Configuration, user_agent: str = None, token_dispose_endpoint=None, timeout=None):
20+
def __init__(self, api_token, configuration: Configuration, version: str = None, user_agent: str = None, timeout=None):
2121
"""
2222
Initialize a APITokenManager. Should be treated as a static object.
2323
@@ -29,10 +29,13 @@ def __init__(self, token_endpoint, api_token, configuration: Configuration, user
2929
Raises:
3030
PureError: If there was any issue retrieving an session token.
3131
"""
32-
self._token_endpoint = token_endpoint
33-
self._token_dispose_endpoint = token_dispose_endpoint
32+
_base_url = '/api'
33+
if version:
34+
_base_url = f'{_base_url}/{version}'
35+
self._token_endpoint = f'{_base_url}/login'
36+
self._token_dispose_endpoint = f'{_base_url}/logout'
3437
self._api_token = api_token
35-
self.configuration = configuration
38+
self._configuration = configuration
3639
self._user_agent = user_agent
3740
self._session_token = None
3841
self._timeout = timeout
@@ -90,7 +93,7 @@ def close_session(self):
9093

9194
def __call_endpoint(self, endpoint: str, headers: dict) -> ApiResponse:
9295
_result = None
93-
with create_api_client(self.configuration, self._user_agent) as api_client:
96+
with create_api_client(self._configuration, self._user_agent) as api_client:
9497
_result = api_client.call_api(
9598
endpoint,
9699
"POST",

pypureclient/flasharray/FA_2_0/client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
class Client(object):
3636

37+
__REST_API_VERSON = '2.0'
38+
3739
def __init__(self,
3840
configuration: Configuration,
3941
id_token: str = None,
@@ -103,9 +105,8 @@ def __init__(self,
103105
raise PureError("id_token is generated based on app ID and private key info. Please use either id_token or api_token and try again!")
104106
elif api_token:
105107
self._token_man = APITokenManager(
106-
'/api/2.0/login',
107-
api_token,
108-
token_dispose_endpoint='/api/2.0/logout',
108+
api_token=api_token,
109+
version=Client.__REST_API_VERSON,
109110
user_agent=user_agent,
110111
timeout=timeout,
111112
configuration=configuration,
@@ -149,7 +150,7 @@ def get_rest_version(self):
149150
str
150151
151152
"""
152-
return '2.0'
153+
return Client.__REST_API_VERSON
153154

154155
def get_access_token(self, refresh=False):
155156
"""

pypureclient/flasharray/FA_2_1/client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
class Client(object):
3636

37+
__REST_API_VERSON = '2.1'
38+
3739
def __init__(self,
3840
configuration: Configuration,
3941
id_token: str = None,
@@ -103,9 +105,8 @@ def __init__(self,
103105
raise PureError("id_token is generated based on app ID and private key info. Please use either id_token or api_token and try again!")
104106
elif api_token:
105107
self._token_man = APITokenManager(
106-
'/api/2.1/login',
107-
api_token,
108-
token_dispose_endpoint='/api/2.1/logout',
108+
api_token=api_token,
109+
version=Client.__REST_API_VERSON,
109110
user_agent=user_agent,
110111
timeout=timeout,
111112
configuration=configuration,
@@ -149,7 +150,7 @@ def get_rest_version(self):
149150
str
150151

151152
"""
152-
return '2.1'
153+
return Client.__REST_API_VERSON
153154

154155
def get_access_token(self, refresh=False):
155156
"""

pypureclient/flasharray/FA_2_10/client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
class Client(object):
3636

37+
__REST_API_VERSON = '2.10'
38+
3739
def __init__(self,
3840
configuration: Configuration,
3941
id_token: str = None,
@@ -103,9 +105,8 @@ def __init__(self,
103105
raise PureError("id_token is generated based on app ID and private key info. Please use either id_token or api_token and try again!")
104106
elif api_token:
105107
self._token_man = APITokenManager(
106-
'/api/2.10/login',
107-
api_token,
108-
token_dispose_endpoint='/api/2.10/logout',
108+
api_token=api_token,
109+
version=Client.__REST_API_VERSON,
109110
user_agent=user_agent,
110111
timeout=timeout,
111112
configuration=configuration,
@@ -149,7 +150,7 @@ def get_rest_version(self):
149150
str
150151

151152
"""
152-
return '2.10'
153+
return Client.__REST_API_VERSON
153154

154155
def get_access_token(self, refresh=False):
155156
"""

pypureclient/flasharray/FA_2_11/client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
class Client(object):
3636

37+
__REST_API_VERSON = '2.11'
38+
3739
def __init__(self,
3840
configuration: Configuration,
3941
id_token: str = None,
@@ -103,9 +105,8 @@ def __init__(self,
103105
raise PureError("id_token is generated based on app ID and private key info. Please use either id_token or api_token and try again!")
104106
elif api_token:
105107
self._token_man = APITokenManager(
106-
'/api/2.11/login',
107-
api_token,
108-
token_dispose_endpoint='/api/2.11/logout',
108+
api_token=api_token,
109+
version=Client.__REST_API_VERSON,
109110
user_agent=user_agent,
110111
timeout=timeout,
111112
configuration=configuration,
@@ -149,7 +150,7 @@ def get_rest_version(self):
149150
str
150151

151152
"""
152-
return '2.11'
153+
return Client.__REST_API_VERSON
153154

154155
def get_access_token(self, refresh=False):
155156
"""

pypureclient/flasharray/FA_2_13/client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
class Client(object):
3636

37+
__REST_API_VERSON = '2.13'
38+
3739
def __init__(self,
3840
configuration: Configuration,
3941
id_token: str = None,
@@ -103,9 +105,8 @@ def __init__(self,
103105
raise PureError("id_token is generated based on app ID and private key info. Please use either id_token or api_token and try again!")
104106
elif api_token:
105107
self._token_man = APITokenManager(
106-
'/api/2.13/login',
107-
api_token,
108-
token_dispose_endpoint='/api/2.13/logout',
108+
api_token=api_token,
109+
version=Client.__REST_API_VERSON,
109110
user_agent=user_agent,
110111
timeout=timeout,
111112
configuration=configuration,
@@ -149,7 +150,7 @@ def get_rest_version(self):
149150
str
150151

151152
"""
152-
return '2.13'
153+
return Client.__REST_API_VERSON
153154

154155
def get_access_token(self, refresh=False):
155156
"""

pypureclient/flasharray/FA_2_14/client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
class Client(object):
3636

37+
__REST_API_VERSON = '2.14'
38+
3739
def __init__(self,
3840
configuration: Configuration,
3941
id_token: str = None,
@@ -103,9 +105,8 @@ def __init__(self,
103105
raise PureError("id_token is generated based on app ID and private key info. Please use either id_token or api_token and try again!")
104106
elif api_token:
105107
self._token_man = APITokenManager(
106-
'/api/2.14/login',
107-
api_token,
108-
token_dispose_endpoint='/api/2.14/logout',
108+
api_token=api_token,
109+
version=Client.__REST_API_VERSON,
109110
user_agent=user_agent,
110111
timeout=timeout,
111112
configuration=configuration,
@@ -149,7 +150,7 @@ def get_rest_version(self):
149150
str
150151

151152
"""
152-
return '2.14'
153+
return Client.__REST_API_VERSON
153154

154155
def get_access_token(self, refresh=False):
155156
"""

pypureclient/flasharray/FA_2_15/client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
class Client(object):
3636

37+
__REST_API_VERSON = '2.15'
38+
3739
def __init__(self,
3840
configuration: Configuration,
3941
id_token: str = None,
@@ -103,9 +105,8 @@ def __init__(self,
103105
raise PureError("id_token is generated based on app ID and private key info. Please use either id_token or api_token and try again!")
104106
elif api_token:
105107
self._token_man = APITokenManager(
106-
'/api/2.15/login',
107-
api_token,
108-
token_dispose_endpoint='/api/2.15/logout',
108+
api_token=api_token,
109+
version=Client.__REST_API_VERSON,
109110
user_agent=user_agent,
110111
timeout=timeout,
111112
configuration=configuration,
@@ -149,7 +150,7 @@ def get_rest_version(self):
149150
str
150151

151152
"""
152-
return '2.15'
153+
return Client.__REST_API_VERSON
153154

154155
def get_access_token(self, refresh=False):
155156
"""

0 commit comments

Comments
 (0)