This guide will walk you through retrieving a list of "enabled" users in JetPatch using a Python script and the REST API. The following steps will explain how to use the intigua_display_users.py
script to filter out only the enabled users.
Prerequisites:
-
Python 3.4+ must be installed on the JetPatch server. The script uses the
intigua-python-client
RPM package. - SSH Access to the JetPatch server is required.
- API Key must be generated. Refer to the JetPatch documentation for creating and managing API keys here.
- jq package (to filter results - can be installed using 'sudo yum install jq')
Steps to Retrieve Enabled Users:
The command will return a list of usernames for users who are currently enabled on the JetPatch system.
-
Access JetPatch Server via SSH: Ensure you're logged into the JetPatch server and navigate to the directory where the
intigua-python-client
scripts are stored. -
Run the Command: Use the following command to fetch the list of users and filter for those that are "enabled." This command uses the API key and the JetPatch server URL:
- Replace
<APIKEY>
with your actual API key. - Replace
<DNS>
with your JetPatch server DNS or IP. - Replace
<username>
with your login username.
- Replace
-
Understanding the Command:
-
intigua_display_users.py
: This script fetches all users from the JetPatch server.
-
-
-
jq -r '.[] | select(.enabled == true) | .userName'
: Filters the JSON output to display only users where theenabled
flag istrue
.
-
Note: To retrieve all users use the command below:
./intigua_display_users.py --apikey <APIKEY> --url https://<DNS>/vmanage-server/rest/rest-api --user <username>
Comments
0 comments
Article is closed for comments.