Python 2.7 has reached end of support
and will be
deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Python 2.7
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Python
2.7 applications will continue to run and receive traffic after their
deprecation date. We recommend that
you
migrate to the latest supported version of Python.
Stay organized with collections
Save and categorize content based on your preferences.
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.
ReturnsA DosInfoExternal instance which represents the contents of the parsed yaml
file.
Raises
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 2025-06-16 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-16 UTC."],[[["\u003cp\u003eThe \u003ccode\u003egoogle.appengine.api.dosinfo\u003c/code\u003e module provides tools for managing DOS (Denial of Service) configurations, including parsing and working with \u003ccode\u003edos.yaml\u003c/code\u003e files.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eBlacklistEntry\u003c/code\u003e represents a blocked IP address or subnet, characterized by its subnet and description attributes.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDosInfoExternal\u003c/code\u003e defines the structure of a \u003ccode\u003edos.yaml\u003c/code\u003e file, allowing for the specification of blacklists and an application.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLoadSingleDos\u003c/code\u003e function parses a \u003ccode\u003edos.yaml\u003c/code\u003e file or string, returning a \u003ccode\u003eDosInfoExternal\u003c/code\u003e object, and raises errors for malformed configurations or parsing issues.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSubnetValidator\u003c/code\u003e is used to verify that provided subnets are valid IPv4 or IPv6 subnets.\u003c/p\u003e\n"]]],[],null,["# google.appengine.api.dosinfo module\n===================================\n\nSummary\n-------\n\nDOS configuration tools.\n\nLibrary for parsing dos.yaml files and working with these in memory.\n\nContents\n--------\n\n*class* google.appengine.api.dosinfo.BlacklistEntry(\\*\\*attributes)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/dosinfo#BlacklistEntry)\n\n: Bases: [google.appengine.api.validation.Validated](/appengine/docs/legacy/standard/python/refdocs/google.appengine.api.validation#google.appengine.api.validation.Validated)\n\n A blacklist entry describes a blocked IP address or subnet. \n\n ATTRIBUTES*= {u'subnet': \\\u003cgoogle.appengine.api.dosinfo.SubnetValidator object\\\u003e, u'description': \\\u003cgoogle.appengine.api.validation.Optional object\\\u003e}*\n: \n\n*class* google.appengine.api.dosinfo.DosInfoExternal(\\*\\*attributes)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/dosinfo#DosInfoExternal)\n\n: Bases: [google.appengine.api.validation.Validated](/appengine/docs/legacy/standard/python/refdocs/google.appengine.api.validation#google.appengine.api.validation.Validated)\n\n Describes the format of a dos.yaml file. \n\n ATTRIBUTES*= {u'blacklist': \\\u003cgoogle.appengine.api.validation.Optional object\\\u003e, 'application': \\\u003cgoogle.appengine.api.validation.Optional object\\\u003e}*\n: \n\ngoogle.appengine.api.dosinfo.LoadSingleDos(dos_info, open_fn=None)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/dosinfo#LoadSingleDos)\n\n: Load a dos.yaml file or string and return a DosInfoExternal object.\n\n Parameters\n\n - dos_info -- The contents of a dos.yaml file as a string, or an open file\n object.\n\n - open_fn -- Function for opening files. Unused.\n\n Returns\n\n A DosInfoExternal instance which represents the contents of the parsed yaml\n file.\n Raises\n\n - [MalformedDosConfiguration](#google.appengine.api.dosinfo.MalformedDosConfiguration) -- The yaml file contains multiple blacklist\n sections.\n\n - yaml_errors.EventError -- An error occured while parsing the yaml file.\n\n*exception* google.appengine.api.dosinfo.MalformedDosConfiguration[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/dosinfo#MalformedDosConfiguration)\n\n: Bases: exceptions.Exception\n\nConfiguration file for DOS API is malformed. \n\n*class* google.appengine.api.dosinfo.SubnetValidator(default=None)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/dosinfo#SubnetValidator)\n\n: Bases: [google.appengine.api.validation.Validator](/appengine/docs/legacy/standard/python/refdocs/google.appengine.api.validation#google.appengine.api.validation.Validator)\n\n Checks that a subnet can be parsed and is a valid IPv4 or IPv6 subnet. \n\n Validate(value, unused_key=None)[source](/appengine/docs/legacy/standard/python/refdocs/modules/google/appengine/api/dosinfo#SubnetValidator.Validate)\n\n : Validates a subnet."]]