Implementation of SQLAlchemy backend.
Ensures a request has permission to access the given project.
Ensures a request has permission to access the given quota class.
Ensures a request has permission to access the given user.
Create matching filter.
If value is an iterable other than a string, any of the values is a valid match (OR), so we’ll use SQL IN operator.
If it’s not an iterator == operator will be used.
Create non matching filter.
If value is an iterable other than a string, any of the values is a valid match (OR), so we’ll use SQL IN operator.
If it’s not an iterator == operator will be used.
If auto_none is True then we’ll consider NULL values as different as well, like we do in Python and not like SQL does.
The backend is this module itself.
Indicates if the request context is an administrator.
Check if object is an ORM field or expression.
Indicates if the request context is a normal user.
Return True if filter values exist on the model
Parameters: |
|
---|
Query helper that accounts for context’s read_deleted field.
Parameters: |
|
---|
Process the sort parameters to include default keys.
Creates a list of sort keys and a list of sort directions. Adds the default keys to the end of the list if they are not already included.
When adding the default keys to the sort keys list, the associated direction is: 1) The first element in the ‘sort_dirs’ list (if specified), else 2) ‘default_dir’ value (Note that ‘asc’ is the default value since this is the default in sqlalchemy.utils.paginate_query)
Parameters: |
|
---|---|
Returns: | list of sort keys, list of sort directions |
Raises exception.InvalidInput: | |
If more sort directions than sort keys are specified or if an invalid sort direction is specified |
Destroy all limit quotas associated with a project.
Leaves usage and reservation quotas intact.
Decorator to require admin request context.
The first argument to the wrapped function must be the context.
Decorator to require any user or admin context.
This does no authorization for user or project access matching, see authorize_project_context() and authorize_user_context().
The first argument to the wrapped function must be the context.
Decorator to require the specified snapshot to exist.
Requires the wrapped function to use context and snapshot_id as their first two arguments.
Decorator to require the specified volume to exist.
Requires the wrapped function to use context and volume_id as their first two arguments.
Update volume status based on attachment.
Get volume and check if ‘volume_attachment’ parameter is present in volume. If ‘volume_attachment’ is None then set volume status to ‘available’ else set volume status to ‘in-use’.
Parameters: |
|
---|---|
Returns: | updated volume |