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.

google.appengine.api.dosinfo module

Summary

DOS configuration tools.

Library for parsing dos.yaml files and working with these in memory.

Contents

class google.appengine.api.dosinfo.BlacklistEntry(**attributes)source

Bases: google.appengine.api.validation.Validated

A blacklist entry describes a blocked IP address or subnet.

ATTRIBUTES = {u'subnet': <google.appengine.api.dosinfo.SubnetValidator object>, u'description': <google.appengine.api.validation.Optional object>}
class google.appengine.api.dosinfo.DosInfoExternal(**attributes)source

Bases: google.appengine.api.validation.Validated

Describes the format of a dos.yaml file.

ATTRIBUTES = {u'blacklist': <google.appengine.api.validation.Optional object>, 'application': <google.appengine.api.validation.Optional object>}
google.appengine.api.dosinfo.LoadSingleDos(dos_info, open_fn=None)source

Load a dos.yaml file or string and return a DosInfoExternal object.

Parameters
  • dos_info – The contents of a dos.yaml file as a string, or an open file object.

  • open_fn – Function for opening files. Unused.

Returns

A DosInfoExternal instance which represents the contents of the parsed yaml file.

Raises
  • MalformedDosConfiguration – The yaml file contains multiple blacklist sections.

  • yaml_errors.EventError – An error occured while parsing the yaml file.

exception google.appengine.api.dosinfo.MalformedDosConfigurationsource

Bases: exceptions.Exception

Configuration file for DOS API is malformed.

class google.appengine.api.dosinfo.SubnetValidator(default=None)source

Bases: google.appengine.api.validation.Validator

Checks that a subnet can be parsed and is a valid IPv4 or IPv6 subnet.

Validate(value, unused_key=None)source

Validates a subnet.