-
Remove any calls to
JSSObjectList.retrieve(). The objects will fetch themselves when any attribute or method that needs the data is accessed. -
Consider whether to remove any
JSSObjectList.retrieve_all()calls, as items will fetch themselves as they are accessed. -
Queries with the
JSSmethods named afterJSSObjects (e.g.JSS.Computer) use optional kwargs for all "extra" query data, rather than a specificsubsetarg. Ensure all queries use keyword arguments rather than positional For example,j.Computer('MacBook', 'general') must becomej.Computer('MacBook', subset='general')`. -
Some objects had helper
@propertyattribute-like methods. These have all been removed in favor of.notation to access elements.For example,
some_computer.serial_numberjust found the serial_number Element and returned the text. Now must dosome_computer.general.serial_number.text. You can also doprint some_computer.general.serial_numberand it will pretty print the entireElement.- This change means you will always get an
Element; if you want the text, you must then append the.textattribute.some_computer.general.serial_numberreturns the "serial_number"Elementsome_computer.general.serial_number.textreturns the computer's serial number as a string.
- Specifically, the following methods have been removed in favor of dot
notation:
Computer/MobileDevice:udid()serial_number()
ComputerGroup.criteria()MobileDevice.wifi_mac_address()MobileDevice.bluetooth_mac_address()Policy:general()enabled()frequency()category()scope()computers()computer_groups()buildings()departments()exclusions()excluded_computers()excluded_computer_groups()excluded_buildings()excluded_departments()self_service()use_for_self_service()pkg_config()pkgs()maintenance()recon()
- Hint: Use the new
tree()method on an instance of a class to see the tag structure needed to reference any subelement.
- This change means you will always get an
- Some things have been renamed; this is primarily for classes used internally,
but if you use them for type-enforcement or checking, you will need to update
your code:
- Update references to
JSSObjectListto beQuerySet. If instantiating any directly, please note the signature has changed. JSSContainerObjectis now justContainerJSSGroupObjectis now justGroup
- Update references to
- Pickled data that references renamed or removed classes will not load. If you need this data, you'll need to convert it, or keep a copy of pre-2.0 python-jss around. If this is a big deal for your use, please file an issue and we can work on a converter.
JSSObjectFactoryhas been retired. Indirectly created objects using theJSSObjectFactoryshould be converted to use either theJSSconstructor / search methods or the class itself.- The following exception classes have been replaced with
TypeError:JSSUnsupportedSearchMethodErrorJSSUnsupportedFileTypeJSSFileUploadParameterErrorJSSPrefsMissingKeyError
JSSPrefsMissingFileErrorhas been replaced withIOError:JSSMethodNotAllowedErroris now calledMethodNotAllowedError.- Renamed all of the request-failure exceptions by dropping the
JSS:JSSGetError->GetErrorJSSPutError->PutErrorJSSPostError->PostErrorJSStDeleteError->DeleteError