Added command to get customer app details.

This commit is contained in:
Ross Scroggs
2023-10-12 09:03:03 -07:00
parent 994d489226
commit d500196dee
12 changed files with 94 additions and 17 deletions

View File

@ -931,7 +931,7 @@ This will prevent the limited user from having any client access.
Perform these steps:
Create a a new service account in your project that will be used for the limited user;
this will create `outh2service.json`.
this will create `oauth2service.json`.
```
gam add svcacct saname "gam-limited" sadisplayname "GAM Limited"
```

View File

@ -4,6 +4,7 @@
- [API documentation](#api-documentation)
- [Definitions](#definitions)
- [Quoting rules](#quoting-rules)
- [Display Chrome installed app details](#display-chrome-installed-app-details)
- [Display Chrome installed apps counts](#display-chrome-installed-apps-counts)
- [Display Chrome devices with a specific installed application](#display-chrome-devices-with-a-specific-installed-application)
@ -19,6 +20,7 @@ the appropriate scope: `Chrome Management API - read only`.
gam update project
gam oauth create
```
To get installed app details you must authorize the scope: `Chrome Management API - AppDetails read only`.
## Definitions
```
@ -47,6 +49,14 @@ Typically, you will enclose the entire list in double quotes and quote each item
- Items, separated by spaces, with spaces, commas or single quotes in the items themselves
* ```"'it em' 'it,em' \"it'em\""```
## Display Chrome installed app details
```
gam info appdetails android|chrome|web <AppID>
[formatjson]
```
By default, Gam displays the information as an indented list of keys and values.
* `formatjson` - Display the fields in JSON format.
```
## Display Chrome installed apps counts
```
gam show chromeapps

View File

@ -17,7 +17,7 @@ To embed a `'` in a string enclosed in `"`, enter `'`; `name "Test'Group"`.
To embed a `"` in a string enclosed in `'`, enter `"`; `name 'Test"Group'`.
To embed a `'` in a string enclosed in `'`, enter `'\''"`; `name 'Test'\''Group'`.
To embed a `'` in a string enclosed in `'`, enter `'\''`; `name 'Test'\''Group'`.
To embed a `"` in a string enclosed in `"`, enter `\"`; `name "Test\"Group"`.

View File

@ -10,6 +10,18 @@ Add the `-s` option to the end of the above commands to suppress creating the `g
See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation.
### 6.64.13
Added command to get customer app details.
```
gam info appdetails android|chrome|web <AppID> [formatjson]
```
### 6.64.12
Upgraded to Python 3.12.0 where possible.
Upgraded to OpenSSL 3.1.3 where possible.
### 6.64.11
Added support for Google Workspace Labs license.

View File

@ -334,7 +334,7 @@ writes the credentials into the file oauth2.txt.
admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt
admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
GAMADV-XTD3 6.64.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.64.13 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.10.8 64-bit final
MacOS High Sierra 10.13.6 x86_64
@ -984,9 +984,9 @@ writes the credentials into the file oauth2.txt.
C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt
C:\GAMADV-XTD3>gam version
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
GAMADV-XTD3 6.64.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.64.13 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.5 64-bit final
Python 3.12.0 64-bit final
Windows-10-10.0.17134 AMD64
Path: C:\GAMADV-XTD3
Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, customer_id: my_customer, domain.com

View File

@ -4,9 +4,9 @@
Print the current version of Gam with details
```
gam version
GAMADV-XTD3 6.64.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.64.13 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.5 64-bit final
Python 3.12.0 64-bit final
MacOS Monterey 12.6.6 x86_64
Path: /Users/Admin/bin/gamadv-xtd3
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain.com
@ -16,9 +16,9 @@ Time: 2023-06-02T21:10:00-07:00
Print the current version of Gam with details and time offset information
```
gam version timeoffset
GAMADV-XTD3 6.64.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.64.13 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.5 64-bit final
Python 3.12.0 64-bit final
MacOS Monterey 12.6.6 x86_64
Path: /Users/Admin/bin/gamadv-xtd3
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain.com
@ -28,9 +28,9 @@ Your system time differs from www.googleapis.com by less than 1 second
Print the current version of Gam with extended details and SSL information
```
gam version extended
GAMADV-XTD3 6.64.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
GAMADV-XTD3 6.64.13 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.5 64-bit final
Python 3.12.0 64-bit final
MacOS Monterey 12.6.6 x86_64
Path: /Users/Admin/bin/gamadv-xtd3
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain.com
@ -65,7 +65,7 @@ MacOS High Sierra 10.13.6 x86_64
Path: /Users/Admin/bin/gamadv-xtd3
Version Check:
Current: 5.35.08
Latest: 6.64.11
Latest: 6.64.13
echo $?
1
```
@ -73,7 +73,7 @@ echo $?
Print the current version number without details
```
gam version simple
6.64.11
6.64.13
```
In Linux/MacOS you can do:
```
@ -83,9 +83,9 @@ echo $VER
Print the current version of Gam and address of this Wiki
```
gam help
GAM 6.64.11 - https://github.com/taers232c/GAMADV-XTD3
GAM 6.64.13 - https://github.com/taers232c/GAMADV-XTD3
Ross Scroggs <ross.scroggs@gmail.com>
Python 3.11.5 64-bit final
Python 3.12.0 64-bit final
MacOS Monterey 12.6.6 x86_64
Path: /Users/Admin/bin/gamadv-xtd3
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain.com

View File

@ -67,7 +67,7 @@ Client Access
* [Chrome Auto Update Expiration Counts](Chrome-AUE-Counts)
* [Chrome Browser Cloud Management](Chrome-Browser-Cloud-Management)
* [Chrome Device Needs Attention Counts](Chrome-Needs-Attention-Counts)
* [Chrome Installed Apps Counts](Chrome-Installed-Apps-Counts)
* [Chrome Installed Apps](Chrome-Installed-Apps)
* [Chrome Policies](Chrome-Policies)
* [Chrome Printers](Chrome-Printers)
* [Chrome Version Counts](Chrome-Version-Counts)

View File

@ -2502,7 +2502,10 @@ gam create chromenetwork
gam delete chromenetwork
<OrgUnitItem> <NetworkID>
# Chrome Apps/Versions
# Chrome Apps/Details/Versions
gam info appdetails android|chrome|web <AppID>
[formatjson]
gam show chromeapps
[(ou <OrgUnitItem>)|(ou_and_children <OrgUnitItem>)|

View File

@ -1,3 +1,15 @@
6.64.13
Added command to get customer app details.
```
gam info appdetails android|chrome|web <AppID> [formatjson]
```
6.64.12
Upgraded to Python 3.12.0 where possible.
Upgraded to OpenSSL 3.1.3 where possible.
6.64.11
Added support for Google Workspace Labs license.

View File

@ -24088,6 +24088,38 @@ def doInfoPrintShowCrOSTelemetry():
if csvPF:
csvPF.writeCSVfile('CrOS Devices Telemetry')
APP_DETAILS_TIME_OBJECTS = {'firstPublishTime', 'latestPublishTime'}
APP_DETAILS_TYPE_CHOICES = ['android', 'chrome', 'web']
# gam info appdetails android|chrome|web <AppID> [formatjson]
def doInfoAppDetails():
cm = buildGAPIObject(API.CHROMEMANAGEMENT_APPDETAILS)
mode = getChoice(APP_DETAILS_TYPE_CHOICES)
app_id = getString(Cmd.OB_APP_ID)
FJQC = FormatJSONQuoteChar()
while Cmd.ArgumentsRemaining():
myarg = getArgument()
FJQC.GetFormatJSON(myarg)
if mode == 'chrome':
service = cm.customers().apps().chrome()
elif mode == 'android':
service = cm.customers().apps().android()
else:
service = cm.customers().apps().web()
try:
appDetails = callGAPI(service, 'get',
throwReasons=[GAPI.BAD_REQUEST, GAPI.NOT_FOUND, GAPI.FORBIDDEN],
name=f'customers/{GC.Values[GC.CUSTOMER_ID]}/apps/{mode}/{app_id}')
if FJQC.formatJSON:
printLine(json.dumps(cleanJSON(appDetails), ensure_ascii=False, sort_keys=True))
return
printEntity([Ent.APP_ID, app_id])
Ind.Increment()
showJSON(None, appDetails, timeObjects=APP_DETAILS_TIME_OBJECTS)
Ind.Decrement()
except (GAPI.badRequest, GAPI.notFound, GAPI.forbidden):
checkEntityAFDNEorAccessErrorExit(None, Ent.APP_ID, app_id)
# gam delete browser <DeviceID>
def doDeleteBrowsers():
cbcm = buildGAPIObject(API.CBCM)
@ -70030,6 +70062,7 @@ MAIN_COMMANDS_WITH_OBJECTS = {
(Act.INFO,
{Cmd.ARG_ADMINROLE: doInfoAdminRole,
Cmd.ARG_ALERT: doInfoAlert,
Cmd.ARG_APPDETAILS: doInfoAppDetails,
Cmd.ARG_ALIAS: doInfoAliases,
Cmd.ARG_BUILDING: doInfoBuilding,
Cmd.ARG_BROWSER: doInfoBrowsers,

View File

@ -32,6 +32,7 @@ CHAT_MESSAGES = 'chatmessages'
CHAT_SPACES = 'chatspaces'
CHAT_SPACES_DELETE = 'chatspacesdelete'
CHROMEMANAGEMENT = 'chromemanagement'
CHROMEMANAGEMENT_APPDETAILS = 'chromemanagementappdetails'
CHROMEMANAGEMENT_TELEMETRY = 'chromemanagementtelemetry'
CHROMEPOLICY = 'chromepolicy'
CHROMEVERSIONHISTORY = 'versionhistory'
@ -195,6 +196,7 @@ _INFO = {
CHAT_SPACES_DELETE: {'name': 'Chat API - Spaces Delete', 'version': 'v1', 'v2discovery': True, 'mappedAPI': CHAT},
CLASSROOM: {'name': 'Classroom API', 'version': 'v1', 'v2discovery': True},
CHROMEMANAGEMENT: {'name': 'Chrome Management API', 'version': 'v1', 'v2discovery': True},
CHROMEMANAGEMENT_APPDETAILS: {'name': 'Chrome Management API - AppDetails', 'version': 'v1', 'v2discovery': True, 'mappedAPI': CHROMEMANAGEMENT},
CHROMEMANAGEMENT_TELEMETRY: {'name': 'Chrome Management API - Telemetry', 'version': 'v1', 'v2discovery': True, 'mappedAPI': CHROMEMANAGEMENT},
CHROMEPOLICY: {'name': 'Chrome Policy API', 'version': 'v1', 'v2discovery': True},
CHROMEVERSIONHISTORY: {'name': 'Chrome Version History API', 'version': 'v1', 'v2discovery': True},
@ -266,6 +268,10 @@ _CLIENT_SCOPES = [
'api': CHROMEMANAGEMENT,
'subscopes': [],
'scope': 'https://www.googleapis.com/auth/chrome.management.reports.readonly'},
{'name': 'Chrome Management API - AppDetails read only',
'api': CHROMEMANAGEMENT_APPDETAILS,
'subscopes': [],
'scope': 'https://www.googleapis.com/auth/chrome.management.appdetails.readonly'},
{'name': 'Chrome Management API - Telemetry read only',
'api': CHROMEMANAGEMENT_TELEMETRY,
'subscopes': [],

View File

@ -428,6 +428,7 @@ class GamCLArgs():
ARG_APIS = 'apis'
ARG_APIPROJECT = 'apiproject'
ARG_APPACCESSSETTINGS = 'appaccesssettings'
ARG_APPDETAILS = 'appdetails'
ARG_APPLICATIONSPECIFICPASSWORDS = 'applicationspecificpasswords'
ARG_ASP = 'asp'
ARG_ASPS = 'asps'