API returns limited results via VM

thoule
Valued Contributor II
curl -H "Accept: application/xml" -ku "name:topsecretword" "https://myjss.school.edu:8443/JSSResource/advancedcomputersearches/id/94" -X GET

This command returns different results if I run it through a VM on my ESXi server. I've tried multiple VMs and multiple hardware workstations and had very consistent results. I don't have a local VM to test with there.

Group 94 has 54 members. When I run that command on hardware, I get 54 responses. When I run that command via my VM, I get 10 members.

Group 74 has 11 members. Hardware shows me all 11, while my vm shows me <computers><size>0</size></computers> (no members).

All computers are running 10.11.6, fully patched. Why would curl on hardware or a vm matter? JSS 9.82

2 REPLIES 2

thoule
Valued Contributor II

Update: it's not a VM issue. It's JSS1 vs JSS2. I can get either expected results or limited results by running the curl against either JSS in the environment. It just so happened that my VMs were using JSS1 and hardware was using JSS2 when hitting the load balancer.

thoule
Valued Contributor II

Update2: Its only one Advanced Search that does this. I get a subset from one JSS, but the full list from the other JSS. I'm calling it a corrupted saved search.

bash-3.2# curl -H "Accept: application/xml" -ku "api:sekret" "https://SERVER1.school.edu:8443/JSSResource/advancedcomputersearches/id/74" -X GET
<?xml version="1.0" encoding="UTF-8"?><advanced_computer_search><id>74</id><name>!! 44 Day No Inventory</name><view_as>Standard Web Page</view_as><sort_1/><sort_2/><sort_3/><criteria><size>1</size><criterion><name>Last Inventory Update</name><priority>0</priority><and_or>and</and_or><search_type>more than x days ago</search_type><value>44</value></criterion></criteria><display_fields><size>8</size><display_field><name>Department</name></display_field><display_field><name>Operating System</name></display_field><display_field><name>Last Inventory Update</name></display_field><display_field><name>Last Enrollment</name></display_field><display_field><name>Last Check-in</name></display_field><display_field><name>Computer Name</name></display_field><display_field><name>Asset Tag</name></display_field><display_field><name>Full Name</name></display_field></display_fields><computers><size>0</size></computers><site><id>-1</id><name>None</name></site></advanced_computer_search>
bash-3.2# 
bash-3.2# 
bash-3.2# curl -H "Accept: application/xml" -ku "api:sekret" "https://SERVER2.school.edu:8443/JSSResource/advancedcomputersearches/id/74" -X GET
<?xml version="1.0" encoding="UTF-8"?><advanced_computer_search><id>74</id><name>!! 44 Day No Inventory</name><view_as>Standard Web Page</view_as><sort_1/><sort_2/><sort_3/><criteria><size>1</size><criterion><name>Last Inventory Update</name><priority>0</priority><and_or>and</and_or><search_type>more than x days ago</search_type><value>44</value></criterion></criteria><display_fields><size>8</size><display_field><name>Department</name></display_field><display_field><name>Operating System</name></display_field><display_field><name>Last Inventory Update</name></display_field><display_field><name>Last Enrollment</name></display_field><display_field><name>Last Check-in</name></display_field><display_field><name>Computer Name</name></display_field><display_field><name>Asset Tag</name></display_field><display_field><name>Full Name</name></display_field></display_fields><computers><size>9</size><computer><id>2438</id><name>SNIP SNIP SNIP - SNIP SNIP SNIP <computers><site><id>-1</id><name>None</name></site></advanced_computer_search>