mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-16 20:21:37 +00:00
Compare commits
18 Commits
20250202.1
...
20250207.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8cd378ff8f | ||
|
|
c0e037dda5 | ||
|
|
b5730aadce | ||
|
|
4ec58bb844 | ||
|
|
3ba99582dc | ||
|
|
b61a4f5115 | ||
|
|
7ce83b4623 | ||
|
|
a58a998b49 | ||
|
|
4e04bd7c51 | ||
|
|
779ac0a6a0 | ||
|
|
f18b7258bb | ||
|
|
d4932c9d39 | ||
|
|
352845e482 | ||
|
|
ff49c67580 | ||
|
|
efee86cd33 | ||
|
|
a42eebdae1 | ||
|
|
05333d9521 | ||
|
|
b04ba4b618 |
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -17,7 +17,7 @@ defaults:
|
||||
working-directory: src
|
||||
|
||||
env:
|
||||
SCRATCH_COUNTER: 7
|
||||
SCRATCH_COUNTER: 9
|
||||
OPENSSL_CONFIG_OPTS: no-fips --api=3.0.0
|
||||
OPENSSL_INSTALL_PATH: ${{ github.workspace }}/bin/ssl
|
||||
OPENSSL_SOURCE_PATH: ${{ github.workspace }}/src/openssl
|
||||
@@ -129,7 +129,7 @@ jobs:
|
||||
with:
|
||||
path: |
|
||||
cache.tar.xz
|
||||
key: gam-${{ matrix.jid }}-20250116
|
||||
key: gam-${{ matrix.jid }}-20250204
|
||||
|
||||
- name: Untar Cache archive
|
||||
if: matrix.goal == 'build' && steps.cache-python-ssl.outputs.cache-hit == 'true'
|
||||
|
||||
32
.github/workflows/pypi.yml
vendored
Normal file
32
.github/workflows/pypi.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: build and publish releases to PyPi
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+'
|
||||
|
||||
jobs:
|
||||
pypi:
|
||||
name: Upload release to PyPI
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: pypi
|
||||
url: https://pypi.org/p/gam7
|
||||
permissions:
|
||||
id-token: write
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install required packages to publish
|
||||
run: |
|
||||
python3 -m pip install --upgrade build
|
||||
|
||||
- name: Build packages
|
||||
run: |
|
||||
python -m build
|
||||
|
||||
- name: Publish package distributions to PyPI
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
42
pyproject.toml
Normal file
42
pyproject.toml
Normal file
@@ -0,0 +1,42 @@
|
||||
[project]
|
||||
name = "gam7"
|
||||
dynamic = [
|
||||
"dependencies",
|
||||
"version",
|
||||
]
|
||||
authors = [
|
||||
{ name="Jay Lee", email="jay0lee@gmail.com" },
|
||||
{ name="Ross Scroggs", email="Ross.Scroggs@gmail.com" },
|
||||
]
|
||||
description = "CLI tool to manage Google Workspace"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.9"
|
||||
classifiers = [
|
||||
"Programming Language :: Python :: 3",
|
||||
"Operating System :: OS Independent",
|
||||
]
|
||||
license = {text = "Apache License (2.0)"}
|
||||
license-files = ["LICEN[CS]E*"]
|
||||
|
||||
[project.scripts]
|
||||
gam = "gam.__main__:main"
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/GAM-team/GAM"
|
||||
Issues = "https://github.com/GAM-team/GAM/issues"
|
||||
|
||||
[tool.hatch.version]
|
||||
path = "src/gam/__init__.py"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/gam"]
|
||||
|
||||
[tool.hatch.metadata.hooks.requirements_txt]
|
||||
files = ["src/requirements.txt"]
|
||||
|
||||
[build-system]
|
||||
requires = [
|
||||
"hatchling",
|
||||
"hatch-requirements_txt",
|
||||
]
|
||||
build-backend = "hatchling.build"
|
||||
@@ -2090,19 +2090,25 @@ gam move browsers ou|org|orgunit <OrgUnitPath>
|
||||
[batchsize <Integer>]
|
||||
|
||||
gam info browser <DeviceID>
|
||||
[basic|full|annotated] <BrowserFieldName>* [fields <BrowserFieldNameList>]
|
||||
(basic|full|annotated |
|
||||
(<BrowserFieldName>* [fields <BrowserFieldNameList>]) |
|
||||
(rawfields <BrowserFieldNameList>))
|
||||
[formatjson]
|
||||
gam show browsers
|
||||
([ou|org|orgunit|browserou <OrgUnitPath>] [(query <QueryBrowser>)|(queries <QueryBrowserList>))|(select <BrowserEntity>))
|
||||
[querytime<String> <Time>]
|
||||
[orderby <BrowserOrderByFieldName> [ascending|descending]]
|
||||
[basic|full|allfields|annotated] <BrowserFieldName>* [fields <BrowserFieldNameList>]
|
||||
(basic|full|annotated |
|
||||
(<BrowserFieldName>* [fields <BrowserFieldNameList>]) |
|
||||
(rawfields <BrowserFieldNameList>))
|
||||
[formatjson]
|
||||
gam print browsers [todrive <ToDriveAttribute>*]
|
||||
([ou|org|orgunit|browserou <OrgUnitPath>] [(query <QueryBrowser>)|(queries <QueryBrowserList>))|(select <BrowserEntity>))
|
||||
[querytime<String> <Time>]
|
||||
[orderby <BrowserOrderByFieldName> [ascending|descending]]
|
||||
[basic|full|allfields|annotated] <BrowserFieldName>* [fields <BrowserFieldNameList>]
|
||||
(basic|full|annotated |
|
||||
(<BrowserFieldName>* [fields <BrowserFieldNameList>]) |
|
||||
(rawfields <BrowserFieldNameList>))
|
||||
[sortheaders]
|
||||
[formatjson [quotechar <Character>]]
|
||||
|
||||
@@ -3927,8 +3933,11 @@ gam print group-members [todrive <ToDriveAttribute>*]
|
||||
updatetime
|
||||
<CIGroupFieldNameList> ::= "<CIGroupFieldName>(,<CIGroupFieldName>)*"
|
||||
|
||||
gam create cigroup <EmailAddress> [copyfrom <GroupItem>] <GroupAttribute>*
|
||||
[makeowner] [alias|aliases <CIGroupAliasList>] [dynamic <QueryDynamicGroup>]
|
||||
gam create cigroup <EmailAddress>
|
||||
[copyfrom <GroupItem>] <GroupAttribute>*
|
||||
[makeowner] [alias|aliases <CIGroupAliasList>]
|
||||
[security|makesecuritygroup]
|
||||
[dynamic <QueryDynamicGroup>]
|
||||
gam update cigroup <GroupEntity> [copyfrom <GroupItem>] <GroupAttribute>
|
||||
[security|makesecuritygroup|
|
||||
dynamicsecurity|makedynamicsecuritygroup|
|
||||
@@ -4515,7 +4524,7 @@ gam report users|user [todrive <ToDriveAttribute>*]
|
||||
(country|countrycode <String>)
|
||||
|
||||
gam create|add resoldcustomer <CustomerDomain> (customer_auth_token <String>) <ResoldCustomerAttribute>+
|
||||
gam update resoldcustomer <CustomerID> [customer_auth_token <String>] <ResoldCustomerAttribues>+
|
||||
gam update resoldcustomer <CustomerID> <ResoldCustomerAttribues>+
|
||||
gam info resoldcustomer <CustomerID> [formatjson]
|
||||
|
||||
gam create|add resoldsubscription <CustomerID> (sku <SKUID>)
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
7.03.06
|
||||
|
||||
Added option `rawfields <BrowserFieldNameList>` to `gam info|print|show browsers` that allows
|
||||
specification of complex field lists with selected subfields.
|
||||
|
||||
7.03.05
|
||||
|
||||
Make GAM pip-installable: "pip install gam7"
|
||||
|
||||
7.03.04
|
||||
|
||||
Added option `security` to `gam create cigroup` that allows creation of a security group
|
||||
in a single command.
|
||||
|
||||
Updated to Python 3.13.2.
|
||||
|
||||
7.03.03
|
||||
|
||||
Fixed bug in `gam update resoldcustomer` that caused the following error:
|
||||
|
||||
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
||||
"""
|
||||
|
||||
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
||||
__version__ = '7.03.03'
|
||||
__version__ = '7.03.06'
|
||||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
||||
|
||||
#pylint: disable=wrong-import-position
|
||||
@@ -7356,6 +7356,12 @@ def addFieldToFieldsList(fieldName, fieldsChoiceMap, fieldsList):
|
||||
def _getFieldsList():
|
||||
return getString(Cmd.OB_FIELD_NAME_LIST).lower().replace('_', '').replace(',', ' ').split()
|
||||
|
||||
def _getRawFieldsList(requiredField=None):
|
||||
rawFieldsList = getString(Cmd.OB_FIELDS)
|
||||
if requiredField is not None and requiredField not in rawFieldsList:
|
||||
rawFieldsList = f'{requiredField},{rawFieldsList}'
|
||||
return rawFieldsList
|
||||
|
||||
def _addInitialField(fieldsList, initialField):
|
||||
if isinstance(initialField, list):
|
||||
fieldsList.extend(initialField)
|
||||
@@ -15106,7 +15112,7 @@ def doCreateResoldCustomer():
|
||||
except (GAPI.badRequest, GAPI.resourceNotFound, GAPI.forbidden, GAPI.invalid) as e:
|
||||
entityActionFailedWarning([Ent.CUSTOMER_DOMAIN, body['customerDomain']], str(e))
|
||||
|
||||
# gam update resoldcustomer <CustomerID> [customer_auth_token <String>] <ResoldCustomerAttribute>+
|
||||
# gam update resoldcustomer <CustomerID> <ResoldCustomerAttribute>+
|
||||
def doUpdateResoldCustomer():
|
||||
res = buildGAPIObject(API.RESELLER)
|
||||
customerId = getString(Cmd.OB_CUSTOMER_ID)
|
||||
@@ -15133,6 +15139,7 @@ def doInfoResoldCustomer():
|
||||
customerId=customerId)
|
||||
if not FJQC.formatJSON:
|
||||
printKeyValueList(['Customer ID', customerInfo['customerId']])
|
||||
printKeyValueList(['Customer Type', customerInfo['customerType']])
|
||||
printKeyValueList(['Customer Domain', customerInfo['customerDomain']])
|
||||
if 'customerDomainVerified' in customerInfo:
|
||||
printKeyValueList(['Customer Domain Verified', customerInfo['customerDomainVerified']])
|
||||
@@ -16567,7 +16574,7 @@ def doInfoAdminRole():
|
||||
fieldsList.append('rolePrivileges')
|
||||
else:
|
||||
unknownArgumentExit()
|
||||
fields = ','.join(set(fieldsList))
|
||||
fields = getFieldsFromFieldsList(fieldsList)
|
||||
try:
|
||||
role = callGAPI(cd.roles(), 'get',
|
||||
throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.FAILED_PRECONDITION,
|
||||
@@ -17704,9 +17711,9 @@ def _getOrgUnits(cd, orgUnitPath, fieldsList, listType, showParent, batchSubOrgs
|
||||
if 'parentOrgUnitId' not in fieldsList:
|
||||
localFieldsList.append('parentOrgUnitId')
|
||||
deleteParentOrgUnitId = True
|
||||
fields = ','.join(set(localFieldsList))
|
||||
fields = getFieldsFromFieldsList(localFieldsList)
|
||||
else:
|
||||
fields = ','.join(set(fieldsList))
|
||||
fields = getFieldsFromFieldsList(fieldsList)
|
||||
listfields = f'organizationUnits({fields})'
|
||||
if listType == 'all' and orgUnitPath == '/':
|
||||
printGettingAllAccountEntities(Ent.ORGANIZATIONAL_UNIT)
|
||||
@@ -22168,8 +22175,7 @@ def printShowUserPeopleContacts(users):
|
||||
if not fieldsList:
|
||||
ofields = _getPersonFields(PEOPLE_OTHER_CONTACTS_FIELDS_CHOICE_MAP, PEOPLE_CONTACTS_DEFAULT_FIELDS, fieldsList, parameters)
|
||||
else:
|
||||
fieldsList = [PEOPLE_OTHER_CONTACTS_FIELDS_CHOICE_MAP[field.lower()] for field in fieldsList if field.lower() in PEOPLE_OTHER_CONTACTS_FIELDS_CHOICE_MAP]
|
||||
ofields = ','.join(set(fieldsList))
|
||||
ofields = getFieldsFromFieldsList([PEOPLE_OTHER_CONTACTS_FIELDS_CHOICE_MAP[field.lower()] for field in fieldsList if field.lower() in PEOPLE_OTHER_CONTACTS_FIELDS_CHOICE_MAP])
|
||||
i, count, users = getEntityArgument(users)
|
||||
for user in users:
|
||||
i += 1
|
||||
@@ -24783,7 +24789,7 @@ def doPrintCrOSActivity(entityList=None):
|
||||
else:
|
||||
sortRows = True
|
||||
jcount = len(entityList)
|
||||
fields = ','.join(set(fieldsList))
|
||||
fields = getFieldsFromFieldsList(fieldsList)
|
||||
svcargs = dict([('customerId', GC.Values[GC.CUSTOMER_ID]), ('deviceId', None), ('projection', projection), ('fields', fields)]+GM.Globals[GM.EXTRA_ARGS_LIST])
|
||||
method = getattr(cd.chromeosdevices(), 'get')
|
||||
dbatch = cd.new_batch_http_request(callback=_callbackPrintCrOS)
|
||||
@@ -25073,7 +25079,7 @@ def _showBrowser(browser, FJQC, i=0, count=0):
|
||||
return
|
||||
printEntity([Ent.CHROME_BROWSER, browser['deviceId']], i, count)
|
||||
Ind.Increment()
|
||||
showJSON(None, browser, timeObjects=BROWSER_TIME_OBJECTS)
|
||||
showJSON(None, browser, timeObjects=BROWSER_TIME_OBJECTS, dictObjectsKey={'machinePolicies': 'name'})
|
||||
Ind.Decrement()
|
||||
|
||||
BROWSER_FIELDS_CHOICE_MAP = {
|
||||
@@ -25113,11 +25119,13 @@ BROWSER_FIELDS_CHOICE_MAP = {
|
||||
'user': 'annotatedUser',
|
||||
'virtualdeviceid': 'virtualDeviceId',
|
||||
}
|
||||
BROWSER_ANNOTATED_FIELDS_LIST = ['annotatedAssetId', 'annotatedLocation', 'annotatedNotes', 'annotatedUser']
|
||||
BROWSER_ANNOTATED_FIELDS_LIST = ['annotatedAssetId', 'annotatedLocation', 'annotatedNotes', 'annotatedUser', 'deviceId']
|
||||
BROWSER_FULL_ACCESS_FIELDS = {'browsers', 'lastDeviceUsers', 'lastStatusReportTime', 'machinePolicies'}
|
||||
|
||||
# gam info browser <DeviceID>
|
||||
# [basic|full|annotated] <BrowserFieldName>* [fields <BrowserFieldNameList>]
|
||||
# (basic|full|annotated |
|
||||
# (<BrowserFieldName>* [fields <BrowserFieldNameList>]) |
|
||||
# (rawfields <BrowserFieldNameList>))
|
||||
# [formatjson]
|
||||
def doInfoBrowsers():
|
||||
cbcm = buildGAPIObject(API.CBCM)
|
||||
@@ -25125,6 +25133,7 @@ def doInfoBrowsers():
|
||||
deviceId = getString(Cmd.OB_DEVICE_ID)
|
||||
projection = 'BASIC'
|
||||
fieldsList = []
|
||||
rawFieldsList = None
|
||||
FJQC = FormatJSONQuoteChar()
|
||||
while Cmd.ArgumentsRemaining():
|
||||
myarg = getArgument()
|
||||
@@ -25136,16 +25145,24 @@ def doInfoBrowsers():
|
||||
fieldsList = []
|
||||
elif getFieldsList(myarg, BROWSER_FIELDS_CHOICE_MAP, fieldsList, initialField='deviceId'):
|
||||
pass
|
||||
elif myarg == 'rawfields':
|
||||
projection = 'FULL'
|
||||
rawFieldsList = _getRawFieldsList('deviceId')
|
||||
else:
|
||||
FJQC.GetFormatJSON(myarg)
|
||||
if projection == 'BASIC' and set(fieldsList).intersection(BROWSER_FULL_ACCESS_FIELDS):
|
||||
projection = 'FULL'
|
||||
fields = ','.join(set(fieldsList))
|
||||
if not rawFieldsList:
|
||||
fields = getFieldsFromFieldsList(fieldsList)
|
||||
else:
|
||||
fields = rawFieldsList
|
||||
try:
|
||||
browser = callGAPI(cbcm.chromebrowsers(), 'get',
|
||||
throwReasons=[GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN],
|
||||
throwReasons=[GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.FORBIDDEN],
|
||||
customer=customerId, deviceId=deviceId, projection=projection, fields=fields)
|
||||
_showBrowser(browser, FJQC)
|
||||
except GAPI.invalidArgument as e:
|
||||
entityActionFailedWarning([Ent.CHROME_BROWSER, deviceId], str(e))
|
||||
except (GAPI.badRequest, GAPI.resourceNotFound, GAPI.forbidden):
|
||||
checkEntityAFDNEorAccessErrorExit(None, Ent.CHROME_BROWSER, deviceId)
|
||||
|
||||
@@ -25346,7 +25363,7 @@ def doInfoChromeProfile():
|
||||
pass
|
||||
else:
|
||||
FJQC.GetFormatJSON(myarg)
|
||||
fields = ','.join(set(fieldsList))
|
||||
fields = getFieldsFromFieldsList(fieldsList)
|
||||
try:
|
||||
profile = callGAPI(cm.customers().profiles(), 'get',
|
||||
throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED],
|
||||
@@ -25478,13 +25495,19 @@ BROWSER_ORDERBY_CHOICE_MAP = {
|
||||
# ([ou|org|orgunit|browserou <OrgUnitPath>] [(query <QueryBrowser)|(queries <QueryBrowserList>))|(select <BrowserEntity>))
|
||||
# [querytime<String> <Time>]
|
||||
# [orderby <BrowserOrderByFieldName> [ascending|descending]]
|
||||
# [basic|full|allfields|annotated] <BrowserFieldName>* [fields <BrowserFieldNameList>]
|
||||
# (basic|full|annotated |
|
||||
# (<BrowserFieldName>* [fields <BrowserFieldNameList>]) |
|
||||
# (rawfields <BrowserFieldNameList>))
|
||||
# (<BrowserFieldName>* [fields <BrowserFieldNameList>]|(rawfields <BrowserFieldNameList>)
|
||||
# [formatjson]
|
||||
# gam print browsers [todrive <ToDriveAttribute>*]
|
||||
# ([ou|org|orgunit|browserou <OrgUnitPath>] [(query <QueryBrowser)|(queries <QueryBrowserList>))|(select <BrowserEntity>))
|
||||
# [querytime<String> <Time>]
|
||||
# [orderby <BrowserOrderByFieldName> [ascending|descending]]
|
||||
# [basic|full|allfields|annotated] <BrowserFieldName>* [fields <BrowserFieldNameList>]
|
||||
# (basic|full|annotated |
|
||||
# (<BrowserFieldName>* [fields <BrowserFieldNameList>]) |
|
||||
# (rawfields <BrowserFieldNameList>))
|
||||
# (<BrowserFieldName>* [fields <BrowserFieldNameList>]|(rawfields <BrowserFieldNameList>)
|
||||
# [sortheaders] [formatjson [quotechar <Character>]]
|
||||
def doPrintShowBrowsers():
|
||||
def _printBrowser(browser):
|
||||
@@ -25501,6 +25524,7 @@ def doPrintShowBrowsers():
|
||||
csvPF = CSVPrintFile(['deviceId']) if Act.csvFormat() else None
|
||||
FJQC = FormatJSONQuoteChar(csvPF)
|
||||
fieldsList = []
|
||||
rawFieldsList = None
|
||||
projection = 'BASIC'
|
||||
orderBy = 'id'
|
||||
sortOrder = 'ASCENDING'
|
||||
@@ -25539,22 +25563,28 @@ def doPrintShowBrowsers():
|
||||
sortHeaders = True
|
||||
elif getFieldsList(myarg, BROWSER_FIELDS_CHOICE_MAP, fieldsList, initialField='deviceId'):
|
||||
pass
|
||||
elif myarg == 'rawfields':
|
||||
projection = 'FULL'
|
||||
rawFieldsList = _getRawFieldsList('deviceId')
|
||||
else:
|
||||
FJQC.GetFormatJSONQuoteChar(myarg, True)
|
||||
if projection == 'BASIC' and set(fieldsList).intersection(BROWSER_FULL_ACCESS_FIELDS):
|
||||
projection = 'FULL'
|
||||
fields = getItemFieldsFromFieldsList('browsers', fieldsList)
|
||||
if FJQC.formatJSON:
|
||||
sortHeaders = False
|
||||
substituteQueryTimes(queries, queryTimes)
|
||||
if entityList is None:
|
||||
if not rawFieldsList:
|
||||
fields = getItemFieldsFromFieldsList('browsers', fieldsList)
|
||||
else:
|
||||
fields = f'nextPageToken,browsers({rawFieldsList})'
|
||||
for query in queries:
|
||||
printGettingAllAccountEntities(Ent.CHROME_BROWSER, query)
|
||||
pageMessage = getPageMessage()
|
||||
try:
|
||||
feed = yieldGAPIpages(cbcm.chromebrowsers(), 'list', 'browsers',
|
||||
pageMessage=pageMessage, messageAttribute='deviceId',
|
||||
throwReasons=[GAPI.INVALID_INPUT, GAPI.BAD_REQUEST, GAPI.INVALID_ORGUNIT, GAPI.FORBIDDEN],
|
||||
throwReasons=[GAPI.INVALID_INPUT, GAPI.BAD_REQUEST, GAPI.INVALID_ARGUMENT, GAPI.INVALID_ORGUNIT, GAPI.FORBIDDEN],
|
||||
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS,
|
||||
customer=customerId, orgUnitPath=orgUnitPath, query=query, projection=projection,
|
||||
orderBy=orderBy, sortOrder=sortOrder, fields=fields)
|
||||
@@ -25578,7 +25608,7 @@ def doPrintShowBrowsers():
|
||||
else:
|
||||
entityActionFailedWarning([Ent.CHROME_BROWSER, None], str(e))
|
||||
return
|
||||
except (GAPI.invalidOrgunit, GAPI.forbidden) as e:
|
||||
except (GAPI.invalidArgument, GAPI.invalidOrgunit, GAPI.forbidden) as e:
|
||||
entityActionFailedWarning([Ent.CHROME_BROWSER, None], str(e))
|
||||
return
|
||||
except (GAPI.badRequest, GAPI.resourceNotFound):
|
||||
@@ -25586,15 +25616,20 @@ def doPrintShowBrowsers():
|
||||
else:
|
||||
sortRows = True
|
||||
jcount = len(entityList)
|
||||
fields = getFieldsFromFieldsList(fieldsList)
|
||||
if not rawFieldsList:
|
||||
fields = getFieldsFromFieldsList(fieldsList)
|
||||
else:
|
||||
fields = rawFieldsList
|
||||
j = 0
|
||||
for deviceId in entityList:
|
||||
j += 1
|
||||
try:
|
||||
browser = callGAPI(cbcm.chromebrowsers(), 'get',
|
||||
throwReasons=[GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN],
|
||||
throwReasons=[GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.FORBIDDEN],
|
||||
customer=customerId, deviceId=deviceId, projection=projection, fields=fields)
|
||||
_printBrowser(browser)
|
||||
except GAPI.invalidArgument as e:
|
||||
entityActionFailedWarning([Ent.CHROME_BROWSER, deviceId], str(e))
|
||||
except (GAPI.badRequest, GAPI.resourceNotFound, GAPI.forbidden):
|
||||
checkEntityAFDNEorAccessErrorExit(None, Ent.CHROME_BROWSER, deviceId)
|
||||
if csvPF:
|
||||
@@ -31731,6 +31766,8 @@ def doCreateGroup(ciGroupsAPI=False):
|
||||
'query': getString(Cmd.OB_QUERY)})
|
||||
elif ciGroupsAPI and myarg == 'makeowner':
|
||||
initialGroupConfig = 'WITH_INITIAL_OWNER'
|
||||
elif ciGroupsAPI and myarg in {'security', 'makesecuritygroup'}:
|
||||
body['labels'][CIGROUP_SECURITY_LABEL] = ''
|
||||
elif myarg == 'verifynotinvitable':
|
||||
verifyNotInvitable = True
|
||||
else:
|
||||
@@ -34607,8 +34644,11 @@ def doPrintShowGroupTree():
|
||||
if csvPF:
|
||||
csvPF.writeCSVfile('Group Tree')
|
||||
|
||||
# gam create cigroup <EmailAddress> [copyfrom <GroupItem>] <GroupAttribute>
|
||||
# [makeowner] [alias|aliases <CIGroupAliasList>] [dynamic <QueryDynamicGroup>]
|
||||
# gam create cigroup <EmailAddress>
|
||||
# [copyfrom <GroupItem>] <GroupAttribute>
|
||||
# [makeowner] [alias|aliases <CIGroupAliasList>]
|
||||
# [security|makesecuritygroup]
|
||||
# [dynamic <QueryDynamicGroup>]
|
||||
def doCreateCIGroup():
|
||||
doCreateGroup(ciGroupsAPI=True)
|
||||
|
||||
@@ -48240,7 +48280,7 @@ def doPrintCourseTopics():
|
||||
jcount = len(courseTopicIds)
|
||||
if jcount == 0:
|
||||
continue
|
||||
fields = f'{",".join(set(fieldsList))}'
|
||||
fields = getFieldsFromFieldsList(fieldsList)
|
||||
j = 0
|
||||
for courseTopicId in courseTopicIds:
|
||||
j += 1
|
||||
@@ -48475,7 +48515,7 @@ def doPrintCourseWM(entityIDType, entityStateType):
|
||||
jcount = len(courseWMIds)
|
||||
if jcount == 0:
|
||||
continue
|
||||
fields = f'{",".join(set(fieldsList))}' if fieldsList else None
|
||||
fields = getFieldsFromFieldsList(fieldsList)
|
||||
j = 0
|
||||
for courseWMId in courseWMIds:
|
||||
j += 1
|
||||
@@ -65495,7 +65535,7 @@ def infoSharedDrive(users, useDomainAdminAccess=False):
|
||||
guiRoles = getBoolean()
|
||||
else:
|
||||
FJQC.GetFormatJSON(myarg)
|
||||
fields = ','.join(set(fieldsList)) if fieldsList else '*'
|
||||
fields = getFieldsFromFieldsList(fieldsList) if fieldsList else '*'
|
||||
i, count, users = getEntityArgument(users)
|
||||
for user in users:
|
||||
i += 1
|
||||
|
||||
@@ -924,6 +924,7 @@ class GamCLArgs():
|
||||
OB_EXPORT_ITEM = 'ExportItem'
|
||||
OB_FIELD_NAME = 'FieldName'
|
||||
OB_FIELD_NAME_LIST = "FieldNameList"
|
||||
OB_FIELDS = 'Fields'
|
||||
OB_FILE_NAME = 'FileName'
|
||||
OB_FILE_NAME_FIELD_NAME = OB_FILE_NAME+'(:'+OB_FIELD_NAME+')+'
|
||||
OB_FILE_NAME_OR_URL = 'FileName|URL'
|
||||
|
||||
@@ -11,4 +11,4 @@ lxml
|
||||
passlib>=1.7.2
|
||||
pathvalidate
|
||||
python-dateutil
|
||||
yubikey-manager>=5.0
|
||||
yubikey-manager[yubikey]>=5.0
|
||||
|
||||
Reference in New Issue
Block a user