Skip to main content
Question

JSS API Bug? JSON Storage->Device->Partition


Forum|alt.badge.img+5

I am currently playing around with creating a Cocoa app to do some admin tasks. Part of the design is to download a computer record from the API and turn them into Swift Objects. I have found that there have been a few instances where the XML is different to the JSON. One in particular is the partition information is not an array in JSON output whereas it is in the XML output.

For example if you look at http://yourJSS:8443/api and go to /computers/id/{id} and "try out" an id with multiple partitions on the disk. Then look at the XML info for Hardware->Storage->Device->Partition its an array. Now look at the same in the JSON code and it will only display the info for the last partition.

If this is a bug, how do I report it?

2 replies

Forum|alt.badge.img+1
  • New Contributor
  • 2 replies
  • November 11, 2016

I'm seeing this same thing. If I look at a device via the api in a web browser, I see all the partitions. If I make the call to the API via a script (PowerShell, in my case), I'm only seeing a single partition.


Forum|alt.badge.img+1
  • New Contributor
  • 2 replies
  • November 15, 2016

Just in case anyone else finds this, that is in fact a bug in the json. Jamf support said it is PI-002662. The solution is to have the api return xml. You can make this happen by forcing a header. Here's what it looks like in powershell.

Invoke-RestMethod -uri "https://casperSite/JSSResource/computers/id/$id" -Credential $creds -Headers @{"Accept"="application/xml"}

Good luck!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings