api.reservations.units_consumed
Fetch the number of units consumed by reservations within some filter parameters. All API calls are executed from that database perspective of the reservation having already been made, so the current reservation being made will be counted in the results.
Arguments:
def api.reservations.units_consumed(
account_number: str = None, # Filter on account number set on reservation
end: datetime = None, # End time of filter
include_blocked: bool = False, # Boolean for including reservations of resources that block any filtered resources
include_cancelled: bool = False, # Boolean for including cancelled reservations.
include_checked_in: bool = True, # Boolean for including checked in reservations
include_filtered_user_if_guest: bool = True,
include_ical_feeds: bool = False, # Boolean for including ical feeds
include_maintenance: bool = False, # Boolean for blocking maintenance
include_maintenance_nonblocking: bool = False, # Boolean to included nonblocking if above is true
include_not_checked_in: bool = True, # Boolean for all reservations not checked in
include_templates: bool = True, # Boolean for including template reservations
rate_meta_data_query: str = None, # The query to match in rate metadata
rate_meta_data_query_path: list of str = None, # The path to match in rate metadata
requests: bool = None, # Boolean for filtering on requests instead of reservations
reservable_id: str = None, # Resource ID
start: datetime = None, # Start time of filter
tags: list of str = None, # Tags to filter on (case insensitive)
user_id: str = None, # User ID to filter on
usergroup_name: str = None, # User group name to filter on (case insensitive)
):
When reservable_id
is provided, the function will return a dec
representing the number of units consumed.
When reservable_id
is not provided, the function will return a dict
mapping reservable_id (str
) to dec
.
Examples:
units = api.reservations.units_consumed(reservable_id="foo") # units = <dec>
# units = { "foo": <dec> }
units = api.reservations.units_consumed()