We're doing our annual cleanup/creation of Google Classrooms, and I recently ran the following:
gam print courses todrive fields id,name,section,description,coursestate,creationtime,updatetime timefilter creationtime start 2021-07-15
This "got" 40,759 courses, which represents all of the Google Classrooms in our domain ... but when I opened the Google Sheet, there were 9,057 listed that matched my creationtime criteria, which is what I expected. So far so good.
The "problem" comes when I add the alias parameter:
gam print courses todrive alias fields id,name,section,description,coursestate,creationtime,updatetime timefilter creationtime start 2021-07-15
After getting the 40,759 courses, the output appears as such:
Got 1 Alias for Course: COURSEID1 (1/40759)...
Got 1 Alias for Course: COURSEID2 (2/40759)...
So it appears that GAM is attempting to retrieve the alias for all 40,759 courses (which requires a separate API call per course). It seems like it would be much more efficient to only grab the alias for the courses that match the creationtime filter (GAM seems to behave this way when filtering by course state), especially because the last time I ran the command, I got the following at the end:
Got 0 Aliases for Course: COURSEID9034 (9034/40759)...
Got 0 Aliases for Course: COURSEID9035 (9035/40759)...
Data uploaded to Drive File:
API calls retry data
The service is currently unavailable.: 1/0:00:02
The link did point to a spreadsheet that only listed 9,035 Classrooms and all of them included the alias and met the creationtime filter. Normally I would think that the "service currently unavailable" error hosed the command, but the fact that it did give me a spreadsheet was interesting.
Is GAM actually filtering by creationtime before it retrieves the aliases with the (NNN/NNNNN) count information just being inaccurate? Or is it actually attempting to retrieve aliases for all Classrooms, then applying the creationtime filter (and possibly timing out)?
Thanks,
Shaun