Skip to content Skip to sidebar Skip to footer

GAE Send Requests To All Active Instances

Is there any way to send requests to all active instances of a module/service in Google App Engine? If I can get the list of all the active instances ids, I could make a request li

Solution 1:

You can get the list of instances for a specific service version using the Google App Engine Admin API's REST apps.services.versions.instances.list method:

Lists the instances of a version.

HTTP request

GET https://appengine.googleapis.com/v1/{parent=apps/*/services/*/versions/*}/instances

The URL uses Google API HTTP annotation syntax.

See also the corresponding Google App Engine Admin API Client Library for Python's pydoc page here.

With the list of instances you can, as you mentioned, use GAE's routing via URL to send requests to each particular instance as desired.

Important note related to this assumption in the question:

If I can get the list of all the active instances ids, I could make a request like https://instance-dot-version-dot-service-dot-app-id.appspot.com for each instance.

from Targeted routing:

Note: Targeting an instance is not supported in services that are configured for auto scaling or basic scaling.


Post a Comment for "GAE Send Requests To All Active Instances"