flowserv.model.constraint module
Collection of methods to check and enforce constraints that are currently defined for the objects that are stored in the database.
- flowserv.model.constraint.validate_identifier(identifier: str) bool
Validate the given identifier to ensure that: (i) it’s length is between 1 and 32, and (ii) it only contains letters (A-Z), digites, or underscore.
If the idnentifier is None it is considered valid. If an invalid identifier is given a ValueError will be raised.
Returns True if the identifier is valid.
- Parameters
identifier (string) – Unique identifier string or None
- Raises
ValueError –
- flowserv.model.constraint.validate_name(name)
Validate the given name. Raises an error if the given name violates the current constraints for names. The constraints are:
no empty or missing names
names can be at most 512 characters long
- Parameters
name (string) – Name that is being validated
- Raises