diff --git a/docs/GamUpdates.md b/docs/GamUpdates.md index 1b39bd77..957311c6 100644 --- a/docs/GamUpdates.md +++ b/docs/GamUpdates.md @@ -10,13 +10,6 @@ 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.00 - -Made the following error retryable. -``` -ERROR: 503: serviceNotAvailable - The service is currently unavailable. -``` - ### 6.63.04 Added option `ignorerole` to `gam update groups|cigroups sync [|ignorerole] ... ` that causes GAM diff --git a/docs/How-to-Upgrade-from-Standard-GAM.md b/docs/How-to-Upgrade-from-Standard-GAM.md index ec502094..31aa0b43 100644 --- a/docs/How-to-Upgrade-from-Standard-GAM.md +++ b/docs/How-to-Upgrade-from-Standard-GAM.md @@ -330,7 +330,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.00 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.63.04 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.10.8 64-bit final MacOS High Sierra 10.13.6 x86_64 @@ -972,7 +972,7 @@ 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.00 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.63.04 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.11.4 64-bit final Windows-10-10.0.17134 AMD64 diff --git a/docs/Version-and-Help.md b/docs/Version-and-Help.md index b288e743..4609fb86 100644 --- a/docs/Version-and-Help.md +++ b/docs/Version-and-Help.md @@ -3,7 +3,7 @@ Print the current version of Gam with details ``` gam version -GAMADV-XTD3 6.64.00 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.63.04 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.11.4 64-bit final MacOS Monterey 12.6.6 x86_64 @@ -15,7 +15,7 @@ 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.00 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.63.04 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.11.4 64-bit final MacOS Monterey 12.6.6 x86_64 @@ -27,7 +27,7 @@ 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.00 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.63.04 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.11.4 64-bit final MacOS Monterey 12.6.6 x86_64 @@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64 Path: /Users/Admin/bin/gamadv-xtd3 Version Check: Current: 5.35.08 - Latest: 6.64.00 + Latest: 6.63.04 echo $? 1 ``` @@ -72,7 +72,7 @@ echo $? Print the current version number without details ``` gam version simple -6.64.00 +6.63.04 ``` In Linux/MacOS you can do: ``` @@ -82,7 +82,7 @@ echo $VER Print the current version of Gam and address of this Wiki ``` gam help -GAM 6.64.00 - https://github.com/taers232c/GAMADV-XTD3 +GAM 6.63.04 - https://github.com/taers232c/GAMADV-XTD3 Ross Scroggs Python 3.11.4 64-bit final MacOS Monterey 12.6.6 x86_64 diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index 805111da..c94004b8 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -2,13 +2,6 @@ Merged GAM-Team version -6.64.00 - -Made the following error retryable. -``` -ERROR: 503: serviceNotAvailable - The service is currently unavailable. -``` - 6.63.04 Added option `ignorerole` to `gam update groups|cigroups sync [|ignorerole] ... ` that causes GAM diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 4fcee170..aea814c8 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -6305,6 +6305,7 @@ def getItemsToModify(entityType, entity, memberRoles=None, isSuspended=None, isA result = callGAPIpages(croom.courses().teachers(), 'list', 'teachers', pageMessage=getPageMessageForWhom(), throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.BAD_REQUEST, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=courseId, fields='nextPageToken,teachers/profile/emailAddress', pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) for teacher in result: @@ -6317,6 +6318,7 @@ def getItemsToModify(entityType, entity, memberRoles=None, isSuspended=None, isA result = callGAPIpages(croom.courses().students(), 'list', 'students', pageMessage=getPageMessageForWhom(), throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.BAD_REQUEST, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=courseId, fields='nextPageToken,students/profile/emailAddress', pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) for student in result: @@ -15850,6 +15852,7 @@ def doCreateAdmin(): throwReasons=[GAPI.INTERNAL_ERROR, GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.CUSTOMER_EXCEEDED_ROLE_ASSIGNMENTS_LIMIT, GAPI.SERVICE_NOT_AVAILABLE, GAPI.INVALID_ORGUNIT, GAPI.DUPLICATE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], customer=GC.Values[GC.CUSTOMER_ID], body=body, fields='roleAssignmentId,assigneeType') assigneeType = result.get('assigneeType') if assigneeType == 'user': @@ -15881,6 +15884,7 @@ def doDeleteAdmin(): throwReasons=[GAPI.NOT_FOUND, GAPI.OPERATION_NOT_SUPPORTED, GAPI.FORBIDDEN, GAPI.INVALID_INPUT, GAPI.SERVICE_NOT_AVAILABLE, GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], customer=GC.Values[GC.CUSTOMER_ID], roleAssignmentId=roleAssignmentId) entityActionPerformed([Ent.ADMIN_ROLE_ASSIGNMENT, roleAssignmentId]) except (GAPI.notFound, GAPI.operationNotSupported, GAPI.forbidden, @@ -20157,6 +20161,7 @@ def _getPeopleOtherContacts(people, entityType, user, i=0, count=0): results = callGAPIpages(people.otherContacts(), 'list', 'otherContacts', pageMessage=getPageMessageForWhom(), throwReasons=GAPI.PEOPLE_ACCESS_THROW_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], pageSize=1000, readMask='emailAddresses', fields='nextPageToken,otherContacts(etag,resourceName,emailAddresses(value,type))') otherContacts = {} @@ -20179,6 +20184,7 @@ def queryPeopleContacts(people, contactQuery, fields, sortOrder, entityType, use results = callGAPIpages(people.people().connections(), 'list', 'connections', pageMessage=pageMessage, throwReasons=GAPI.PEOPLE_ACCESS_THROW_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], pageSize=GC.Values[GC.PEOPLE_MAX_RESULTS], resourceName='people/me', sources=sources, personFields=fields, sortOrder=sortOrder, fields='nextPageToken,connections') @@ -20211,6 +20217,7 @@ def queryPeopleContacts(people, contactQuery, fields, sortOrder, entityType, use resourceName=contactQuery['group'], maxMembers=totalItems, groupFields='name') for resourceName in results.get('memberResourceNames', []): result = callGAPI(people.people(), 'get', + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], resourceName=resourceName, sources=sources, personFields=fields) entityList.append(result) @@ -20231,6 +20238,7 @@ def queryPeopleOtherContacts(people, contactQuery, fields, entityType, user, i=0 entityList = callGAPIpages(people.otherContacts(), 'list', 'otherContacts', pageMessage=pageMessage, throwReasons=GAPI.PEOPLE_ACCESS_THROW_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], pageSize=GC.Values[GC.PEOPLE_MAX_RESULTS], readMask=fields, fields='nextPageToken,otherContacts', sources=sources) else: @@ -20347,6 +20355,7 @@ def createUserPeopleContact(users): try: result = callGAPI(people.people(), 'createContact', throwReasons=GAPI.PEOPLE_ACCESS_THROW_REASONS+[GAPI.INVALID_ARGUMENT], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], personFields=','.join(personFields), body=body, sources=sources) resourceName = result['resourceName'] if returnIdOnly: @@ -20465,6 +20474,7 @@ def _clearUpdatePeopleContacts(users, updateContacts): contact = callGAPI(people.people(), 'get', bailOnInternalError=True, throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], resourceName=contact, sources=sources, personFields='emailAddresses,memberships') else: if not localPeopleContactSelects(contactQuery, contact): @@ -20506,6 +20516,7 @@ def _clearUpdatePeopleContacts(users, updateContacts): callGAPI(people.people(), 'deleteContact', bailOnInternalError=True, throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], resourceName=resourceName) entityActionPerformed([entityType, user, peopleEntityType, resourceName], j, jcount) continue @@ -20513,6 +20524,7 @@ def _clearUpdatePeopleContacts(users, updateContacts): updatePersonFields = [PEOPLE_EMAIL_ADDRESSES] person = callGAPI(people.people(), 'updateContact', throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], resourceName=resourceName, updatePersonFields=','.join(updatePersonFields), body=body, sources=sources) entityActionPerformed([entityType, user, peopleEntityType, person['resourceName']], j, jcount) @@ -20645,6 +20657,7 @@ def dedupReplaceDomainUserPeopleContacts(users): contact = callGAPI(people.people(), 'get', bailOnInternalError=True, throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], resourceName=contact, sources=sources, personFields='emailAddresses,memberships') else: if action == Act.DEDUP and not localPeopleContactSelects(contactQuery, contact): @@ -20659,6 +20672,7 @@ def dedupReplaceDomainUserPeopleContacts(users): Act.Set(Act.UPDATE) callGAPI(people.people(), 'updateContact', throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], resourceName=resourceName, updatePersonFields='emailAddresses', body=contact) entityActionPerformed([entityType, user, peopleEntityType, resourceName], j, jcount) @@ -20714,6 +20728,7 @@ def deleteUserPeopleContacts(users): callGAPI(people.people(), 'deleteContact', bailOnInternalError=True, throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], resourceName=resourceName) entityActionPerformed([entityType, user, peopleEntityType, resourceName], j, jcount) except (GAPI.notFound, GAPI.internalError): @@ -20989,6 +21004,7 @@ def _infoPeople(users, entityType, source): result = callGAPI(people.people(), 'get', bailOnInternalError=True, throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR, GAPI.INVALID_ARGUMENT]+GAPI.PEOPLE_ACCESS_THROW_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], resourceName=resourceName, sources=sources, personFields=fields) except (GAPI.notFound, GAPI.internalError): entityActionFailedWarning([entityType, user, peopleEntityType, resourceName], Msg.DOES_NOT_EXIST, j, jcount) @@ -21261,6 +21277,7 @@ def processUserPeopleOtherContacts(users): try: callGAPI(upeople.people(), 'updateContact', throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], resourceName=peopleResourceName, updatePersonFields=','.join(updatePersonFields), body=body, sources=sources) if action != Act.DELETE: @@ -21273,6 +21290,7 @@ def processUserPeopleOtherContacts(users): callGAPI(upeople.people(), 'deleteContact', bailOnInternalError=True, throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], resourceName=peopleResourceName) entityActionPerformed([entityType, user, peopleEntityType, resourceName], j, jcount) break @@ -21519,6 +21537,7 @@ def printShowUserPeopleProfiles(users): try: result = callGAPI(people.people(), 'get', throwReasons=[GAPI.NOT_FOUND]+GAPI.PEOPLE_ACCESS_THROW_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], resourceName='people/me', sources=sources, personFields=fields) except GAPI.notFound: entityUnknownWarning(Ent.PEOPLE_PROFILE, user, i, count) @@ -21612,6 +21631,7 @@ def _processPeopleContactPhotos(users, function): result = callGAPI(people.people(), 'get', bailOnInternalError=True, throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], resourceName=resourceName, sources=sources, personFields='emailAddresses') if function == 'updateContactPhoto': if subForContactId or subForEmail: @@ -21630,6 +21650,7 @@ def _processPeopleContactPhotos(users, function): filename = os.path.join(targetFolder, filename) result = callGAPI(people.people(), 'get', throwReasons=[GAPI.NOT_FOUND, GAPI.INTERNAL_ERROR]+GAPI.PEOPLE_ACCESS_THROW_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], resourceName=resourceName, personFields='photos') url = None for photo in result.get('photos', []): @@ -25372,6 +25393,7 @@ def buildChromeSchemas(cp=None, sfilter=None): cp = buildGAPIObject(API.CHROMEPOLICY) parent = _getCustomersCustomerIdWithC() schemas = callGAPIpages(cp.customers().policySchemas(), 'list', 'policySchemas', + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], parent=parent, filter=sfilter) schema_objects = {} for schema in schemas: @@ -25429,6 +25451,7 @@ def doDeleteChromePolicy(): callGAPI(cp.customers().policies().orgunits(), 'batchInherit', throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.INVALID_ARGUMENT, GAPI.SERVICE_NOT_AVAILABLE, GAPI.QUOTA_EXCEEDED], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], customer=customer, body=body) entityActionPerformed(kvList) except (GAPI.notFound, GAPI.permissionDenied, GAPI.invalidArgument, GAPI.serviceNotAvailable, GAPI.quotaExceeded) as e: @@ -25673,6 +25696,7 @@ def doUpdateChromePolicy(): callGAPI(cp.customers().policies().orgunits(), 'batchModify', throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.INVALID_ARGUMENT, GAPI.SERVICE_NOT_AVAILABLE, GAPI.QUOTA_EXCEEDED], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], customer=customer, body=body) entityActionPerformed(kvList) except (GAPI.notFound, GAPI.permissionDenied, GAPI.invalidArgument, GAPI.serviceNotAvailable, GAPI.quotaExceeded) as e: @@ -26108,6 +26132,7 @@ def doCreateChromeNetwork(): bailOnInternalError=True, throwReasons=[GAPI.ALREADY_EXISTS, GAPI.PERMISSION_DENIED, GAPI.INVALID_ARGUMENT, GAPI.INTERNAL_ERROR, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], customer=customer, body=body) entityActionPerformed(kvList+[Ent.CHROME_NETWORK_ID, result['networkId']]) except (GAPI.alreadyExists, GAPI.permissionDenied, GAPI.invalidArgument, @@ -26128,6 +26153,7 @@ def doDeleteChromeNetwork(): callGAPI(cp.customers().policies().networks(), 'removeNetwork', throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.INVALID_ARGUMENT, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], customer=customer, body=body) entityActionPerformed(kvList) except (GAPI.notFound, GAPI.permissionDenied, GAPI.invalidArgument, GAPI.serviceNotAvailable) as e: @@ -26185,6 +26211,7 @@ def getCIDeviceEntity(): try: devices = callGAPIpages(ci.devices(), 'list', 'devices', throwReasons=[GAPI.INVALID, GAPI.PERMISSION_DENIED], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], pageMessage=pageMessage, customer=customer, filter=query, fields='nextPageToken,devices(name)', pageSize=100) @@ -26219,6 +26246,7 @@ def getCIDeviceUserEntity(): try: deviceUsers = callGAPIpages(ci.devices().deviceUsers(), 'list', 'deviceUsers', throwReasons=[GAPI.INVALID, GAPI.PERMISSION_DENIED], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], pageMessage=pageMessage, customer=customer, filter=query, parent='devices/-', fields='nextPageToken,deviceUsers(name)', pageSize=20) @@ -26418,6 +26446,7 @@ def doSyncCIDevices(): try: result = callGAPIpages(ci.devices(), 'list', 'devices', throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], pageMessage=pageMessage, customer=customer, filter=query, view='COMPANY_INVENTORY', fields=fields, pageSize=100) @@ -26686,6 +26715,7 @@ def doPrintCIDevices(): devices = callGAPIpages(ci.devices(), 'list', 'devices', pageMessage=pageMessage, throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], customer=customer, filter=query, orderBy=OBY.orderBy, view=view, fields=fields, pageSize=100) except (GAPI.invalid, GAPI.invalidArgument, GAPI.permissionDenied) as e: @@ -26702,6 +26732,7 @@ def doPrintCIDevices(): deviceUsers = callGAPIpages(ci.devices().deviceUsers(), 'list', 'deviceUsers', pageMessage=pageMessage, throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], customer=customer, filter=query, parent=parent, orderBy=OBY.orderBy, fields=userFields, pageSize=20) for deviceUser in deviceUsers: @@ -26863,6 +26894,7 @@ def doPrintCIDeviceUsers(): deviceUsers = callGAPIpages(ci.devices().deviceUsers(), 'list', 'deviceUsers', pageMessage=pageMessage, throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], customer=customer, filter=query, orderBy=OBY.orderBy, parent=parent, fields=userFields, pageSize=20) for deviceUser in deviceUsers: @@ -27493,6 +27525,7 @@ def doPrintShowChromeApps(): try: apps = callGAPIpages(cm.customers().reports(), 'countInstalledApps', 'installedApps', throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], pageMessage=pageMessage, customer=customerId, orgUnitId=orgUnitId, filter=pfilter, orderBy=orderBy) except (GAPI.invalid, GAPI.invalidArgument, GAPI.permissionDenied, GAPI.serviceNotAvailable) as e: @@ -27640,6 +27673,7 @@ def doPrintShowChromeAppDevices(): try: devices = callGAPIpages(cm.customers().reports(), 'findInstalledAppDevices', 'devices', throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], pageMessage=pageMessage, appId=appId, appType=appType, customer=customerId, orgUnitId=orgUnitId, filter=pfilter, orderBy=orderBy) @@ -27758,6 +27792,7 @@ def doPrintShowChromeAues(): try: aues = callGAPI(cm.customers().reports(), 'countChromeDevicesReachingAutoExpirationDate', throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], customer=customerId, orgUnitId=orgUnitId, minAueDate=minAueDate, maxAueDate=maxAueDate).get('deviceAueCountReports', []) except (GAPI.invalid, GAPI.invalidArgument, GAPI.permissionDenied, GAPI.serviceNotAvailable) as e: entityActionFailedWarning([Ent.CHROME_MODEL, None], str(e)) @@ -27863,6 +27898,7 @@ def doPrintShowChromeNeedsAttn(): try: result = callGAPI(cm.customers().reports(), 'countChromeDevicesThatNeedAttention', throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], customer=customerId, orgUnitId=orgUnitId, readMask=','.join(CHROME_NEEDSATTN_TITLES)) for field in CHROME_NEEDSATTN_TITLES: result.setdefault(field, 0) @@ -27988,6 +28024,7 @@ def doPrintShowChromeVersions(): try: versions = callGAPIpages(cm.customers().reports(), 'countChromeVersions', 'browserVersions', throwReasons=[GAPI.INVALID, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], pageMessage=pageMessage, customer=customerId, orgUnitId=orgUnitId, filter=pfilter) except (GAPI.invalid, GAPI.invalidArgument, GAPI.permissionDenied, GAPI.serviceNotAvailable) as e: @@ -31286,6 +31323,7 @@ def doPrintGroupMembers(): try: info = callGAPI(people.people(), 'get', throwReasons=[GAPI.NOT_FOUND]+GAPI.PEOPLE_ACCESS_THROW_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], resourceName=f'people/{memberId}', personFields='names') if 'names' in info: for sourceType in ['PROFILE', 'CONTACT']: @@ -31451,6 +31489,7 @@ def doPrintGroupMembers(): try: mbinfo = callGAPI(cd.users(), 'get', throwReasons=GAPI.USER_GET_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], userKey=memberId, fields=userFields) if memberOptions[MEMBEROPTION_MEMBERNAMES]: row['name'] = mbinfo['name'].pop('fullName') @@ -34132,6 +34171,7 @@ def doCreateResourceCalendar(): callGAPI(cd.resources().calendars(), 'insert', throwReasons=[GAPI.INVALID, GAPI.INVALID_INPUT, GAPI.SERVICE_NOT_AVAILABLE, GAPI.REQUIRED, GAPI.DUPLICATE, GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], customer=GC.Values[GC.CUSTOMER_ID], body=body, fields='') entityActionPerformed([Ent.RESOURCE_CALENDAR, body['resourceId']]) except (GAPI.invalid, GAPI.invalidInput, GAPI.serviceNotAvailable) as e: @@ -34160,6 +34200,7 @@ def _doUpdateResourceCalendars(entityList): if featureChanges['add'] or featureChanges['remove']: features = callGAPI(cd.resources().calendars(), 'get', throwReasons=[GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.SERVICE_NOT_AVAILABLE, GAPI.FORBIDDEN], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], customer=GC.Values[GC.CUSTOMER_ID], calendarResourceId=resourceId, fields='featureInstances(feature(name))') bodyFeatures = body.pop('featureInstances', []) body['featureInstances'] = [] @@ -34183,6 +34224,7 @@ def _doUpdateResourceCalendars(entityList): callGAPI(cd.resources().calendars(), 'patch', throwReasons=[GAPI.INVALID, GAPI.INVALID_INPUT, GAPI.SERVICE_NOT_AVAILABLE, GAPI.REQUIRED, GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], customer=GC.Values[GC.CUSTOMER_ID], calendarResourceId=resourceId, body=body, fields='') entityActionPerformed([Ent.RESOURCE_CALENDAR, resourceId], i, count) except (GAPI.invalid, GAPI.invalidInput, GAPI.serviceNotAvailable, GAPI.required) as e: @@ -34208,6 +34250,7 @@ def _doDeleteResourceCalendars(entityList): try: callGAPI(cd.resources().calendars(), 'delete', throwReasons=[GAPI.BAD_REQUEST, GAPI.RESOURCE_NOT_FOUND, GAPI.FORBIDDEN], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], customer=GC.Values[GC.CUSTOMER_ID], calendarResourceId=resourceId) entityActionPerformed([Ent.RESOURCE_CALENDAR, resourceId], i, count) except GAPI.serviceNotAvailable as e: @@ -40445,6 +40488,7 @@ def doCreateUser(): callGAPI(parameters['lic'].licenseAssignments(), 'insert', throwReasons=[GAPI.INTERNAL_ERROR, GAPI.DUPLICATE, GAPI.CONDITION_NOT_MET, GAPI.INVALID, GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], productId=productId, skuId=skuId, body={'userId': user}, fields='') entityActionPerformed([Ent.USER, user, Ent.LICENSE, SKU.formatSKUIdDisplayName(skuId)]) except (GAPI.internalError, GAPI.duplicate, GAPI.conditionNotMet, GAPI.invalid, @@ -42216,7 +42260,7 @@ def _getInboundSSOProfiles(ci): filter=f'customer=="{customer}"') except (GAPI.notFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, GAPI.badRequest, GAPI.invalid, - GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: + GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e: entityActionFailedWarning([Ent.INBOUND_SSO_PROFILE, customer], str(e)) return [] @@ -42304,7 +42348,7 @@ def doCreateInboundSSOProfile(): _processInboundSSOProfileResult(result, returnNameOnly, kvlist, 'create') except (GAPI.failedPrecondition, GAPI.notFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument, - GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: + GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e: entityActionFailedWarning(kvlist, str(e)) # gam update inboundssoprofile @@ -42325,7 +42369,7 @@ def doUpdateInboundSSOProfile(): entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST) except (GAPI.failedPrecondition, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument, - GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: + GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e: entityActionFailedWarning(kvlist, str(e)) # gam delete inboundssoprofile @@ -42344,7 +42388,7 @@ def doDeleteInboundSSOProfile(): entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST) except (GAPI.failedPrecondition, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument, - GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: + GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e: entityActionFailedWarning(kvlist, str(e)) def _getInboundSSOProfile(ci, name): @@ -42357,7 +42401,7 @@ def _getInboundSSOProfile(ci, name): except GAPI.notFound: entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST) except (GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, - GAPI.badRequest, GAPI.invalid, GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: + GAPI.badRequest, GAPI.invalid, GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e: entityActionFailedWarning(kvlist, str(e)) return None @@ -42419,7 +42463,7 @@ def getInboundSSOProfileCredentials(ci, profile): parent=profile) except (GAPI.notFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, GAPI.badRequest, GAPI.invalid, - GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: + GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e: entityActionFailedWarning([Ent.INBOUND_SSO_PROFILE, profile], str(e)) return None @@ -42515,7 +42559,7 @@ def doCreateInboundSSOCredential(): entityActionFailedWarning([Ent.INBOUND_SSO_PROFILE, profile], str(e)) except (GAPI.failedPrecondition, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument, - GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: + GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e: entityActionFailedWarning(kvlist, str(e)) # gam delete inboundssocredential @@ -42536,7 +42580,7 @@ def doDeleteInboundSSOCredential(ci=None, name=None): entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST) except (GAPI.failedPrecondition, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument, - GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: + GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e: entityActionFailedWarning(kvlist, str(e)) # gam info inboundssocredential [formatjson] @@ -42554,7 +42598,7 @@ def doInfoInboundSSOCredential(): except GAPI.notFound: entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST) except (GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, - GAPI.badRequest, GAPI.invalid, GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: + GAPI.badRequest, GAPI.invalid, GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e: entityActionFailedWarning(kvlist, str(e)) # gam show inboundssocredentials [profile|profiles ] @@ -42613,7 +42657,7 @@ def _getInboundSSOAssignment(ci, name): except GAPI.notFound: entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST) except (GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, - GAPI.badRequest, GAPI.invalid, GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: + GAPI.badRequest, GAPI.invalid, GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e: entityActionFailedWarning(kvlist, str(e)) return None @@ -42626,7 +42670,7 @@ def _getInboundSSOAssignments(ci): filter=f'customer=="{customer}"') except (GAPI.notFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, GAPI.badRequest, GAPI.invalid, - GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: + GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e: entityActionFailedWarning([Ent.INBOUND_SSO_ASSIGNMENT, customer], str(e)) return None @@ -42738,7 +42782,7 @@ def doCreateInboundSSOAssignment(): _processInboundSSOAssignmentResult(result, kvlist, ci, cd, 'create') except (GAPI.failedPrecondition, GAPI.notFound, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument, - GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: + GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e: entityActionFailedWarning(kvlist, str(e)) # gam update inboundssoassignment [(group rank )|(ou|org|orgunit )] @@ -42759,7 +42803,7 @@ def doUpdateInboundSSOAssignment(): entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST) except (GAPI.failedPrecondition, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument, - GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: + GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e: entityActionFailedWarning(kvlist, str(e)) # gam delete inboundssoassignment @@ -42783,7 +42827,7 @@ def doDeleteInboundSSOAssignment(): entityActionFailedWarning(kvlist, Msg.DOES_NOT_EXIST) except (GAPI.failedPrecondition, GAPI.domainNotFound, GAPI.domainCannotUseApis, GAPI.forbidden, GAPI.badRequest, GAPI.invalid, GAPI.invalidInput, GAPI.invalidArgument, - GAPI.systemError, GAPI.permissionDenied, GAPI.internalError, GAPI.serviceNotAvailable) as e: + GAPI.systemError, GAPI.permissionDenied, GAPI.internalError) as e: entityActionFailedWarning(kvlist, str(e)) # gam info inboundssoassignment [formatjson] @@ -43012,6 +43056,7 @@ def checkCourseExists(croom, courseId, i=0, count=0, entityType=Ent.COURSE): try: result = callGAPI(croom.courses(), 'get', throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], id=courseId, fields='id,ownerId') return result except GAPI.notFound: @@ -43245,6 +43290,7 @@ class CourseAttributes(): self.courseAnnouncements = callGAPIpages(self.croom.courses().announcements(), 'list', 'announcements', pageMessage=getPageMessageForWhom(), throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=self.courseId, announcementStates=self.announcementStates, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) for courseAnnouncement in self.courseAnnouncements: @@ -43261,6 +43307,7 @@ class CourseAttributes(): self.courseMaterials = callGAPIpages(self.croom.courses().courseWorkMaterials(), 'list', 'courseWorkMaterial', pageMessage=getPageMessageForWhom(), throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=self.courseId, courseWorkMaterialStates=self.materialStates, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) for courseMaterial in self.courseMaterials: @@ -43281,6 +43328,7 @@ class CourseAttributes(): self.courseWorks = callGAPIpages(self.croom.courses().courseWork(), 'list', 'courseWork', pageMessage=getPageMessageForWhom(), throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=self.courseId, courseWorkStates=self.workStates, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) for courseWork in self.courseWorks: @@ -43304,6 +43352,7 @@ class CourseAttributes(): courseTopics = callGAPIpages(self.croom.courses().topics(), 'list', 'topic', pageMessage=getPageMessageForWhom(), throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=self.courseId, fields='nextPageToken,topic(topicId,name)', pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) for topic in courseTopics: @@ -43391,6 +43440,7 @@ class CourseAttributes(): try: newCourseTopics = callGAPIpages(self.croom.courses().topics(), 'list', 'topic', throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.FAILED_PRECONDITION, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=newCourseId, fields='nextPageToken,topic(topicId,name)', pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) newTopicsByName = {} @@ -43413,6 +43463,7 @@ class CourseAttributes(): try: result = callGAPI(tcroom.courses().topics(), 'create', throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.FAILED_PRECONDITION, GAPI.INVALID_ARGUMENT, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=newCourseId, body={'name': topicName}, fields='topicId') newTopicsByName[topicName] = result['topicId'] entityModifierItemValueListActionPerformed([Ent.COURSE, newCourseId, Ent.COURSE_TOPIC, topicName], Act.MODIFIER_FROM, @@ -43440,6 +43491,7 @@ class CourseAttributes(): result = callGAPI(tcroom.courses().announcements(), 'create', throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FORBIDDEN, GAPI.BAD_REQUEST, GAPI.FAILED_PRECONDITION, GAPI.BACKEND_ERROR, GAPI.INTERNAL_ERROR, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=newCourseId, body=body, fields='id') entityModifierItemValueListActionPerformed([Ent.COURSE, newCourseId, Ent.COURSE_ANNOUNCEMENT_ID, result['id']], Act.MODIFIER_FROM, [Ent.COURSE, self.courseId, Ent.COURSE_ANNOUNCEMENT_ID, courseAnnouncementId], j, jcount) @@ -43475,6 +43527,7 @@ class CourseAttributes(): result = callGAPI(tcroom.courses().courseWorkMaterials(), 'create', throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FORBIDDEN, GAPI.BAD_REQUEST, GAPI.FAILED_PRECONDITION, GAPI.BACKEND_ERROR, GAPI.INTERNAL_ERROR, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=newCourseId, body=body, fields='id') entityModifierItemValueListActionPerformed([Ent.COURSE, newCourseId, Ent.COURSE_MATERIAL_ID, result['id']], Act.MODIFIER_FROM, [Ent.COURSE, self.courseId, Ent.COURSE_MATERIAL_ID, courseMaterialId], j, jcount) @@ -43515,6 +43568,7 @@ class CourseAttributes(): throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FORBIDDEN, GAPI.BAD_REQUEST, GAPI.FAILED_PRECONDITION, GAPI.BACKEND_ERROR, GAPI.INTERNAL_ERROR, GAPI.INVALID_ARGUMENT, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=newCourseId, body=body, fields='id') entityModifierItemValueListActionPerformed([Ent.COURSE, newCourseId, Ent.COURSE_WORK_ID, result['id']], Act.MODIFIER_FROM, [Ent.COURSE, self.courseId, Ent.COURSE_WORK, f'{body.get("title", courseWorkId)}'], j, jcount) @@ -43560,6 +43614,7 @@ def doCreateCourse(): result = callGAPI(croom.courses(), 'create', throwReasons=[GAPI.ALREADY_EXISTS, GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FAILED_PRECONDITION, GAPI.FORBIDDEN, GAPI.BAD_REQUEST, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], body=courseAttributes.body, fields='id,name,ownerId,courseState,teacherFolder(id)') entityActionPerformed([Ent.COURSE_NAME, result['name'], Ent.COURSE, result['id']]) if courseAttributes.courseId: @@ -43589,10 +43644,12 @@ def _doUpdateCourses(entityList): throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FAILED_PRECONDITION, GAPI.FORBIDDEN, GAPI.BAD_REQUEST, GAPI.INVALID_ARGUMENT, GAPI.INTERNAL_ERROR, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], id=courseId, body=body, updateMask=','.join(list(body)), fields='id,name,ownerId,courseState,teacherFolder(id)') else: result = callGAPI(croom.courses(), 'get', throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], id=courseId, fields='id,name,ownerId,courseState,teacherFolder(id)') if courseAttributes.body: if not newOwner: @@ -43622,6 +43679,7 @@ def _doUpdateCourses(entityList): throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR, GAPI.ALREADY_EXISTS, GAPI.FAILED_PRECONDITION, GAPI.QUOTA_EXCEEDED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=courseId, body={'userId': newOwner}, fields='') modifier = Act.MODIFIER_WITH_NEW_TEACHER_OWNER time.sleep(10) @@ -43688,6 +43746,7 @@ def _doDeleteCourses(entityList): throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FAILED_PRECONDITION, GAPI.FORBIDDEN, GAPI.BAD_REQUEST, GAPI.INVALID_ARGUMENT, GAPI.INTERNAL_ERROR, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], id=courseId, body=body, updateMask=updateMask, fields='') callGAPI(croom.courses(), 'delete', throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.FAILED_PRECONDITION, GAPI.INTERNAL_ERROR], @@ -43839,6 +43898,7 @@ def _convertCourseUserIdToEmail(croom, userId, emails, entityValueList, i, count try: userEmail = callGAPI(croom.userProfiles(), 'get', throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], userId=userId, fields='emailAddress').get('emailAddress') except (GAPI.notFound, GAPI.permissionDenied, GAPI.badRequest, GAPI.forbidden, GAPI.serviceNotAvailable): pass @@ -43865,6 +43925,7 @@ def _getCourseAliasesMembers(croom, courseId, courseShowProperties, teachersFiel aliases = callGAPIpages(croom.courses().aliases(), 'list', 'aliases', pageMessage=pageMessage, throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE, GAPI.NOT_IMPLEMENTED], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=courseId, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) except (GAPI.notFound, GAPI.serviceNotAvailable, GAPI.notImplemented): pass @@ -43878,6 +43939,7 @@ def _getCourseAliasesMembers(croom, courseId, courseShowProperties, teachersFiel teachers = callGAPIpages(croom.courses().teachers(), 'list', 'teachers', pageMessage=pageMessage, throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=courseId, fields=teachersFields, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) except (GAPI.notFound, GAPI.serviceNotAvailable): pass @@ -43890,6 +43952,7 @@ def _getCourseAliasesMembers(croom, courseId, courseShowProperties, teachersFiel students = callGAPIpages(croom.courses().students(), 'list', 'students', pageMessage=pageMessage, throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=courseId, fields=studentsFields, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) except (GAPI.notFound, GAPI.serviceNotAvailable): pass @@ -43927,6 +43990,7 @@ def _doInfoCourses(entityList): try: course = callGAPI(croom.courses(), 'get', throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], id=courseId, fields=fields) if courseShowProperties['ownerEmail']: course['ownerEmail'] = _convertCourseUserIdToEmail(croom, course['ownerId'], ownerEmails, @@ -44075,6 +44139,7 @@ def _getCoursesInfo(croom, courseSelectionParameters, courseShowProperties, getO return callGAPIpages(croom.courses(), 'list', 'courses', pageMessage=getPageMessage(), throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.BAD_REQUEST, GAPI.INVALID, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], teacherId=courseSelectionParameters['teacherId'], studentId=courseSelectionParameters['studentId'], courseStates=courseSelectionParameters['courseStates'], @@ -44096,6 +44161,7 @@ def _getCoursesInfo(croom, courseSelectionParameters, courseShowProperties, getO try: info = callGAPI(croom.courses(), 'get', throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], id=courseId, fields=fields) coursesInfo.append(info) except GAPI.notFound: @@ -44354,6 +44420,7 @@ def doPrintCourseAnnouncements(): results = callGAPIpages(croom.courses().announcements(), 'list', 'announcements', pageMessage=getPageMessageForWhom(), throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=courseId, announcementStates=courseAnnouncementStates, orderBy=OBY.orderBy, fields=fields, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) for courseAnnouncement in results: @@ -44371,6 +44438,7 @@ def doPrintCourseAnnouncements(): try: courseAnnouncement = callGAPI(croom.courses().announcements(), 'get', throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=courseId, id=courseAnnouncementId, fields=fields) _printCourseAnnouncement(course, courseAnnouncement, i, count) except GAPI.notFound: @@ -44439,6 +44507,7 @@ def doPrintCourseTopics(): results = callGAPIpages(croom.courses().topics(), 'list', 'topic', pageMessage=getPageMessageForWhom(), throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=courseId, fields=fields, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) for courseTopic in results: @@ -44456,6 +44525,7 @@ def doPrintCourseTopics(): try: courseTopic = callGAPI(croom.courses().topics(), 'get', throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=courseId, id=courseTopicId, fields=fields) _printCourseTopic(course, courseTopic) except GAPI.notFound: @@ -44540,6 +44610,7 @@ def doPrintCourseWM(entityIDType, entityStateType): try: results = callGAPIpages(croom.courses().topics(), 'list', 'topic', throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=courseId, fields='nextPageToken,topic(topicId,name)', pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) for courseTopic in results: @@ -44751,6 +44822,7 @@ def doPrintCourseSubmissions(): try: userProfile = callGAPI(tcroom.userProfiles(), 'get', throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], userId=userId, fields='emailAddress,name') userProfiles[userId] = {'profile': {'emailAddress': userProfile.get('emailAddress', ''), 'name': userProfile['name']}} except (GAPI.notFound, GAPI.permissionDenied, GAPI.serviceNotAvailable): @@ -44837,6 +44909,7 @@ def doPrintCourseSubmissions(): results = callGAPIpages(croom.courses().courseWork(), 'list', 'courseWork', pageMessage=getPageMessageForWhom(), throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=courseId, courseWorkStates=courseWMSelectionParameters['courseWMStates'], orderBy=OBY.orderBy, fields='nextPageToken,courseWork(id)', pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) courseWorkIdsForCourse = [courseWork['id'] for courseWork in results] @@ -44861,6 +44934,7 @@ def doPrintCourseSubmissions(): results = callGAPIpages(croom.courses().courseWork().studentSubmissions(), 'list', 'studentSubmissions', pageMessage=getPageMessageForWhom(), throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=courseId, courseWorkId=courseWorkId, states=courseSubmissionStates, late=late, userId=courseSelectionParameters['studentId'], fields=fields, pageSize=GC.Values[GC.CLASSROOM_MAX_RESULTS]) for submission in results: @@ -44885,6 +44959,7 @@ def doPrintCourseSubmissions(): try: submission = callGAPI(croom.courses().courseWork().studentSubmissions(), 'get', throwReasons=GAPI.COURSE_ACCESS_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], courseId=courseId, courseWorkId=courseWorkId, id=courseSubmissionId, fields=fields) _printCourseSubmission(course, submission) @@ -45119,6 +45194,7 @@ def _getCoursesOwnerInfo(croom, courseIds, coursesInfo, useAdminAccess): try: info = callGAPI(croom.courses(), 'get', throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], id=courseId, fields='name,ownerId') if not useAdminAccess: _, ocroom = buildGAPIServiceObject(API.CLASSROOM, f'uid:{info["ownerId"]}') @@ -45396,6 +45472,7 @@ def _inviteGuardian(croom, studentId, guardianEmail, i=0, count=0, j=0, jcount=0 throwReasons=[GAPI.NOT_FOUND, GAPI.ALREADY_EXISTS, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.RESOURCE_EXHAUSTED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], studentId=studentId, body=body, fields='invitationId') entityActionPerformed([Ent.STUDENT, studentId, Ent.GUARDIAN, body['invitedEmailAddress'], Ent.GUARDIAN_INVITATION, result['invitationId']], j, jcount) return 1 @@ -45444,6 +45521,7 @@ def _cancelGuardianInvitation(croom, studentId, invitationId, i=0, count=0, j=0, throwReasons=[GAPI.NOT_FOUND, GAPI.FAILED_PRECONDITION, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], studentId=studentId, invitationId=invitationId, updateMask='state', body={'state': 'COMPLETE'}, fields='invitedEmailAddress') entityActionPerformed([Ent.STUDENT, studentId, Ent.GUARDIAN_INVITATION, result['invitedEmailAddress']], j, jcount) return 1 @@ -45490,6 +45568,7 @@ def _deleteGuardian(croom, studentId, guardianId, guardianEmail, i, count, j, jc try: callGAPI(croom.userProfiles().guardians(), 'delete', throwReasons=[GAPI.NOT_FOUND, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], studentId=studentId, guardianId=guardianId) entityActionPerformed([Ent.STUDENT, studentId, Ent.GUARDIAN, guardianEmail], j, jcount) return 1 @@ -45514,6 +45593,7 @@ def _doDeleteGuardian(croom, studentId, guardianId, guardianClass, i=0, count=0, invitations = callGAPIpages(croom.userProfiles().guardianInvitations(), 'list', 'guardianInvitations', throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], studentId=studentId, invitedEmailAddress=guardianId, states=['PENDING'], fields='nextPageToken,guardianInvitations(studentId,invitationId)') for invitation in invitations: @@ -45532,6 +45612,7 @@ def _doDeleteGuardian(croom, studentId, guardianId, guardianClass, i=0, count=0, guardians = callGAPIpages(croom.userProfiles().guardians(), 'list', 'guardians', throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], studentId=studentId, invitedEmailAddress=guardianId, fields='nextPageToken,guardians(studentId,guardianId)') for guardian in guardians: @@ -45601,6 +45682,7 @@ def clearGuardians(users): invitations = callGAPIpages(croom.userProfiles().guardianInvitations(), 'list', 'guardianInvitations', throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], studentId=studentId, states=['PENDING'], fields='nextPageToken,guardianInvitations(invitationId)') Act.Set(Act.CANCEL) jcount = len(invitations) @@ -45646,10 +45728,12 @@ def syncGuardians(users): invitations = callGAPIpages(croom.userProfiles().guardianInvitations(), 'list', 'guardianInvitations', throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], studentId=studentId, states=['PENDING'], fields='nextPageToken,guardianInvitations(invitationId,invitedEmailAddress)') guardians = callGAPIpages(croom.userProfiles().guardians(), 'list', 'guardians', throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], studentId=studentId, fields='nextPageToken,guardians(guardianId,invitedEmailAddress)') except GAPI.notFound: entityUnknownWarning(Ent.STUDENT, studentId, i, count) @@ -45694,6 +45778,7 @@ def _getCourseName(croom, courseNames, courseId): courseName = callGAPI(croom.courses(), 'get', throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], id=courseId, fields='name')['name'] except (GAPI.notFound, GAPI.invalidArgument, GAPI.badRequest, GAPI.forbidden, GAPI.permissionDenied, GAPI.serviceNotAvailable): pass @@ -45711,6 +45796,7 @@ def _getClassroomEmail(croom, classroomEmails, userId, user): userEmail = callGAPI(croom.userProfiles(), 'get', throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], userId=userId, fields='emailAddress').get('emailAddress') except (GAPI.notFound, GAPI.invalidArgument, GAPI.badRequest, GAPI.forbidden, GAPI.permissionDenied, GAPI.serviceNotAvailable): pass @@ -45810,6 +45896,7 @@ def _printShowGuardians(entityList=None): pageMessage=pageMessage, throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], studentId=studentId, invitedEmailAddress=invitedEmailAddress, states=states) jcount = len(invitations) if not csvPF: @@ -45852,6 +45939,7 @@ def _printShowGuardians(entityList=None): pageMessage=pageMessage, throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], studentId=studentId, invitedEmailAddress=invitedEmailAddress) jcount = len(guardians) if not csvPF: @@ -45916,6 +46004,7 @@ def _getClassroomInvitations(croom, userId, courseId, role, i, count, j=0, jcoun invitations = callGAPIpages(croom.invitations(), 'list', 'invitations', throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], userId=userId, courseId=courseId) except GAPI.notFound: if userId is not None: @@ -46284,6 +46373,7 @@ def printShowClassroomProfile(users): try: result = callGAPI(croom.userProfiles(), 'get', throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED, GAPI.BAD_REQUEST, GAPI.FORBIDDEN, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], userId=userId, fields='*') result.setdefault('verifiedTeacher', False) if not csvPF: @@ -50300,6 +50390,7 @@ def showFileInfo(users): try: result['permissions'] = callGAPIpages(drive.permissions(), 'list', 'permissions', throwReasons=GAPI.DRIVE3_GET_ACL_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], fileId=fileId, fields=permissionsFields, supportsAllDrives=True) for permission in result['permissions']: permission.pop('teamDrivePermissionDetails', None) @@ -51612,6 +51703,7 @@ def printFileList(users): try: f_file['permissions'] = callGAPIpages(drive.permissions(), 'list', 'permissions', throwReasons=GAPI.DRIVE3_GET_ACL_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], fileId=f_file['id'], fields=permissionsFields, supportsAllDrives=True) if not DLP.CheckFilePermissionMatches(f_file): return @@ -52465,6 +52557,7 @@ def printShowFileCounts(users): try: f_file['permissions'] = callGAPIpages(drive.permissions(), 'list', 'permissions', throwReasons=GAPI.DRIVE3_GET_ACL_REASONS+[GAPI.BAD_REQUEST], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], fileId=f_file['id'], fields=permissionsFields, supportsAllDrives=True) if not DLP.CheckFilePermissionMatches(f_file): continue @@ -54247,6 +54340,7 @@ def _copyPermissions(drive, user, i, count, j, jcount, try: result = callGAPIpages(drive.permissions(), 'list', 'permissions', throwReasons=GAPI.DRIVE3_GET_ACL_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], fileId=fid, fields='nextPageToken,permissions(allowFileDiscovery,domain,emailAddress,expirationTime,id,role,type,deleted,view,pendingOwner,permissionDetails)', useDomainAdminAccess=copyMoveOptions['useDomainAdminAccess'], supportsAllDrives=True) @@ -55335,6 +55429,7 @@ def _updateMoveFilePermissions(drive, user, i, count, try: result = callGAPIpages(drive.permissions(), 'list', 'permissions', throwReasons=GAPI.DRIVE3_GET_ACL_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], fileId=fid, fields='nextPageToken,permissions(allowFileDiscovery,domain,emailAddress,expirationTime,id,role,type,deleted,view,pendingOwner,permissionDetails)', useDomainAdminAccess=copyMoveOptions['useDomainAdminAccess'], supportsAllDrives=True) @@ -56841,6 +56936,7 @@ def transferDrive(users): try: permissions = callGAPIpages(ownerDrive.permissions(), 'list', 'permissions', throwReasons=GAPI.DRIVE3_GET_ACL_REASONS+[GAPI.BAD_REQUEST], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], fileId=childFileId, fields='nextPageToken,permissions') if getSourcePermissionFromOwner: for permission in permissions: @@ -59148,6 +59244,7 @@ def printShowDriveFileACLs(users, useDomainAdminAccess=False): try: permissions = callGAPIpages(drive.permissions(), 'list', 'permissions', throwReasons=GAPI.DRIVE3_GET_ACL_REASONS+[GAPI.NOT_FOUND], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], useDomainAdminAccess=useDomainAdminAccess, includePermissionsForView=includePermissionsForView, fileId=fileId, fields=fields, supportsAllDrives=True) @@ -60537,6 +60634,7 @@ def printShowSharedDriveACLs(users, useDomainAdminAccess=False): permissions = callGAPIpages(drive.permissions(), 'list', 'permissions', pageMessage=getPageMessageForWhom(), throwReasons=GAPI.DRIVE3_GET_ACL_REASONS, + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], useDomainAdminAccess=useDomainAdminAccess, fileId=shareddrive['id'], fields=fields, supportsAllDrives=True) if not permissions: @@ -61883,6 +61981,7 @@ def _createLicenses(lic, productId, skuId, parameters, jcount, users, i, count, bailOnInternalError=True, throwReasons=[GAPI.INTERNAL_ERROR, GAPI.DUPLICATE, GAPI.CONDITION_NOT_MET, GAPI.INVALID, GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], productId=productId, skuId=skuId, body={'userId': user}, fields='') message = Act.SUCCESS entityActionPerformed([Ent.USER, user, Ent.LICENSE, SKU.formatSKUIdDisplayName(skuId)], j, jcount) @@ -61942,6 +62041,7 @@ def updateLicense(users): bailOnInternalError=True, throwReasons=[GAPI.INTERNAL_ERROR, GAPI.NOT_FOUND, GAPI.CONDITION_NOT_MET, GAPI.INVALID, GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], productId=productId, skuId=oldSkuId, userId=user, body=body, fields='') message = Act.SUCCESS entityModifierNewValueActionPerformed([Ent.USER, user, Ent.LICENSE, SKU.skuIdToDisplayName(skuId)], @@ -61974,6 +62074,7 @@ def _deleteLicenses(lic, productId, skuId, parameters, jcount, users, i, count): callGAPI(lic.licenseAssignments(), 'delete', throwReasons=[GAPI.INTERNAL_ERROR, GAPI.NOT_FOUND, GAPI.CONDITION_NOT_MET, GAPI.INVALID, GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.BACKEND_ERROR, GAPI.SERVICE_NOT_AVAILABLE], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], productId=productId, skuId=skuId, userId=user) message = Act.SUCCESS entityActionPerformed([Ent.USER, user, Ent.LICENSE, SKU.formatSKUIdDisplayName(skuId)], j, jcount) @@ -62216,6 +62317,7 @@ def getPhoto(users, profileMode): else: result = callGAPI(people.people(), 'get', throwReasons=[GAPI.NOT_FOUND], + retryReasons=[GAPI.SERVICE_NOT_AVAILABLE], resourceName='people/me', personFields='photos') default = False url = None diff --git a/src/gam/gamlib/glgapi.py b/src/gam/gamlib/glgapi.py index 4d0af5ea..eedf06b4 100644 --- a/src/gam/gamlib/glgapi.py +++ b/src/gam/gamlib/glgapi.py @@ -170,7 +170,7 @@ USER_NOT_FOUND = 'userNotFound' USER_RATE_LIMIT_EXCEEDED = 'userRateLimitExceeded' # DEFAULT_RETRY_REASONS = [QUOTA_EXCEEDED, RATE_LIMIT_EXCEEDED, SHARING_RATE_LIMIT_EXCEEDED, USER_RATE_LIMIT_EXCEEDED, - BACKEND_ERROR, BAD_GATEWAY, GATEWAY_TIMEOUT, INTERNAL_ERROR, TRANSIENT_ERROR, SERVICE_NOT_AVAILABLE] + BACKEND_ERROR, BAD_GATEWAY, GATEWAY_TIMEOUT, INTERNAL_ERROR, TRANSIENT_ERROR] ACTIVITY_THROW_REASONS = [SERVICE_NOT_AVAILABLE, BAD_REQUEST] ALERT_THROW_REASONS = [SERVICE_NOT_AVAILABLE, AUTH_ERROR] CALENDAR_THROW_REASONS = [SERVICE_NOT_AVAILABLE, AUTH_ERROR, NOT_A_CALENDAR_USER] @@ -182,10 +182,10 @@ CIGROUP_UPDATE_THROW_REASONS = [NOT_FOUND, GROUP_NOT_FOUND, DOMAIN_NOT_FOUND, DO FORBIDDEN, BAD_REQUEST, INVALID, INVALID_INPUT, INVALID_ARGUMENT, SYSTEM_ERROR, PERMISSION_DENIED, FAILED_PRECONDITION] CIMEMBERS_THROW_REASONS = [MEMBER_NOT_FOUND, INVALID_MEMBER] -CISSO_CREATE_THROW_REASONS = [SERVICE_NOT_AVAILABLE, FAILED_PRECONDITION, NOT_FOUND, DOMAIN_NOT_FOUND, DOMAIN_CANNOT_USE_APIS, FORBIDDEN, INVALID, INVALID_ARGUMENT, PERMISSION_DENIED, INTERNAL_ERROR] -CISSO_GET_THROW_REASONS = [SERVICE_NOT_AVAILABLE, NOT_FOUND, DOMAIN_NOT_FOUND, DOMAIN_CANNOT_USE_APIS, FORBIDDEN, BAD_REQUEST, INVALID, SYSTEM_ERROR, PERMISSION_DENIED, INTERNAL_ERROR] -CISSO_LIST_THROW_REASONS = [SERVICE_NOT_AVAILABLE, NOT_FOUND, DOMAIN_NOT_FOUND, DOMAIN_CANNOT_USE_APIS, FORBIDDEN, BAD_REQUEST, INVALID, SYSTEM_ERROR, PERMISSION_DENIED, INTERNAL_ERROR] -CISSO_UPDATE_THROW_REASONS = [SERVICE_NOT_AVAILABLE, NOT_FOUND, FAILED_PRECONDITION, DOMAIN_NOT_FOUND, DOMAIN_CANNOT_USE_APIS, +CISSO_CREATE_THROW_REASONS = [FAILED_PRECONDITION, NOT_FOUND, DOMAIN_NOT_FOUND, DOMAIN_CANNOT_USE_APIS, FORBIDDEN, INVALID, INVALID_ARGUMENT, PERMISSION_DENIED, INTERNAL_ERROR] +CISSO_GET_THROW_REASONS = [NOT_FOUND, DOMAIN_NOT_FOUND, DOMAIN_CANNOT_USE_APIS, FORBIDDEN, BAD_REQUEST, INVALID, SYSTEM_ERROR, PERMISSION_DENIED, INTERNAL_ERROR] +CISSO_LIST_THROW_REASONS = [NOT_FOUND, DOMAIN_NOT_FOUND, DOMAIN_CANNOT_USE_APIS, FORBIDDEN, BAD_REQUEST, INVALID, SYSTEM_ERROR, PERMISSION_DENIED, INTERNAL_ERROR] +CISSO_UPDATE_THROW_REASONS = [NOT_FOUND, FAILED_PRECONDITION, DOMAIN_NOT_FOUND, DOMAIN_CANNOT_USE_APIS, FORBIDDEN, BAD_REQUEST, INVALID, INVALID_INPUT, INVALID_ARGUMENT, SYSTEM_ERROR, PERMISSION_DENIED, INTERNAL_ERROR] CONTACT_DELEGATE_THROW_REASONS = [SERVICE_NOT_AVAILABLE, BAD_REQUEST, FAILED_PRECONDITION, PERMISSION_DENIED, FORBIDDEN, INVALID_ARGUMENT]