flexmeasures.ui.crud.assets.views

Classes

class flexmeasures.ui.crud.assets.views.AssetCrudUI

These views help us offer a Jinja2-based UI. The main focus on logic is the API, so these views simply call the API functions, and deal with the response. Some new functionality, like fetching accounts and asset types, is added here.

auditlog(id: str)

/assets/auditlog/<id>

delete_with_data(id: str)

Delete via /assets/delete_with_data/<id>

get(id: str, **kwargs)

GET from /assets/<id> where id can be ‘new’ (and thus the form for asset creation is shown) The following query parameters are supported (should be used only together):

  • start_time: minimum time of the events to be shown

  • end_time: maximum time of the events to be shown

index(msg='')

GET from /assets

List the user’s assets. For admins, list across all accounts.

owned_by(account_id: str)

/assets/owned_by/<account_id>

post(id: str)

POST to /assets/<id>, where id can be ‘create’ (and thus a new asset is made from POST data) Most of the code deals with creating a user for the asset if no existing is chosen.

status(id: str)

GET from /assets/<id>/status to show the staleness of the asset’s sensors.