Replace deprecated Jamf Pro API endpoints with supported alternatives#79
Replace deprecated Jamf Pro API endpoints with supported alternatives#79cr3ation wants to merge 2 commits intomacadmins:mainfrom
Conversation
- Add v3 computer inventory methods (get_computer_inventory_v3, get_computer_v3, get_computer_inventory_detail_v3, update_computer_v3, delete_computer_v3) to replace deprecated v1 endpoint (2025-06-30) - Add send_mdm_command_v2() with ~25 new command models to replace the preview MDM endpoint removed from the API schema - Add upload_package_v1() for direct multipart file upload, replacing the deprecated JCDS v1 S3-based workflow (2025-08-28) without requiring boto3 - Add upload_package() to JCDS2 client using the new upload endpoint - Add HrefResponse model, v3 api_options (sections/sort/filter fields) - Add cfBundleShortVersionString and cfBundleVersion to ComputerApplication - Mark deprecated methods with DeprecationWarning (v1 inventory, JCDS v1, preview MDM commands) - Fix typo in api_options: "serAndLocation.buildingId" → "userAndLocation.buildingId" Co-Authored-By: Claude Opus 4.6 <[email protected]>
- test_models_pro_computers.py: ComputerApplication v1/v3 parsing, roundtrip, Computer model with/without plugins/fonts, extra fields - test_models_pro_mdm.py: all v2 MDM command models, MdmCommandRequest construction/serialization/parsing, CustomCommand, SettingsCommand extra fields Co-Authored-By: Claude Opus 4.6 <[email protected]>
| .coverage | ||
| .DS_Store | ||
| .vscode | ||
| api_schema |
There was a problem hiding this comment.
Is this the OpenAPI schema for Jamf Pro? extreme nit on my part, but I would omit this and just not commit the schema to the repository.
Alternatively, I do see value in creating an automation/github action that polls the schema for changes so we can keep the SDK in line with API changes as much as possible.
There was a problem hiding this comment.
I pulled the schema from Jamf Pro (https://server.jamfcloud.com/api/schema) and stored it locally as api_schema. This allowed Claude to determine the delta for new endpoint support and flag those requiring deprecation warnings. It’s been added to .gitignore to avoid bloating the repo by mistake. Feel free to remove it from the .gitignore if you please.
There was a problem hiding this comment.
These are great! my only follow up would be to update project docs with some info about these new additions.
Summary
This PR replaces deprecated Jamf Pro API endpoints with their supported alternatives, targeting Jamf Pro 11.25.0. All existing methods are preserved with
DeprecationWarningnotices, and new methods are added alongside them. No breaking changes.GET /v1/computers-inventory(deprecated 2025-06-30) withGET /v3/computers-inventoryPOST /preview/mdm/commands(removed from API schema) withPOST /v2/mdm/commandsPOST /v1/packages/{id}/uploadserAndLocation.buildingId→userAndLocation.buildingIdcfBundleShortVersionStringandcfBundleVersionfields toComputerApplicationDeprecation warnings
Calling any deprecated method will emit a
DeprecationWarningpointing to the replacement:Migration examples
Computer Inventory: v1 → v3
MDM Commands: preview → v2
Package Upload: JCDS v1 (S3/boto3) → direct upload
Files changed
src/jamf_pro_sdk/models/pro/api_options.pysrc/jamf_pro_sdk/models/pro/computers.pycfBundleShortVersionString/cfBundleVersiontoComputerApplicationsrc/jamf_pro_sdk/models/pro/mdm.pyMdmCommandRequestsrc/jamf_pro_sdk/models/pro/__init__.pyHrefResponsemodelsrc/jamf_pro_sdk/clients/pro_api/__init__.pyupload_package_v1,send_mdm_command_v2, deprecation warningssrc/jamf_pro_sdk/clients/jcds2.pyupload_package(), deprecateupload_file()tests/unit/models/test_models_pro_computers.pytests/unit/models/test_models_pro_mdm.pyTest plan
pytest tests/unit/ -v)upload_package_v1