Home

Awesome

JamfKit

<p align="center"><img src="Assets/JamfKit_256.png" alt="JamfKit"></p>

Swift iOS macOS tvOS

Travis branch Codecov Codacy grade Carthage compatible CocoaPods

JamfKit is an iOS / macOS / tvOS framework to communicate with the JSS API offered by any Jamf host.

Summary

Features

Installation

Carthage

To integrate JamfKit into your project, add the following line in your Cartfile:

github "Ethenyl/JamfKit"

Then run the following command:

$ carthage update

Cocoapods

To integrate JamfKit into your project, add the following line in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'JAMFKit'
end

Then run the following command:

$ pod install

Architecture

Protocols

ProtocolDescription
EndpointRepresents any JSS object that is matched by a JSS endpoint.
IdentifiableRepresents any JSS object that can be identified (either by ID or by name).
RequestableRepresents an object that can be used to perform requests with any JSS endpoint.
SubsetRepresents any JSS object that contains a general object that can identify it.

Requestable conformance

The class that conform to Requestable exposes the following elements:

Classes

ClassDesscription
BaseObjectRepresents the common denominator between most of the JSS objects which must contains at least an identifier and a name properties.
BuildingRepresents a physical building.
ComputerRepresents a computer managed by Jamf, contains the general / location / purchasing information about the hardware.
ComputerCommandRepresents a logical command that can be executed on any hardware element manageg by Jamf.
ComputerConfigurationProfileRepresents a logical configuration profile that can be applied to any computer managed by Jamf.
ComputerGroupRepresents a group of computers managed by Jamf, contains grouping information.
DepartmentRepresents a physical department.
DirectoryBindingRepresents a logical binding between a computer and an active directory user.
MobileDeviceConfigurationProfileRepresents a logical configuration profile that can be applied to any mobile device managed by Jamf.
MobileDeviceRepresents a mobile device managed by Jamf, contains the general information about the device.
MobileDeviceGroupRepresents a group of mobile devices managed by Jamf, contains grouping information.
NetbootServerRepresents a physical netboot server, contains information about the server and it's configuration.
NetworkSegmentRepresents a physical network segment, contains information about the segment and it's configuration.
PackageRepresents a logical application package, contains information about the application requirements and capabilities.
PartitionRepresents a logical partition for an hard drive installed inside an hardware element managed by Jamf.
PolicyReprents as logical policy that can be applied to any hardware element managed by Jamf.
PreciseDateRepresents a logical date within JSS api, contains 3 properties, the date itself, an epoch variant of the date and an UTC version of the date.
PrinterRepresents a physical printer, contains information about the printer and it's configuration.
ScriptRepresents a logical script that can be executed on one (or more) machine managed by Jamf.
SiteRepresents a physical location (building, office, etc.).
SMTPServerRepresents the physical SMTP server configuration.
UserRepresents a Jamf user and contains the identification properties that are required to contact the actual user and identify the hardware devices assigned to him / her.

Usage

Getting started

Playgrounds

To get a quick look on how you can use JamfKit in your Jamf related features, you can check the Playgrounds included within the workspace.

Also check the unit tests, they should cover most of your needs.

Models

Most of the classes can be initialized with the bare minimul values, all the properties are then available for modification.

Requests

By adhering to the different CRUD protocols (Creatable, Readable, Updatable & Deletable), most of the JSS objects listed above are capable of supplying varying URLRequest that should fit any needs.

You'll find below the basic functions to get URLRequest:

FunctionTypeHTTP MethodExampleOutput
createRequest()instancePOSTbuilding.createRequest()http://jss.host/jss/objects/1
readAllRequest()staticGETBuilding.readAllRequest()http://jamf.com/jss/objects
readRequest(identifier:)staticGETBuilding.readRequest(identifier: "12345")http://jamf.com/jss/objects/1
readRequest()instanceGETbuilding.readRequest()http://jamf.com/jss/objects/1
updateRequest()instancePUTbuilding.updateRequest()http://jamf.com/jss/objects/1
deleteRequest(identifier:)staticDELETEBuilding.deleteRequest(identifier: "12345")http://jamf.com/jss/objects/1
deleteRequest()instanceDELETEbuilding.deleteRequest()http://jamf.com/jss/objects/1

Some objects will offer variants of those requests, like MobileDevice with readRequestWithName() or deleteRequestWithSerialNumber() (with both static and instance variants).

Contributing

So, you want to help improve JamfKit? That's great! Any useful contribution is welcome!

Check CONTRIBUTING for more details on how you can contribute to JamfKit.

Code of conduct

Any contributions (issues, pull requests, comments, etc.) to JamfKit are more than welcome.

But before making any contribution, please make sure that you follow the CODE OF CONDUCT.

Otherwise, there's a great chance that your contribution will be removed / blocked / hidden.

FAQ

None for the moment.

Credits

JamfKit is owned and maintained by Ethenyl.

You can join the list by contributing to the repository.

License

JamfKit is released under the MIT license. See LICENSE for more details.