Open staze opened 4 years ago
Yep. when i wrote jamfcloud native uploads into python-jss it was hit and miss. Some packages would stay in pending forever, so they pulled it from JSSImporter. Until JAMF supply an upload API im not sure if i could make this solution stable.
bummer. know of any other options for making something like this work? trying to get cloud dp sync'd down to on-prem in an automated fashion (so on-prem devices pull from the on-prem DPs).
Thanks!
A dumb way might be to enroll a mac and have every package in the policy listed as cached, then share the package cache out as a DP
🤮
I've seen that mentioned elsewhere. gah.
Uploads to Jamf cloud via API are very much working now, ala:
apiUsername=your_api_user
apiPassword=your_api_password
jssServer=https://your.jss.com:443 (or 8443 if onprem)
authToken=$( /usr/bin/curl \
--request POST \
--silent \
--url "$jssServer/api/v1/auth/token" \
--user "$apiUsername:$apiPassword" )
echo "$authToken"
token=$( /usr/bin/plutil \
-extract token raw - <<< "$authToken" )
tokenExpiration=$( /usr/bin/plutil \
-extract expires raw - <<< "$authToken" )
localTokenExpirationEpoch=$( TZ=GMT /bin/date -j \
-f "%Y-%m-%dT%T" "$tokenExpiration" \
+"%s" 2> /dev/null )
echo Token: "$token"
echo Expiration: "$tokenExpiration"
echo Expiration epoch: "$localTokenExpirationEpoch"
curl -L -o digitPackageName.pkg -H "Authorization: Bearer $token" 'https://your.jss.com:443/JSSResource/packages/digitPackageName.pkg' -X POST
Yeah I'm sorry guys I don't even have jamf anymore so should probably archive the project. There's no way I can even get access
Trying to get this to work, and it seems like it might rely on an older python-jss (Looks like jcds support was removed... https://github.com/jssimporter/JSSImporter/issues/152).