The nova.api.validator Module

validate(args, validator)

Validate values of args against validators in validator.

Parameters:
  • args – Dict of values to be validated.
  • validator – A dict where the keys map to keys in args and the values are validators. Applies each validator to args[key]
Returns:

True if validation succeeds. Otherwise False.

A validator should be a callable which accepts 1 argument and which returns True if the argument passes validation. False otherwise. A validator should not raise an exception to indicate validity of the argument.

Only validates keys which show up in both args and validator.

validate_image_path(val)
validate_int(max_value=None)
validate_str(max_length=None)
validate_url_path(val)

True if val is matched by the path component grammar in rfc3986.

validate_user_data(user_data)

Check if the user_data is encoded properly.

Previous topic

The nova.api.sizelimit Module

Next topic

The nova.availability_zones Module

This Page