-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexamples.sh
48 lines (30 loc) · 2.2 KB
/
examples.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
#GET /computers
/usr/bin/curl -sku "username:password" https://instance.jamfcloud.com/JSSResource/computers
#GET /mobiledevices
/usr/bin/curl -sku "username:password" https://instance.jamfcloud.com/JSSResource/mobiledevices -X GET
#### TASK 1 ####
# Try more GET API actions on other endpoints. See what information is
# returned and if it looks familiar to the GUI.
####################################################################################################################
####################################################################################################################
#GET /mobiledevices/id/___
/usr/bin/curl -sku "username:password" https://instance.jamfcloud.com/JSSResource/mobiledevices/id/8
#### TASK 2 ####
# Try additional endpoints with alternate IDs.
# Update the name of a policy via the GUI. Verify the name took place via API.
####################################################################################################################
####################################################################################################################
#GET - Retrieve Serial Number of /mobiledevices/id/___
/usr/bin/curl -sku "username:password" https://instance.jamfcloud.com/JSSResource/mobiledevices/id/8 | xmllint --xpath '/mobile_device/general/serial_number/text()' - 2>/dev/null
#### TASK 3 ####
# Retrieve only the name of the policy you updated in the previous task.
####################################################################################################################
####################################################################################################################
#PUT - Update Asset Tag for /mobiledevices/id/___
/usr/bin/curl -sku "username:password" https://instance.jamfcloud.com/JSSResource/mobiledevices/id/8 -H "Content-type: application/xml" -X PUT -d "<mobile_device><general><asset_tag>ASSETTAG</asset_tag></general></mobile_device>"
#### TASK 4 ####
# Assign an asset tag to a computer of your choice via API.
# Verify the asset tag was changed appropriately via the API.
# Change the name of the policy in the previous task via API.
# Retrieve only the name of the policy you updated in the previous task.