Skip to content

Commit b6cb152

Browse files
committed
got rid of deprecated API fields
1 parent 4891b83 commit b6cb152

File tree

8 files changed

+20
-20
lines changed

8 files changed

+20
-20
lines changed

.github/scripts/additional_api_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_user_get(self):
7171
users = None
7272
if self.api:
7373
users = self.api.user.get(
74-
output=['userid', 'alias']
74+
output=['userid', 'name']
7575
)
7676
self.assertEqual(type(users), list, "Request user.get was going wrong")
7777

.github/scripts/compatibility_api_test_5.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test_classic_auth(self):
4848
type(resp), dict, "Request user.checkAuthentication was going wrong")
4949

5050
users = self.zapi.user.get(
51-
output=['userid', 'alias']
51+
output=['userid', 'name']
5252
)
5353
self.assertEqual(type(users), list, "Request user.get was going wrong")
5454

.github/scripts/compatibility_api_test_latest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def test_token_auth(self):
100100
type(resp), dict, "Request user.checkAuthentication was going wrong")
101101

102102
users = self.zapi.user.get(
103-
output=['userid', 'alias']
103+
output=['userid', 'name']
104104
)
105105
self.assertEqual(type(users), list, "Request user.get was going wrong")
106106

.github/scripts/integration_api_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_user_get(self):
5959
users = None
6060
if self.zapi:
6161
users = self.zapi.user.get(
62-
output=['userid', 'alias']
62+
output=['userid', 'name']
6363
)
6464
self.assertEqual(type(users), list, "Request user.getter was going wrong")
6565

examples/api/auth_by_token.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
# Create an instance of the ZabbixAPI class with the specified authentication details
1111
api = ZabbixAPI(**ZABBIX_AUTH)
1212

13-
# Retrieve a list of users, including their user ID and alias
13+
# Retrieve a list of users, including their user ID and name
1414
users = api.user.get(
15-
output=['userid', 'alias']
15+
output=['userid', 'name']
1616
)
1717

18-
# Print the aliases of the retrieved users
18+
# Print the names of the retrieved users
1919
for user in users:
20-
print(user['alias'])
20+
print(user['name'])

examples/api/disabling_validate_certs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
# Note: Ignoring SSL certificate validation may expose the connection to security risks.
1515
api = ZabbixAPI(**ZABBIX_AUTH)
1616

17-
# Retrieve a list of users from the Zabbix server, including their user ID and alias
17+
# Retrieve a list of users from the Zabbix server, including their user ID and name
1818
users = api.user.get(
19-
output=['userid', 'alias']
19+
output=['userid', 'name']
2020
)
2121

22-
# Print the aliases of the retrieved users
22+
# Print the names of the retrieved users
2323
for user in users:
24-
print(user['alias'])
24+
print(user['name'])
2525

2626
# Logout to release the Zabbix API session
2727
api.logout()

examples/api/token_auth_if_supported.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
# If Zabbix API version is older than 5.4, use traditional username and password authentication
2020
api.login(user=ZABBIX_USER, password=ZABBIX_PASSWORD)
2121

22-
# Retrieve a list of users from the Zabbix server, including their user ID and alias
22+
# Retrieve a list of users from the Zabbix server, including their user ID and name
2323
users = api.user.get(
24-
output=['userid', 'alias']
24+
output=['userid', 'name']
2525
)
2626

27-
# Print the aliases of the retrieved users
27+
# Print the names of the retrieved users
2828
for user in users:
29-
print(user['alias'])
29+
print(user['name'])
3030

3131
# Logout to release the Zabbix API session
3232
api.logout()

examples/api/using_http_auth.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
# Login to the Zabbix API using provided user credentials
1414
api.login(user="Admin", password="zabbix")
1515

16-
# Retrieve a list of users from the Zabbix server, including their user ID and alias
16+
# Retrieve a list of users from the Zabbix server, including their user ID and name
1717
users = api.user.get(
18-
output=['userid', 'alias']
18+
output=['userid', 'name']
1919
)
2020

21-
# Print the aliases of the retrieved users
21+
# Print the names of the retrieved users
2222
for user in users:
23-
print(user['alias'])
23+
print(user['name'])
2424

2525
# Logout to release the Zabbix API session
2626
api.logout()

0 commit comments

Comments
 (0)