0
Answered

API limit for GAPPs service account

Monash 9 years ago in UNIFYBroker/Google Apps updated by anonymous 9 years ago 5

Hi Adam

Can you please help me answer these questions as Google has asked me the same. I had requested higher API limits for our accounts. Currently I am chewing threw them .. probably at some rate of around 30000 accounts for 150k API Calls.. have gone through 3 accounts already and have managed just to push out 70-80k object changes

The number of users. - About 300,000
Average number of requests per day/per user (calculation describing your expected usage of the API).
Which API methods will be called and what will be the frequency?Are you polling the API changes to user resources?

The 150,000 update limit is daily and refreshed at night.

Calendar get all = number of pages# (CalendarResourceService.RetrieveAllCalendarResources) + 1/calendar to get acl's# (CalendarService.Acl.List)
Calendar add = 1 (CalendarResourceService.Insert) + 1 (CalendarResourceService.RetrieveCalendarResource) + 1/calendar acl being added (CalendarService.Acl.Insert)
Calendar update = 1 (CalendarResourceService.RetrieveCalendarResource) + 1 (CalendarResourceService.Update) + 1/calendar acl being added (CalendarService.Acl.Insert) + 1/calendar acl being deleted (CalendarService.Acl.Delete)
Calendar delete = 1 (CalendarResourceService.RetrieveCalendarResource) + 1 (CalendarResourceService.Delete)

Domain contact get all = number of pages# (ContactsService.Query)
Domain contact get changes = depends on when it was last run, also paged* (ContactsService.Query)
Domain contact add = 1 (ContactsService.Insert)
Domain contact update = 1 (ContactsService.Get) + 1 (ContactsService.Update)
Domain contact delete = 1 (ContactsService.Delete)

Group get all = number of pages# (DirectoryService.Groups.List) + 1/group for settings (GroupssettingsService.Groups.Get) + 1..many/group for members# (DirectoryService.Members.List)
Group add = 1 (DirectoryService.Groups.Insert) + 1 for settings (GroupssettingsService.Groups.Update) + 1/alias added (DirectoryService.Groups.Aliases.Insert) + 1/group member added (DirectoryService.Members.Insert)
Group update = 1 (DirectoryService.Groups.Patch) + 1 for settings (GroupssettingsService.Groups.Patch) + 1/alias added (DirectoryService.Groups.Aliases.Insert) + 1/alias deleted (DirectoryService.Groups.Aliases.Delete) + 1/group member added (DirectoryService.Members.Insert) + 1/group member deleted (DirectoryService.Members.Delete)
Group delete = 1 (DirectoryService.Groups.Delete)

Org unit get all = number of pages$ (DirectoryService.Orgunits.List)
Org unit add = 1 (DirectoryService.Orgunits.Insert)
Org unit update = 1 (DirectoryService.Orgunits.Patch)
Org unit delete = 1 (DirectoryService.Orgunits.Delete)

User get all = number of pages# (DirectoryService.Users.List)
User add = 1 (DirectoryService.Users.Insert) + 1/alias added (DirectoryService.Users.Aliases.Insert) + 1 for admins (DirectoryService.Users.MakeAdmin)
User update = 1 (DirectoryService.Users.Get) + 1 (DirectoryService.Users.Update) + 1/alias added (DirectoryService.Users.Aliases.Insert) + 1/alias deleted (DirectoryService.Users.Aliases.Delete) + 1 for admin change (DirectoryService.Users.MakeAdmin)
User delete = 1 (DirectoryService.Users.Delete)

* depends on how many pages Google returns
$ paged, so depends on how many pages Google returns. However, if using the option to walk the tree (instead of having Google manage how the results are returned), it will make at least one request per level in the heirarchy before it also pages for levels containing enough items

  • Are you polling the API changes to user resources? - What is meant by this? The documentation doesn't show a way to do this ([https://developers.google.com/admin-sdk/directory/v1/guides/search-users).

Post from Adam van Vliet

Calendar get all = number of pages# (CalendarResourceService.RetrieveAllCalendarResources) + 1/calendar to get acl's# (CalendarService.Acl.List) Calendar add = 1 (CalendarResourceService.Insert) + 1 (CalendarResourceService.RetrieveCalendarResource) + 1/calendar acl being added (CalendarService.Acl.Insert) Calendar update = 1 (CalendarResourceService.RetrieveCalendarResource) + 1 (CalendarResourceService.Update) + 1/calendar acl being added (CalendarService.Acl.Insert) + 1/calendar acl being deleted (CalendarService.Acl.Delete) Calendar delete = 1 (CalendarResourceService.RetrieveCalendarResource) + 1 (CalendarResourceService.Delete)Domain contact get all = number of pages# (ContactsService.Query) Domain contact get changes = depends on when it was last run, also paged* (ContactsService.Query) Domain contact add = 1 (ContactsService.Insert) Domain contact update = 1 (ContactsService.Get) + 1 (ContactsService.Update) Domain contact delete = 1 (ContactsService.Delete)Group get all = number of pages# (DirectoryService.Groups.List) + 1/group for settings (GroupssettingsService.Groups.Get) + 1..many/group for members# (DirectoryService.Members.List) Group add = 1 (DirectoryService.Groups.Insert) + 1 for settings (GroupssettingsService.Groups.Update) + 1/alias added (DirectoryService.Groups.Aliases.Insert) + 1/group member added (DirectoryService.Members.Insert) Group update = 1 (DirectoryService.Groups.Patch) + 1 for settings (GroupssettingsService.Groups.Patch) + 1/alias added (DirectoryService.Groups.Aliases.Insert) + 1/alias deleted (DirectoryService.Groups.Aliases.Delete) + 1/group member added (DirectoryService.Members.Insert) + 1/group member deleted (DirectoryService.Members.Delete) Group delete = 1 (DirectoryService.Groups.Delete)Org unit get all = number of pages$ (DirectoryService.Orgunits.List) Org unit add = 1 (DirectoryService.Orgunits.Insert) Org unit update = 1 (DirectoryService.Orgunits.Patch) Org unit delete = 1 (DirectoryService.Orgunits.Delete)User get all = number of pages# (DirectoryService.Users.List) User add = 1 (DirectoryService.Users.Insert) + 1/alias added (DirectoryService.Users.Aliases.Insert) + 1 for admins (DirectoryService.Users.MakeAdmin) User update = 1 (DirectoryService.Users.Get) + 1 (DirectoryService.Users.Update) + 1/alias added (DirectoryService.Users.Aliases.Insert) + 1/alias deleted (DirectoryService.Users.Aliases.Delete) + 1 for admin change (DirectoryService.Users.MakeAdmin) User delete = 1 (DirectoryService.Users.Delete)depends on how many pages Google returns $ paged, so depends on how many pages Google returns. However, if using the option to walk the tree (instead of having Google manage how the results are returned), it will make at least one request per level in the heirarchy before it also pages for levels containing enough itemsAre you polling the API changes to user resources? - What is meant by this? The documentation doesn't show a way to do this (https://developers.google.com/admin-sdk/directory/v1/guides/search-users).

To clarify on polling the API to check if a user's resource changes. Basically making queries to the API to see if any resources have changed. For this, we recommend using push notifications: https://developers.google.com/admin-sdk/directory/v1/guides/push. You can watch for changes to user resources and receive notifications from the Directory API whenever a watched user resource changes.

A few issues with user.watch:

  • It requires a publicly visible HTTPS endpoint, would this be an issue?
  • The .NET documentation doesn't mention push/watch at all;
  • The reference guide only discusses requesting the watch, but not listening for the notifications. I assume this is because each language will host the endpoint in their own way;
  • type is a required field, however, the reference guide doesn't say what value it should contain. Found online that it might be "web_hook";
  • The .NET API doesn't appear to be complete, the returned channel has no event or hook to wait for pushed notifications.

This is why I hadn't proceeded, because it didn't look possible.