View source on GitHub |
Class representing users application info.
Inherits From: Validated
, ValidatedBase
, expected_type
google.appengine.api.appinfo.AppInfoExternal(
**attributes
)
This class is passed to a yaml_object
builder to provide the validation
for the application information file format parser.
Raises | |
---|---|
AttributeDefinitionError
|
When class instance is missing ATTRIBUTE
definition or when ATTRIBUTE is of the wrong type.
|
Attributes | |
---|---|
application
|
Unique identifier for application. |
version
|
Application's major version. |
runtime
|
Runtime used by application. |
api_version
|
Which version of APIs to use. |
source_language
|
Optional specification of the source language. For example,
you could specify php-quercus if this is a Java app that was generated
from PHP source using Quercus.
|
handlers
|
List of URL handlers. |
default_expiration
|
Default time delta to use for cache expiration for
all static files, unless they have their own specific expiration set.
See the documentation for the URLMap.expiration field for more
information.
|
skip_files
|
A regular expression object. Files that match this regular
expression will not be uploaded by appcfg.py . For example::
skip_files: |
.svn.|
#.#
|
nobuild_files
|
A regular expression object. Files that match this regular expression will not be built into the app. This directive is valid for Go only. |
api_config
|
URL root and script or servlet path for enhanced API serving. |
service_account
|
Service account that the deployed app will run as. |
Methods
ApplyBackendSettings
ApplyBackendSettings(
backend_name
)
Applies settings from the indicated backend to the AppInfoExternal
.
Backend entries can contain directives that modify other parts of the
app.yaml
file, such as the start
directive, which adds a handler for the
start request. This method performs those modifications.
Args | |
---|---|
backend_name
|
The name of a backend that is defined in the backends
directive.
|
Raises | |
---|---|
BackendNotFound
|
If the indicated backend was not listed in the
backends directive.
|
DuplicateBackend
|
If the backend is found more than once in the backends
directive.
|
CheckInitialized
CheckInitialized()
Performs non-regular expression-based validation.
The following are verified:
- At least one URL mapping is provided in the URL mappers.
- The number of URL mappers doesn't exceed `MAX_URL_MAPS`.
- The major version does not contain the string `-dot-`.
- If `api_endpoints` are defined, an `api_config` stanza must be
defined.
- If the `runtime` is `python27` and `threadsafe` is set, then no CGI
handlers can be used.
- The version name doesn't start with `BUILTIN_NAME_PREFIX`.
- If `redirect_http_response_code` exists, it is in the list of valid
300s.
- Module and service aren't both set. Services were formerly known as
modules.
Raises | |
---|---|
DuplicateLibrary
|
If library_name is specified more than once.
|
MissingURLMapping
|
If no URLMap object is present in the object.
|
TooManyURLMappings
|
If there are too many URLMap entries.
|
MissingApiConfig
|
If api_endpoints exists without an api_config .
|
ThreadsafeWithCgiHandler
|
If the runtime is python27 ,
max_concurrent_requests under automatic_scaling is not 1
and CGI handlers are specified.
|
TooManyScalingSettingsError
|
If more than one scaling settings block is present. |
RuntimeDoesNotSupportLibraries
|
If the libraries clause is used for a
runtime that does not support it, such as python25 .
|
Get
Get(
key
)
Get a single value on Validated instance.
This method can only be used to retrieve validated attributes.
Args | |
---|---|
key
|
The name of the attributes |
Raises | |
---|---|
ValidationError when no validated attribute exists on class.
|
GetAllLibraries
GetAllLibraries()
Returns a list of all Library
instances active for this configuration.
Returns | |
---|---|
The list of active Library instances for this configuration. This
includes directly-specified libraries as well as any required
dependencies.
|
GetEffectiveRuntime
GetEffectiveRuntime()
Returns the app's runtime, resolving VMs to the underlying vm_runtime
.
Returns | |
---|---|
The effective runtime: The value of beta/vm_settings.vm_runtime if
runtime is vm , or runtime otherwise.
|
GetNormalizedLibraries
GetNormalizedLibraries()
Returns a list of normalized Library
instances for this configuration.
Returns | |
---|---|
The list of active Library instances for this configuration. This
includes directly-specified libraries, their required dependencies, and
any libraries enabled by default. Any libraries with latest as their
version will be replaced with the latest available version.
|
GetUnnormalized
GetUnnormalized(
key
)
Get a single value on the Validated
instance, without normalizing.
GetValidator
@classmethod
GetValidator( key )
Safely get the underlying attribute definition as a Validator
.
Args | |
---|---|
key
|
Name of attribute to get. |
Returns | |
---|---|
Validator associated with key or attribute value wrapped in a validator. |
Raises | |
---|---|
ValidationError
|
if no such attribute exists. |
GetWarnings
GetWarnings()
Return all the warnings we've got, along with their associated fields.
Returns | |
---|---|
A list of tuples of (dotted_field, warning), both strings. |
IsThreadsafe
IsThreadsafe()
IsVm
IsVm()
NormalizeVmSettings
NormalizeVmSettings()
Normalizes VM settings.
Set
Set(
key, value
)
Set a single value on Validated
instance.
This method can only be used to assign validated attributes.
Args | |
---|---|
key
|
The name of the attributes |
value
|
The value to set |
Raises | |
---|---|
ValidationError when no validated attribute exists on class.
|
SetEffectiveRuntime
SetEffectiveRuntime(
runtime
)
Sets the runtime while respecting vm runtimes rules for runtime settings.
Args | |
---|---|
runtime
|
The runtime to use. |
SetMultiple
SetMultiple(
attributes
)
Set multiple values on Validated instance.
All attributes will be validated before being set.
Args | |
---|---|
attributes
|
A dict of attributes/items to set. |
Raises | |
---|---|
ValidationError
|
When no validated attribute exists on class. |
ToDict
ToDict()
Convert Validated object to a dictionary.
Recursively traverses all of its elements and converts everything to simplified collections.
Returns | |
---|---|
A dict of all attributes defined in this classes ATTRIBUTES mapped
to its value. This structure is recursive in that Validated objects
that are referenced by this object and in lists are also converted to
dicts.
|
ToYAML
ToYAML()
Print validated object as simplified YAML.
Returns | |
---|---|
Object as a simplified YAML string compatible with parsing using the
SafeLoader .
|
__eq__
__eq__(
other
)
Equality operator.
Comparison is done by comparing all attribute values to those in the other instance. Objects which are not of the same type are not equal.
Args | |
---|---|
other
|
Other object to compare against. |
Returns | |
---|---|
True if validated objects are equal, else False .
|
__ne__
__ne__(
other
)
Inequality operator.