Returns the result of merging two AdminConsole
objects.
Bases: google.appengine.api.validation.Validated
Class representing the admin console page in an AdminConsole
object.
Bases: google.appengine.api.appinfo.HandlerBase
Class representing api_config
handler directives in application info.
Bases: google.appengine.api.validation.Validated
Class representing the contents of an included app.yaml
file.
This class is used for both builtins
and includes
directives.
Merges the non-referential state of the provided AppInclude
.
That is, builtins
and includes
directives are not preserved, but any static objects are copied into an aggregate AppInclude
object that preserves the directives of both provided AppInclude
objects.
appinclude_one
is updated to be the merged result in this process.
appinclude_one – First AppInclude
to merge.
appinclude_two – Second AppInclude
to merge.
AppInclude
object that is the result of merging the static directives of appinclude_one
and appinclude_two
. An updated version of appinclude_one
is returned.
Merges an app.yaml
file with referenced builtins/includes.
appyaml – The app.yaml
file that you want to update with appinclude
.
appinclude – The includes that you want to merge into appyaml
.
An updated app.yaml
file that includes the directives you specified in appinclude
.
Takes the greater of <manual_scaling.instances>
from the arguments.
appinclude_one
is mutated to be the merged result in this process.
Also, this function must be updated if ManualScaling
gets additional fields.
appinclude_one – The first object to merge. The object must have a manual_scaling
field that contains a ManualScaling()
.
appinclude_two – The second object to merge. The object must have a manual_scaling
field that contains a ManualScaling()
.
An object that is the result of merging appinclude_one.manual_scaling.instances
and appinclude_two.manual_scaling.instances
; this is returned as a revised appinclude_one
object after the mutations are complete.
Merges two skip_files
directives.
skip_files_one – The first skip_files
element that you want to merge.
skip_files_two – The second skip_files
element that you want to merge.
A list of regular expressions that are merged.
Bases: google.appengine.api.validation.Validated
Class representing users application info.
This class is passed to a yaml_object
builder to provide the validation for the application information file format parser.
Unique identifier for application.
Application’s major version.
Runtime used by application.
Which version of APIs to use.
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.
List of URL handlers.
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.
A regular expression object. Files that match this regular expression will not be uploaded by appcfg.py
. For example:
skip_files:|.svn.*|#.*#
A regular expression object. Files that match this regular expression will not be built into the app. This directive is valid for Go only.
URL root and script or servlet path for enhanced API serving.
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.
backend_name – The name of a backend that is defined in the backends
directive.
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.
Performs non-regular expression-based validation.
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.
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
.
MissingThreadsafe – If threadsafe
is not set but the runtime requires it.
ThreadsafeWithCgiHandler – If the runtime
is python27
, threadsafe
is set 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
.
Returns a list of all Library
instances active for this configuration.
The list of active Library
instances for this configuration. This includes directly-specified libraries as well as any required dependencies.
Returns the app’s runtime, resolving VMs to the underlying vm_runtime
.
The value of beta/vm_settings.vm_runtime
if runtime
is vm
, or runtime
otherwise.
The effective runtime
Returns a list of normalized Library
instances for this configuration.
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.
Normalizes VM settings.
Sets the runtime while respecting vm runtimes rules for runtime settings.
Parametersruntime – The runtime to use.
Bases: google.appengine.api.validation.Validated
This class contains only basic summary information about an app.
This class is used to pass back information about the newly created app to users after a new version has been created.
Bases: google.appengine.api.validation.Validated
Class representing automatic scaling settings in AppInfoExternal.
Bases: google.appengine.api.validation.Validated
Class representing basic scaling settings in AppInfoExternal.
Bases: google.appengine.api.appinfo.VmSettings
Class for Beta (internal or unreleased) settings.
This class is meant to replace VmSettings
eventually.
These settings are not validated further here. The settings are validated on the server side.
Merges two BetaSettings
instances.
beta_settings_one – The first BetaSettings
instance, or None
.
beta_settings_two – The second BetaSettings
instance, or None
.
The merged BetaSettings
instance, or None
if both input instances are None
or empty.
Bases: google.appengine.api.validation.Validated
Class representing built-in handler directives in application info.
This class permits arbitrary keys, but their values must be described by the validation.Options
object that is returned by ATTRIBUTES
.
Bases: dict
Provides a dictionary object that will always claim to have a key.
This dictionary returns a fixed value for any get
operation. The fixed value that you pass in as a constructor parameter should be a validation.Validated
object.
Finds if a builtin is defined in a given list of builtin handler objects.
Parametersbuiltins_list – A list of BuiltinHandler
objects, typically yaml.builtins
.
builtin_name – The name of the built-in that you want to determine whether it is defined.
True
if builtin_name
is defined by a member of builtins_list
; all other results return False
.
Converts a list of BuiltinHandler
objects.
builtins_list – A list of BuildinHandler
objects to convert to tuples.
A list of (name, status)
that is derived from the BuiltinHandler
objects.
Converts a BuiltinHander
object to a dictionary.
on/off}` form
Return typeA dictionary in `{builtin_handler_name
Verifies that all BuiltinHandler
objects are valid and not repeated.
builtins_list – A list of BuiltinHandler
objects to validate.
runtime – If you specify this argument, warnings are generated for built-ins that have been deprecated in the given runtime.
InvalidBuiltinFormat – If the name of a BuiltinHandler
object cannot be determined.
DuplicateBuiltinsSpecified – If a BuiltinHandler
name is used more than once in the list.
Bases: google.appengine.api.validation.Validated
Class representing the configuration of VM CPU utilization.
Bases: google.appengine.api.validation.Validated
Class representing CustomMetrics in AppInfoExternal.
Determines if the CustomMetric is not valid.
Raisesappinfo_errors.TooManyAutoscalingUtilizationTargetsError – If too many
scaling targets are set.
appinfo_errors.NotEnoughAutoscalingUtilizationTargetsError – If no scaling
targets are set.
Bases: google.appengine.api.validation.Validated
Class representing EndpointsApiService in AppInfoExternal.
Determines if the Endpoints API Service is not valid.
Raisesappinfo_errors.MissingEndpointsConfigId – If the config id is missing when the rollout strategy is unspecified or set to “fixed”.
appinfo_errors.UnexpectedEndpointsConfigId – If the config id is set when the rollout strategy is “managed”.
Ensure s contains only ASCII-safe characters; return it as bytes-type.
Parameterss – the string or bytes to check
err – the error to raise if not good.
err if it’s not ASCII-safe.
Returnss as a byte string
Bases: google.appengine.api.validation.ValidatedDict
Class representing a mapping of environment variable key/value pairs.
Merges two EnvironmentVariables
instances.
If a variable is specified by both instances, the value from env_variables_two
is used.
env_variables_one – The first EnvironmentVariables
instance or None
.
env_variables_two – The second EnvironmentVariables
instance or None
.
The merged EnvironmentVariables
instance, or None
if both input instances are None
or empty.
alias of str
Bases: google.appengine.api.validation.Validated
Class representing error handler directives in application info.
Returns the list of all valid runtimes.
This list can include third-party runtimes as well as canned runtimes.
ReturnsTuple of strings.
Bases: google.appengine.api.validation.Validated
Base class for URLMap and ApiConfigHandler.
Bases: google.appengine.api.validation.Validated
Class representing the health check configuration.
Bases: google.appengine.api.validation.ValidatedDict
A dict that limits keys and values to what http_headers
allows.
http_headers
is an static handler key; it applies to handlers with static_dir
or static_files
keys. The following code is an example of how http_headers
is used:
handlers:-url:/staticstatic_dir:statichttp_headers:X-Foo-Header:foovalueX-Bar-Header:barvalue
Gets a header value.
Parametersheader_name – HTTP header name to look for.
ReturnsA header value that corresponds to header_name
. If more than one such value is in self
, one of the values is selected arbitrarily and returned. The selection is not deterministic.
Bases: google.appengine.api.validation.Validator
Ensures that keys in HttpHeadersDict
are valid.
HttpHeadersDict
contains a list of headers. An instance is used as HttpHeadersDict
’s KEY_VALIDATOR
.
Returns an argument, or raises an exception if the argument is invalid.
HTTP header names are defined by RFC 2616, section 4.2.
Parametersname – HTTP header field value.
unused_key – Unused.
name argument, unchanged.
Raisesappinfo_errors.InvalidHttpHeaderName – An argument cannot be used as an HTTP header name.
Bases: google.appengine.api.validation.Validator
Ensures that values in HttpHeadersDict
are valid.
An instance is used as HttpHeadersDict
’s VALUE_VALIDATOR
.
Returns a value, or raises an exception if the value is invalid.
According to `RFC 2616 section 4.2`_ header field values must consist “of either *TEXT or combinations of token, separators, and quoted-string”:
TEXT= <anyOCTETexceptCTLs,butincludingLWS>
value – HTTP header field value.
key – HTTP header field name.
A value argument.
Raisesappinfo_errors.InvalidHttpHeaderValue – An argument cannot be used as an HTTP header value.
Bases: google.appengine.api.validation.Validated
Class representing the configuration of a single library.
Determines if the library configuration is not valid.
Raisesappinfo_errors.InvalidLibraryName – If the specified library is not supported.
appinfo_errors.InvalidLibraryVersion – If the specified library version is not supported.
Bases: google.appengine.api.validation.Validated
Class representing the liveness check configuration.
Loads a single AppInclude
object where one and only one is expected.
app_include – A file-like object or string. The argument is set to a string, the argument is parsed as a configuration file. If the argument is set to a file-like object, the data is read and parsed.
ReturnsAn instance of AppInclude
as loaded from a YAML file.
EmptyConfigurationFile – If there are no documents in the YAML file.
MultipleConfigurationFile – If there is more than one document in the YAML file.
Loads a single AppInfo
object where one and only one is expected.
This method validates that the values in the AppInfo
match the validators that are defined in this file, in particular, AppInfoExternal.ATTRIBUTES
.
app_info – A file-like object or string. If the argument is a string, the argument is parsed as a configuration file. If the argument is a file-like object, the data is read, then parsed.
ReturnsAn instance of AppInfoExternal
as loaded from a YAML file.
ValueError – If a specified service is not valid.
EmptyConfigurationFile – If there are no documents in YAML file.
MultipleConfigurationFile – If more than one document exists in the YAML file.
DuplicateBackend – If a backend is found more than once in the backends
directive.
yaml_errors.EventError – If the app.yaml
file fails validation.
appinfo_errors.MultipleProjectNames – If the app.yaml
file has both an application
directive and a project
directive.
Bases: google.appengine.api.validation.Validated
Class representing manual scaling settings in AppInfoExternal.
Bases: google.appengine.api.validation.Validated
Class representing the VM network configuration.
Parses an expiration delta string.
Parametersexpiration – String that matches _DELTA_REGEX
.
Time delta in seconds.
Bases: google.appengine.api.validation.Validated
Class representing the readiness check configuration.
Bases: google.appengine.api.validation.Validated
Class representing the configuration of VM resources.
Bases: google.appengine.api.validation.ValidatedDict
Class for “vanilla” runtime configuration.
Fields used vary by runtime, so validation is delegated to the per-runtime build processes.
These are intended to be used during Dockerfile generation, not after VM boot.
alias of str
Bases: google.appengine.api.appinfo.HandlerBase
Maps from URLs to handlers.
This class acts similar to a union type. Its purpose is to describe a mapping between a set of URLs and their handlers. The handler type of a given instance is determined by which handler-id
attribute is used.
Every mapping can have one and only one handler type. Attempting to use more than one handler-id
attribute will cause an UnknownHandlerType
to be raised during validation. Failure to provide any handler-id
attributes will cause MissingHandlerType
to be raised during validation.
The regular expression used by the url
field will be used to match against the entire URL path and query string of the request; therefore, partial maps will not be matched. Specifying a url
, such as /admin
, is the same as matching against the regular expression ^/admin$
. Don’t start your matching url
with ^
or end them with $
. These regular expressions won’t be accepted and will raise ValueError
.
Specifies whether a user should be logged in to access a URL. The default value of this argument is optional
.
Sets the restriction on the protocol that can be used to serve this URL or handler. This value can be set to HTTP
, HTTPS
or either
.
Specifies a regular expression that is used to fully match against the request URLs path. See the “Special cases” section of this document to learn more.
Specifies the handler ID attribute that maps url
to the appropriate file. You can specify regular expression backreferences to the string matched to url
.
Specifies the regular expression that is used by the application configuration program to determine which files are uploaded as blobs. Because it is difficult to determine this information using just the url
and static_files
arguments, this attribute must be included. This attribute is required when you define a static_files
mapping. A matching file name must fully match against the upload
regular expression, similar to how url
is matched against the request path. Do not begin the upload
argument with the ^
character or end it with the $
character.
Specifies the handler ID that maps the provided url
to a sub-directory within the application directory. See “Special cases.”
When used with static_files
and static_dir
, this argument specifies that the MIME type of the files that are served from those directories must be overridden with this value.
Specifies the handler ID that maps URLs to a script handler within the application directory that will run using CGI.
Used in AppInclude
objects to specify whether a handler should be inserted at the beginning of the primary handler list or at the end. If tail
is specified, the handler is inserted at the end; otherwise, the handler is inserted at the beginning. This behavior implies that head
is the effective default.
When used with static files and directories, this argument specifies the time delta to use for cache expiration. This argument should use the following format: 4d 5h 30m 15s
, where each letter signifies days, hours, minutes, and seconds, respectively. The s
for “seconds” can be omitted. Only one amount must be specified, though combining multiple amounts is optional. The following list contains examples of values that are acceptable: 10
, 1d 6h
, 1h 30m
, 7d 7d 7d
, 5m 30
.
Specifies the handler ID that identifies an endpoint as an API endpoint. Calls that terminate here will be handled by the API serving framework.
When defining a static_dir
handler, do not use a regular expression in the url
attribute. Both the url
and static_dir
attributes are automatically mapped to these equivalents:
<url>/(.*) <static_dir>/\1
For example, this declaration…:
url:/imagesstatic_dir:images_folder
…is equivalent to this static_files
declaration:
url:/images/(.*)static_files:images_folder/\1upload:images_folder/(.*)
Makes sure that self.http_headers
is consistent with self.mime_type
.
This method assumes that self
is a static handler, either self.static_dir
or self.static_files
. You cannot specify None
.
self.http_headers
contains a Content-Type
header, and self.mime_type
is set. For example, the following configuration would be rejected:
handlers:-url:/staticstatic_dir:staticmime_type:text/htmlhttp_headers:content-type:text/html
As this example shows, a configuration will be rejected when http_headers
and mime_type
specify a content type, even when they specify the same content type.
Adds additional checking to make sure a handler has correct fields.
In addition to normal ValidatedCheck
, this method calls GetHandlerType
, which validates whether all of the handler fields are configured properly.
UnknownHandlerType – If none of the handler ID attributes are set.
UnexpectedHandlerAttribute – If an unexpected attribute is set for the discovered handler type.
HandlerTypeMissingAttribute – If the handler is missing a required attribute for its handler type.
ContentTypeSpecifiedMultipleTimes – If mime_type
is inconsistent with http_headers
.
Raises an error if position is specified outside of AppInclude objects.
RaisesPositionUsedInAppYamlHandler – If the position
attribute is specified for an app.yaml
file instead of an include.yaml
file.
Forces omitted secure
handler fields to be set to ‘secure: optional’.
The effect is that handler.secure
is never equal to the nominal default.
Gets the handler for a mapping.
ReturnsThe value of the handler, as determined by the handler ID attribute.
Gets the handler type of a mapping.
ReturnsThe handler type as determined by which handler ID attribute is set.
RaisesUnknownHandlerType – If none of the handler ID attributes are set.
UnexpectedHandlerAttribute – If an unexpected attribute is set for the discovered handler type.
HandlerTypeMissingAttribute – If the handler is missing a required attribute for its handler type.
MissingHandlerAttribute – If a URL handler is missing an attribute.
Generates a warning for reserved URLs.
See the version element documentation to learn which URLs are reserved.
Determines if a file name is valid.
Parametersfilename –
The file name to validate. The file name must be a valid file name:
It must only contain letters, numbers, and the following special characters: @
, _
, +
, /
$
, .
, -
, or ‘~’.
It must be less than 256 characters.
It must not contain /./
, /../
, or //
.
It must not end in /
.
All spaces must be in the middle of a directory or file name.
An error string if the file name is invalid. ‘’
is returned if the file name is valid.
Determines if source_refs
contains a valid list of source references.
source_refs – A multi-line string containing one source reference per line.
RaisesValidationError – If the reference is malformed.
Validates a list of handler (URLMap
) objects.
handlers – A list of a handler (URLMap
) objects.
is_include_file – If this argument is set to True
, the handlers that are added as part of the includes
directive are validated.
Determines if a source reference is valid.
Parametersref – A source reference in the following format: [repository_uri#]revision
.
ValidationError – If the reference is malformed.
Bases: google.appengine.api.appinfo.HealthCheck
Class representing the configuration of the VM health check.
Bases: google.appengine.api.validation.ValidatedDict
Class for VM settings.
The settings are not further validated here. The settings are validated on the server side.
Merges two VmSettings
instances.
If a variable is specified by both instances, the value from vm_settings_one
is used.
vm_settings_one – The first VmSettings
instance, or None
.
vm_settings_two – The second VmSettings
instance, or None
.
The merged VmSettings
instance, or None
if both input instances are None
or empty.
alias of str
Bases: google.appengine.api.validation.Validated
Class representing the configuration of a volume.
Bases: google.appengine.api.validation.Validated
Class representing the VPC Access connector configuration.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-04-04 UTC.