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.

DescriptorLibrary Functions

Stay organized with collections Save and categorize content based on your preferences.

A descriptor library is an object that contains known definitions. It contains a cache of descriptor objects mapped by definition name, and contains all types of descriptors except for file sets.

If the application provides a definition name that is not in the library, the application can include a descriptor loader that attempts to resolve the missing descriptor.

DescriptorLibrary is provided by the protorpc.descriptor module.

Functions

DescriptorLibrary provides the following functions:

lookup_descriptor(definition_name)

Gets a descriptor from the library for the given definition name. If the descriptor is not found, attempts to find it using the descriptor loader.

Arguments
definition_name
The definition name for which to find a descriptor.

Returns a descriptor describing the definition name.

Raises a DefinitionNotFoundError error if no descriptor exists for the given definition name.

lookup_package(definition_name)

Determines the package name that any definition name belongs to. May check the parent for the package name. Attempts to resolve missing descriptors if provided a descriptor loader.

Arguments
definition_name
The definition name for which to find a package.

Returns a descriptor object describing the package name.