jssimporter / python-jss

python-jss is deprecated. Please see the wiki for alternatives.
GNU General Public License v3.0
102 stars 41 forks source link

Search for a computer using MAC address #67

Closed gkluoe closed 5 years ago

gkluoe commented 6 years ago

I think this is a bug.

https://github.com/sheagcraig/python-jss/blob/e1982466bd7e971f27525cbc31024590a456df66/jss/jssobjects.py#L186

macadress != macaddress :-)

gkluoe commented 6 years ago

With the result that

j.Computer('macaddress=xx:xx:xx:xx:xx:xx')

doesn't work. (Response Code: 404 Response: Not Found.)

j.get('/computers/macaddress/xx:xx:xx:xx:xx:xx')

does work, but returns XML (as expected) rather than a Computer

sheagcraig commented 6 years ago

Well, I think they changed the API. I could be wrong, but this definitely used to work.

Looking at the Jamf Pro API docs you have to new endpoints for /computers/macaddress, and you have to do /computers/match/macaddress=... to do this.

This will have to be updated.

gkluoe commented 6 years ago

Ah, interesting. I actually fixed this in my local copy just by fixing the typo in 'macadress' that I highlighted above. That was a while ago so perhaps the API has changed since then.

sheagcraig commented 6 years ago

Oh, maybe it does work still then, even though the docs don't specify. I totally missed the spelling error. I'll fix the spelling at least.

mosen commented 6 years ago

Seems to be fixed in testing branch.