Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products. If you have feedback or questions as you navigate the site, click Send Feedback.

Python 2 is no longer supported by the community. We recommend that you migrate Python 2 apps to Python 3.
Stay organized with collections Save and categorize content based on your preferences.

google.appengine.api.backends.backends module

Summary

Backends API.

Deprecated since version 1.9.1: Use Modules library instead.

This API provides utility methods for working with backends.

Contents

exception google.appengine.api.backends.backends.DefaultHostnameErrorsource

Bases: google.appengine.api.backends.backends.Error

Raised if no default hostname is set in the environment.

exception google.appengine.api.backends.backends.Errorsource

Bases: exceptions.Exception

Base class for exceptions in this module.

exception google.appengine.api.backends.backends.InvalidBackendErrorsource

Bases: google.appengine.api.backends.backends.Error

Raised if an invalid backend was provided.

exception google.appengine.api.backends.backends.InvalidInstanceErrorsource

Bases: google.appengine.api.backends.backends.Error

Raised if an invalid instance was provided.

google.appengine.api.backends.backends.get_backend()source

DEPRECATED: Get the name of the backend handling this request.

Warning: This API is deprecated and will be removed in a future release. Please migrate to the Modules API as soon as possible.

Returns

The current backend, or None if this is not a backend.

Return type

string

google.appengine.api.backends.backends.get_hostname(backend=None, instance=None)source

DEPRECATED: Returns the hostname for a backend or backend instance.

Warning: This API is deprecated and will be removed in a future release. Please migrate to the Modules API as soon as possible.

Parameters
  • backend – The name of the backend. If None, the current backend will be used.

  • instance – An optoinal instance number. If provided, the hostname will represent the specific instance. If absent, the hostname will represent the backend as a whole.

RaisesReturns

The hostname of the backend or backend instance.

google.appengine.api.backends.backends.get_instance()source

DEPRECATED: Get the instance number of the backend handling this request.

Warning: This API is deprecated and will be removed in a future release. Please migrate to the Modules API as soon as possible.

Returns

The instance, in [0, instances-1], or None if this is not a backend.

Return type

int

google.appengine.api.backends.backends.get_url(backend=None, instance=None, protocol='http')source

DEPRECATED: Returns a URL pointing to a backend or backend instance.

Warning: This API is deprecated and will be removed in a future release. Please migrate to the Modules API as soon as possible.

This method works in both production and development environments.

Parameters
  • backend – The name of the backend. If None, the current backend will be used.

  • instance – An optoinal instance number. If provided, the URL will target the specific instance. If absent, the URL will point to a load-balancing hostname for the backend.

  • protocol – The protocol to use (default=’http’).

RaisesReturns

The URL of the backend or backend instance.