vovashort.blogg.se

Jamf pro api
Jamf pro api









  1. #JAMF PRO API HOW TO#
  2. #JAMF PRO API INSTALL#
  3. #JAMF PRO API PATCH#
  4. #JAMF PRO API CODE#

Fixed trigger_logout removal from policies triggers.This release includes the xml array fix described here.Replaced all exit(1) with raise SystemExit.Added conf-python-jamf -r to remove the bearer token saved in the keychain.Checks for " or " when setting a hostname and when connecting to a server.

jamf pro api

  • Much better error reporting when there's a connection failure to the server.
  • Latest Status Releases 🆕 python-jamf - 0.8.2 If you have additional questions, or need more help getting started, post a question on the MacAdmin's Slack jctl channel. Then on the search results page select the "Wiki" option or click here and search. To search this wiki use the "Search" field in the GitHub navigation bar above.

    #JAMF PRO API INSTALL#

    Sudo pip3 install -upgrade python-jamf Getting Help Wiki More Documentationįor further in-depth details please check out the wiki. To uninstall python-jamf run the following command: Uninstalling python-jamf is easy if you installed it via pip.

  • Install Module & Requirements: sudo pip3 install python-jamf.
  • Quick Start Installingįor those that want to try python-jamf quickly here are some general steps: You can replace jamf.Computers() with jamf.Policies() or any supported record type. Print(computers.recordWithName("Jimmy's Mac").data)įor computer in computers.recordsWithRegex("Jm's? Mac"): # Matches Jimmy's, James', and James'sĬomputer = computers.recordWithName("James's Mac)Ĭomputer.refresh() # Re-download the record from the serverĬomputer.data = "James' Mac"Ĭomputer = computers.recordWithName("Richard's Mac)Ĭomp1 = computers.createNewRecord("computer1") # This really is a short-cut for the next line.Ĭomp2 = (0, "computer2")Ī few notes. Print(computer.data)Ĭomputers = jamf.Computers() # Use the data retrieved above, don't re-downloadĬomputers.refresh() # Re-download the records from the server

    #JAMF PRO API HOW TO#

    Lastly, it shows how to delete and create records.įor computer in jamf.Computers(): # Retreive the data from the server Then, it searches for a computer by name and if it exists then it changes the name.

    #JAMF PRO API CODE#

    The following code prints the last_contact_time from all computer records, from a computer record with the ID of 1, a computer record named "Jimmy's Mac", and computer records that match a regex. This is just a quick example of the power and ease-of-use of python-jamf. Note, python-jamf can work with unsupported Jamf records, it just isn't as easy as the next section shows. All changes you make are local until you save or refresh the object. This prevents multiple fetches for the same object. All lists of records are singleton subclasses of the Records class.īy being singleton classes, you perform one fetch to the server for each list or record. All Jamf Pro data is stored as a Python dictionary that is accessed with the data() method. Objects do not have member variables for Jamf data. Supported Jamf RecordsĬurrently, the python-jamf supports about 50 Jamf records like Buildings, Categories, Computers, OSXConfigurationProfiles, and Policies for example.Įach record is a singleton Python object, but they are generic and most functionality comes from the parent Record class. Please check out the jctl github page for more information. And recently added PyPi to support pip installation. It is similar to SQL statements, but far less complex. It allows performing Jamf Pro repetitive tasks quickly and provides options not available in the web GUI. The second project, jctl, is a command-line tool that uses the python-jamf library to select objects to create, delete, print and update. Later, it was split into two projects, python-jamf, which is a python library that connects to a Jamf Pro server using Jamf Pro Classic API, including keychain support for Jamf Pro credentials via keyring python project, support for PyPi to support pip installation and currently supports 56 Jamf Pro record types which will expand in number as the project continues. development, testing, production), and scripting and automation.

    #JAMF PRO API PATCH#

    Originally, it was a "patch" project that was focused on patch management including installer package management, patch management, including assigning package to patch definition, updating versions, version release branching (i.e. The python-jamf module also provides undocumented access to Jamf Admin functionality used for uploading items to Jamf Distribution Points. It handles the URL requests, authentication, and converts between XML/JSON to Python dictionaries/lists. The python-jamf API class doesn't hide anything from you.

    jamf pro api

    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 ( ). 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. Python-jamf is a Python 3 module to access the Jamf Pro Classic API.

    jamf pro api

    Programmatic Automation, Access & Control of Jamf Pro











    Jamf pro api