Skip to content

Archive models

Refs https://redmine.teklia.com/issues/4717 \

An API user with admin rights on a model should be able to archive/unarchive that model.

We will add an archived nullable datetime that will be set/unset to represent the model state.

The update endpoint for model (from #1637 (closed) ) must allow setting an archived boolean field (when the user is admin on that model). We do not want to set the date directly: the backend will update it instead.

We need a date to be stored to build later on an auto-deletion feature that will run asynchronously and will delete models archived a while ago.

Only ListModels endpoint must be updated to filter out the models when archived.

You must check that an archived model is not usable in a new worker run, or when starting a process.

We will not support the archived state on retrieve & update endpoints, only on lists, so that API users can still update them to restore them.

The ListModels endpoint must support an optional query parameter archived=true|false to allow users to list archived models. By default, this is set to false to view unarchived models.