diff --git a/.github/scripts/additional_api_tests.py b/.github/scripts/additional_api_tests.py index f7fe065..b6a3fce 100644 --- a/.github/scripts/additional_api_tests.py +++ b/.github/scripts/additional_api_tests.py @@ -71,7 +71,7 @@ def test_user_get(self): users = None if self.api: users = self.api.user.get( - output=['userid', 'alias'] + output=['userid', 'name'] ) self.assertEqual(type(users), list, "Request user.get was going wrong") diff --git a/.github/scripts/compatibility_api_test_5.py b/.github/scripts/compatibility_api_test_5.py index 727dc77..3baedc2 100644 --- a/.github/scripts/compatibility_api_test_5.py +++ b/.github/scripts/compatibility_api_test_5.py @@ -48,7 +48,7 @@ def test_classic_auth(self): type(resp), dict, "Request user.checkAuthentication was going wrong") users = self.zapi.user.get( - output=['userid', 'alias'] + output=['userid', 'name'] ) self.assertEqual(type(users), list, "Request user.get was going wrong") diff --git a/.github/scripts/compatibility_api_test_latest.py b/.github/scripts/compatibility_api_test_latest.py index 7145b2d..23123e8 100644 --- a/.github/scripts/compatibility_api_test_latest.py +++ b/.github/scripts/compatibility_api_test_latest.py @@ -100,7 +100,7 @@ def test_token_auth(self): type(resp), dict, "Request user.checkAuthentication was going wrong") users = self.zapi.user.get( - output=['userid', 'alias'] + output=['userid', 'name'] ) self.assertEqual(type(users), list, "Request user.get was going wrong") diff --git a/.github/scripts/integration_api_test.py b/.github/scripts/integration_api_test.py index 65924be..6a64ed6 100644 --- a/.github/scripts/integration_api_test.py +++ b/.github/scripts/integration_api_test.py @@ -59,7 +59,7 @@ def test_user_get(self): users = None if self.zapi: users = self.zapi.user.get( - output=['userid', 'alias'] + output=['userid', 'name'] ) self.assertEqual(type(users), list, "Request user.getter was going wrong") diff --git a/CHANGELOG.md b/CHANGELOG.md index d57caa2..c9d0542 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ -## [1.0.0](https://github.com/zabbix/python-zabbix-utils/tree/tag/v1.0.0) (2023-11-17) +## [1.0.1](https://github.com/zabbix/python-zabbix-utils/compare/v1.0.0...v1.0.1) (2023-11-27) + +### Bug fixes: + +- removed deprecated API fields from examples and README. +- removed "Get started" section from README for PyPI. +- fixed small flaws. + +## [1.0.0](https://github.com/zabbix/python-zabbix-utils/tree/v1.0.0) (2023-11-17) Initial release diff --git a/README.md b/README.md index bf50bfd..1180955 100644 --- a/README.md +++ b/README.md @@ -53,11 +53,11 @@ api = ZabbixAPI(url="127.0.0.1") api.login(user="User", password="zabbix") users = api.user.get( - output=['userid', 'alias'] + output=['userid','name'] ) for user in users: - print(user['alias']) + print(user['name']) api.logout() ``` @@ -71,11 +71,11 @@ api = ZabbixAPI(url="127.0.0.1") api.login(token="xxxxxxxx") users = api.user.get( - output=['userid', 'alias'] + output=['userid','name'] ) for user in users: - print(user['alias']) + print(user['name']) api.logout() ``` diff --git a/examples/api/auth_by_token.py b/examples/api/auth_by_token.py index 703a12a..8cda125 100644 --- a/examples/api/auth_by_token.py +++ b/examples/api/auth_by_token.py @@ -10,11 +10,11 @@ # Create an instance of the ZabbixAPI class with the specified authentication details api = ZabbixAPI(**ZABBIX_AUTH) -# Retrieve a list of users, including their user ID and alias +# Retrieve a list of users, including their user ID and name users = api.user.get( - output=['userid', 'alias'] + output=['userid', 'name'] ) -# Print the aliases of the retrieved users +# Print the names of the retrieved users for user in users: - print(user['alias']) + print(user['name']) diff --git a/examples/api/disabling_validate_certs.py b/examples/api/disabling_validate_certs.py index dd1c842..3c20562 100644 --- a/examples/api/disabling_validate_certs.py +++ b/examples/api/disabling_validate_certs.py @@ -14,14 +14,14 @@ # Note: Ignoring SSL certificate validation may expose the connection to security risks. api = ZabbixAPI(**ZABBIX_AUTH) -# Retrieve a list of users from the Zabbix server, including their user ID and alias +# Retrieve a list of users from the Zabbix server, including their user ID and name users = api.user.get( - output=['userid', 'alias'] + output=['userid', 'name'] ) -# Print the aliases of the retrieved users +# Print the names of the retrieved users for user in users: - print(user['alias']) + print(user['name']) # Logout to release the Zabbix API session api.logout() diff --git a/examples/api/token_auth_if_supported.py b/examples/api/token_auth_if_supported.py index 16c7ec3..9517964 100644 --- a/examples/api/token_auth_if_supported.py +++ b/examples/api/token_auth_if_supported.py @@ -19,14 +19,14 @@ # If Zabbix API version is older than 5.4, use traditional username and password authentication api.login(user=ZABBIX_USER, password=ZABBIX_PASSWORD) -# Retrieve a list of users from the Zabbix server, including their user ID and alias +# Retrieve a list of users from the Zabbix server, including their user ID and name users = api.user.get( - output=['userid', 'alias'] + output=['userid', 'name'] ) -# Print the aliases of the retrieved users +# Print the names of the retrieved users for user in users: - print(user['alias']) + print(user['name']) # Logout to release the Zabbix API session api.logout() diff --git a/examples/api/using_http_auth.py b/examples/api/using_http_auth.py index d71e4da..17985c4 100644 --- a/examples/api/using_http_auth.py +++ b/examples/api/using_http_auth.py @@ -13,14 +13,14 @@ # Login to the Zabbix API using provided user credentials api.login(user="Admin", password="zabbix") -# Retrieve a list of users from the Zabbix server, including their user ID and alias +# Retrieve a list of users from the Zabbix server, including their user ID and name users = api.user.get( - output=['userid', 'alias'] + output=['userid', 'name'] ) -# Print the aliases of the retrieved users +# Print the names of the retrieved users for user in users: - print(user['alias']) + print(user['name']) # Logout to release the Zabbix API session api.logout() diff --git a/setup.py b/setup.py index c94d323..364ddf7 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,10 @@ +import re import setuptools from zabbix_utils.version import __version__ with open("README.md", "r", encoding="utf-8") as fh: - long_description = fh.read() + regexp = r'(?<=##)\s*Get started\n*(^\*.*\n){1,10}\n*##' + long_description = re.sub(regexp, '', fh.read(), flags=re.M) setuptools.setup( name="zabbix_utils", @@ -28,7 +30,7 @@ 'Bug Tracker': 'https://github.com/zabbix/python-zabbix-utils/issues' }, classifiers=[ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", diff --git a/zabbix_utils/version.py b/zabbix_utils/version.py index 4520b82..942251f 100644 --- a/zabbix_utils/version.py +++ b/zabbix_utils/version.py @@ -22,7 +22,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. -__version__ = "1.0.0" +__version__ = "1.0.1" __min_supported__ = 5.0 __max_supported__ = 7.0