Documentation

api.reservations.days_consumed

Fetch the duration of days consumed by reservations within some filter parameters. Reservations with multiple units will return duration * units. 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.days_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_ical_feeds: bool = False, # Boolean for including ical feeds
  include_templates: bool = True, # Boolean for including template reservations
  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 days consumed.

When reservable_id is not provided, the function will return a dict mapping reservable_id (str) to dec.

Examples:

days = api.reservations.days_consumed(reservable_id="foo") # days = <dec>
# days = { "foo": <dec> }
days = api.reservations.days_consumed()