From cc50ae28cdb564c40c6907c8755252e7ce0d3656 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Sat, 13 Jan 2024 17:18:45 -0800 Subject: [PATCH] Cleaned up `Getting/Got` messages for `gam print courses|course-participants`. --- docs/ChromeOS-Devices.md | 17 +++++++++ docs/Classroom-Courses.md | 18 ++++++++++ docs/Classroom-Membership.md | 23 ++++++++++++ docs/Cloud-Identity-Devices.md | 45 ++++++++++++++++++++++++ docs/Cloud-Identity-Groups.md | 15 ++++++++ docs/GamUpdates.md | 6 +++- docs/Groups.md | 17 +++++++++ docs/How-to-Upgrade-from-Standard-GAM.md | 4 +-- docs/Mobile-Devices.md | 17 +++++++++ docs/Organizational-Units.md | 16 +++++++++ docs/Resources.md | 16 +++++++++ docs/Users.md | 16 +++++++++ docs/Version-and-Help.md | 12 +++---- src/GamUpdate.txt | 6 +++- src/gam/__init__.py | 15 ++++---- 15 files changed, 225 insertions(+), 18 deletions(-) diff --git a/docs/ChromeOS-Devices.md b/docs/ChromeOS-Devices.md index a9ac66c3..c1b3b27b 100644 --- a/docs/ChromeOS-Devices.md +++ b/docs/ChromeOS-Devices.md @@ -695,6 +695,23 @@ gam print cros (cros_ous )|(cros_ous_and_children )]] showitemcountonly ``` +Example +``` +$ gam print cros query "sync:..2020-01-01" showitemcountonly +Getting all CrOS Devices that match query (sync:..2020-01-01) for /, may take some time on a large Organizational Unit... +Got 77 CrOS Devices that matched query (sync:..2020-01-01) for /... +Got 77 CrOS Devices that matched query (sync:..2020-01-01) +77 +``` +The `Getting` and `Got` messages are written to stderr, the count is writtem to stdout. + +To retrieve the count with `showitemcountonly`: +``` +Linux/MacOS +count=$(gam print cros query "sync:..2020-01-01" showitemcountonly) +Windows PowerShell +count = & gam print cros query "sync:..2020-01-01" showitemcountonly +``` ## Print ChromeOS device activity diff --git a/docs/Classroom-Courses.md b/docs/Classroom-Courses.md index 8454e87b..2b807505 100644 --- a/docs/Classroom-Courses.md +++ b/docs/Classroom-Courses.md @@ -441,6 +441,24 @@ gam print courses [owneremailmatchpattern ] showitemcountonly ``` +Example +``` +$ gam print courses states active showitemcountonly +Getting all Courses that match query (Course State: ACTIVE), may take some time on a large Google Workspace Account... +Got 268 Courses... +Got 272 Courses... +Got 272 Courses... +272 +``` +The `Getting` and `Got` messages are written to stderr, the count is writtem to stdout. + +To retrieve the count with `showitemcountonly`: +``` +Linux/MacOS +count=$(gam print courses states active showitemcountonly) +Windows PowerShell +count = & gam print courses states active showitemcountonly +``` ## Display course announcements ``` diff --git a/docs/Classroom-Membership.md b/docs/Classroom-Membership.md index 996a83dc..e999f081 100644 --- a/docs/Classroom-Membership.md +++ b/docs/Classroom-Membership.md @@ -141,3 +141,26 @@ gam print course-participants [show all|students|teachers] showitemcountonly ``` +Example +``` +$ gam print course-participants teacher asmith states active show students showitemcountonly +Getting all Courses that match query (Teacher: asmith@domain.com, Course State: ACTIVE), may take some time on a large Google Workspace Account... +Got 3 Courses... +Getting Students for Course: 636981507234 (1/3) +Got 30 Students... +Got 43 Students... +Getting Students for Course: 589346784341 (2/3) +Got 22 Students... +Getting Students for Course: 589345535881 (3/3) +Got 23 Students... +88 +``` +The `Getting` and `Got` messages are written to stderr, the count is writtem to stdout. + +To retrieve the count with `showitemcountonly`: +``` +Linux/MacOS +count=$(gam print course-participants teacher asmith states active show students showitemcountonly) +Windows PowerShell +count = & gam print course-participants teacher asmith states active show students showitemcountonly +``` diff --git a/docs/Cloud-Identity-Devices.md b/docs/Cloud-Identity-Devices.md index 4539dd6d..e68da9ed 100644 --- a/docs/Cloud-Identity-Devices.md +++ b/docs/Cloud-Identity-Devices.md @@ -235,6 +235,28 @@ gam print devices [all|company|personal|nocompanydevices|nopersonaldevices] showitemcountonly ``` +Example +``` +$ gam print devices queries "'model:Mac'" showitemcountonly +Getting all Devices that match query (model:Mac), may take some time on a large Google Workspace Account... +Got 100 Devices... +Got 200 Devices... +Got 300 Devices... +... +Got 900 Devices... +Got 995 Devices... +Got 995 Devices... +995 +``` +The `Getting` and `Got` messages are written to stderr, the count is writtem to stdout. + +To retrieve the count with `showitemcountonly`: +``` +Linux/MacOS +count=$(gam print devices queries "'model:Mac'" showitemcountonly) +Windows PowerShell +count = & gam print devices queries "'model:Mac'" showitemcountonly +``` ## Approve or block device users Approve or block user profiles on a device. @@ -304,6 +326,29 @@ gam print deviceusers [todrive *] [(query )|(queries ) (querytime