keystone.limit.models package

Submodules

keystone.limit.models.base module

class keystone.limit.models.base.ModelBase[source]

Bases: object

Interface for a limit model driver.

DESCRIPTION = None
MAX_PROJECT_TREE_DEPTH = None
NAME = None
check_limit(limits)[source]

Check the new creating or updating limits if satisfy the model.

Parameters

limits (A list of the limits. Each limit is a dictionary reference containing all limit attributes.) – A list of the limit references to be checked.

Raises

keystone.exception.InvalidLimit – If any of the input limits doesn’t satisfy the limit model.

keystone.limit.models.base.load_driver(driver_name, *args)[source]

keystone.limit.models.flat module

class keystone.limit.models.flat.FlatModel[source]

Bases: keystone.limit.models.base.ModelBase

DESCRIPTION = 'Limit enforcement and validation does not take project hierarchy into consideration.'
MAX_PROJECT_TREE_DEPTH = None
NAME = 'flat'
check_limit(limits)[source]

Check the new creating or updating limits if satisfy the model.

Parameters

limits (A list of the limits. Each limit is a dictionary reference containing all limit attributes.) – A list of the limit references to be checked.

Raises

keystone.exception.InvalidLimit – If any of the input limits doesn’t satisfy the limit model.

keystone.limit.models.strict_two_level module

class keystone.limit.models.strict_two_level.StrictTwoLevelModel[source]

Bases: keystone.limit.models.base.ModelBase

DESCRIPTION = 'This model requires project hierarchy never exceeds a depth of two'
MAX_PROJECT_TREE_DEPTH = 2
NAME = 'strict_two_level'
check_limit(limits)[source]

Check the input limits satisfy the related project tree or not.

  1. Ensure the input is legal.

  2. Ensure the input will not break the exist limit tree.

Module contents