google.appengine.api.queueinfo module

Summary

QueueInfo tools.

QueueInfo is a library for working with QueueInfo records, describing task queue entries for an application. QueueInfo loads the records from queue.yaml. To learn more about the parameters you can specify in queue.yaml, review the queue.yaml reference guide.

Contents

class google.appengine.api.queueinfo.Acl(**attributes)source

Bases: google.appengine.api.validation.Validated

Controls the access control list for a single task queue.

ATTRIBUTES = {u'writer_email': <google.appengine.api.validation.Optional object>, u'user_email': <google.appengine.api.validation.Optional object>}
google.appengine.api.queueinfo.LoadSingleQueue(queue_info, open_fn=None)source

Loads a queue.yaml file/string and returns a QueueInfoExternal object.

Parameters
  • queue_info – The contents of a queue.yaml file, as a string.

  • open_fn – Function for opening files. Unused.

Returns

A QueueInfoExternal object.

exception google.appengine.api.queueinfo.MalformedQueueConfigurationsource

Bases: exceptions.Exception

The configuration file for the task queue is malformed.

google.appengine.api.queueinfo.ParseRate(rate)source

Parses a rate string in the form number/unit, or the literal 0.

The unit is one of s (seconds), m (minutes), h (hours) or d (days).

Parameters

rate – The string that contains the rate.

Returns

A floating point number that represents the rate/second.

Raises

MalformedQueueConfiguration – If the rate is invalid.

google.appengine.api.queueinfo.ParseTaskAgeLimit(age_limit)source

Parses a string representing the task’s age limit (maximum allowed age).

The string must be a non-negative integer or floating point number followed by one of s, m, h, or d (seconds, minutes, hours, or days, respectively).

Parameters

age_limit – The string that contains the task age limit.

Returns

An integer that represents the age limit in seconds.

Raises

MalformedQueueConfiguration – If the limit argument isn’t a valid Python double followed by a required suffix.

google.appengine.api.queueinfo.ParseTotalStorageLimit(limit)source

Parses a string representing the storage bytes limit.

Optional limit suffixes are:
  • B (bytes)

  • K (kilobytes)

  • M (megabytes)

  • G (gigabytes)

  • T (terabytes)

Parameters

limit – The string that specifies the storage bytes limit.

Returns

An integer that represents the storage limit in bytes.

Raises

MalformedQueueConfiguration – If the limit argument isn’t a valid Python double followed by an optional suffix.

class google.appengine.api.queueinfo.QueueEntry(**attributes)source

Bases: google.appengine.api.validation.Validated

Describes a single task queue.

ATTRIBUTES = {u'max_concurrent_requests': <google.appengine.api.validation.Optional object>, u'rate': <google.appengine.api.validation.Optional object>, u'name': u'^[A-Za-z0-9-]{0,499}$', u'target': <google.appengine.api.validation.Optional object>, u'retry_parameters': <google.appengine.api.validation.Optional object>, u'acl': <google.appengine.api.validation.Optional object>, u'bucket_size': <google.appengine.api.validation.Optional object>, u'mode': <google.appengine.api.validation.Optional object>}
class google.appengine.api.queueinfo.QueueInfoExternal(**attributes)source

Bases: google.appengine.api.validation.Validated

Describes all of the queue entries for an application.

ATTRIBUTES = {u'queue': <google.appengine.api.validation.Optional object>, 'application': <google.appengine.api.validation.Optional object>, u'total_storage_limit': <google.appengine.api.validation.Optional object>}
class google.appengine.api.queueinfo.RetryParameters(**attributes)source

Bases: google.appengine.api.validation.Validated

Specifies the retry parameters for a single task queue.

ATTRIBUTES = {u'task_retry_limit': <google.appengine.api.validation.Optional object>, u'min_backoff_seconds': <google.appengine.api.validation.Optional object>, u'task_age_limit': <google.appengine.api.validation.Optional object>, u'max_backoff_seconds': <google.appengine.api.validation.Optional object>, u'max_doublings': <google.appengine.api.validation.Optional object>}
google.appengine.api.queueinfo.TranslateRetryParameters(retry)source

Populates a TaskQueueRetryParameters from a queueinfo.RetryParameters.

Parameters

retry – A queueinfo.RetryParameters that is read from queue.yaml that describes the queue’s retry parameters.

Returns

A taskqueue_service_pb.TaskQueueRetryParameters proto populated with the data from retry.

Raises

MalformedQueueConfiguration – If the retry parameters are invalid.