-
Notifications
You must be signed in to change notification settings - Fork 17
Home
python-jamf
is a Python 3 module to access the Jamf Pro Classic API. The Classic API is the primary tool for programmatic access to data on a Jamf Pro server to allow integrations with other utilities or systems. The concept behind it is to have a class or simply a collection of data (variables) and methods (functions) that maps directly to the API (https://example.com:8443/api).
The python-jamf
API class doesn't hide anything from you. It handles the URL requests, authentication, and converts between XML/JSON to Python dictionaries/lists.
The python-jamf
module also provides undocumented access to Jamf Admin functionality used for uploading items to Jamf Distribution Points.
Currently, the python-jamf
module supports about 38 Jamf records like Buildings, Categories, Computers, OSXConfigurationProfiles, and Policies for example.
Each record is a Python object, but they are generic. Objects do not have member variables for Jamf data. All Jamf Pro data is stored as a Python dictionary that is accessed with the data() method. Lists of records are not the same as a record. Early in the project, this was not the case
Almost all of our design decisions were based on our primary goal to make this project as minimal as possible but to be as functional as possible. The reason why we value minimalism so much is that we wanted to be able to create python-jamf
as quickly as possible but maintain it with minimal effort.
The Classic API supports Basic Authentication and uses the standard User Accounts and Groups functionality of Jamf Pro. The CRUD (Create, Read, Update, and Delete) privileges for an account or group within Jamf Pro correspond with the POST, GET, PUT and DELETE HTTP methods.
See the Classic API Overview documentation for more details.
At JNUC 2016, Jamf announced the Jamf Pro Universal API (aka Jamf Pro API). This API is the underlying framework that Jamf Pro uses to display information in much of its web interface. In the long term, the Jamf Pro API is supposed to meet and exceed the functionality of the Classic API. But, due to the expansive Classic API framework currently in place, the Jamf Pro API project will take some time to update according to jamf. So, the python-jamf
module currently integrates the Classic API as the Jamf Pro API is lacking in features and functionality that is needed, but we plan on integrating support for the new Jamf Pro Universal API (aka Jamf Pro API) when it meets the python-jamf
requirements and is more finalized & usable.
Sometime between 2016 and 2020, Sam Forester started this project under direction of Richard Glaser at the University of Utah Marriott Library. Sam and James Reynolds talked about this problem and decided the easist way to automate Jamf Pro from the command line was to write a generic Jamf library that didn't require any code to manage endpoints. This idea stemmed from frustration with python-jss. The main issue was that every record required a lot of code before anything could be done with it. So python-jamf was written with the goal of working with any record or data type without any extra code by simply converting each record into dictionaries and lists and just navigating them, kind of like how XPath can navigate XML.
Sam created the "patch" project. It was focused on patch management, which was the main problem Richard was solving. It included installer package and patch management. It could assign packages to patch definition, update versions, and version release branching (i.e. development, testing, production).
In 2020, Sam had moved on from the Marriott Library and stopped working on this project. James Reynolds, Topher Naduld, and Richard Glaser started to meet weekly in an effort to not let this project die. It had some good code in it, but a lot of it was tailored for the Marriott Library and didn't translate to other Jamf setups.
By October, 2020, they split the code into two projects, python-jamf
and jctl
. They put an installer on PyPi to support pip installation. Although they have taken breaks when the day jobs get busy, as of November, 2022, they are still meeting weekly to work on this project.
To search this wiki use the "Search" field in the GitHub navigation bar above. Then on the search results page select the "Wiki" option or click here and search.