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.