google.appengine.api.appinfo.CustomMetric

Class representing CustomMetrics in AppInfoExternal.

Inherits From: Validated, ValidatedBase, expected_type

AttributeDefinitionError When class instance is missing ATTRIBUTE definition or when ATTRIBUTE is of the wrong type.

Methods

CheckInitialized

View source

Determines if the CustomMetric is not valid.

Raises
appinfo_errors.TooManyAutoscalingUtilizationTargetsError If too many scaling targets are set.
appinfo_errors.NotEnoughAutoscalingUtilizationTargetsError If no scaling targets are set.

Get

View source

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.

GetUnnormalized

View source

Get a single value on the Validated instance, without normalizing.

GetValidator

View source

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

View source

Return all the warnings we've got, along with their associated fields.

Returns
A list of tuples of (dotted_field, warning), both strings.

Set

View source

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.

SetMultiple

View source

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

View source

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

View source

Print validated object as simplified YAML.

Returns
Object as a simplified YAML string compatible with parsing using the SafeLoader.

__eq__

View source

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__

View source

Inequality operator.

ATTRIBUTES

{
 'filter': <google.appengine.api.validation.Optional object>,
 'metric_name': <google.appengine.api.validation.Regex object>,
 'single_instance_assignment': <google.appengine.api.validation.Optional object>,
 'target_type': <google.appengine.api.validation.Regex object>,
 'target_utilization': <google.appengine.api.validation.Optional object>
}