API Client#
- class ApiClient(config: ConfigManager, concurrency: int)[source]#
Provides methods for interacting with the Jamf API, specifically fetching patch data, device information, and OS versions.
Note
All methods of the ApiClient class will raise an
APIResponseError
if the API call is unsuccessful.- Parameters:
config (
ConfigManager
) – Instance ofConfigManager
for loading and storing credentials.concurrency (
int
) – Maximum number of concurrent API requests. See concurrency in Usage docs.
- async get_policies() List[str] [source]#
Retrieves a list of patch software title IDs from the Jamf API.
- async get_summaries(policy_ids: List[str]) List[PatchTitle] [source]#
Retrieves patch summaries asynchronously for the specified policy IDs from the Jamf API.
- async get_device_ids() List[int] [source]#
Asynchronously fetches the list of mobile device IDs from the Jamf Pro API.
Note
This method is only called if the iOS option is passed to the CLI.
- async get_device_os_versions(device_ids: List[int]) List[Dict[str, str]] [source]#
Asynchronously fetches the OS version and serial number for each device ID provided.
Note
This method is only called if the iOS option is passed to the CLI.
- async get_app_names(patch_titles: List[PatchTitle]) List[Dict[str, Any]] [source]#
Fetches all possible app names for each
PatchTitle
object provided.- Parameters:
patch_titles (
List
[PatchTitle
]) – List ofPatchTitle
objects.- Returns:
List of dictionaries containing the
PatchTitle
title and correspondingappName
- Return type:
- async get_sofa_feed() List[Dict[str, str]] [source]#
Fetches iOS Data feeds from SOFA and extracts latest OS version information.
To limit the amount of possible SSL verification checks, this method utilizes a subprocess call instead.
Note
This method is only called if the iOS option is passed to the CLI.
- Returns:
A list of dictionaries containing base OS versions, latest iOS versions, and release dates.
- Return type:
- Raises:
APIResponseError – If return code from SOFA is non-zero.