Event '<storage name>-storage-detaching'

Event > List of events > Storage events > <storage name>-storage-detaching

This document describes the <storage name>-storage-detaching event. The event allows a charm to perform cleanup tasks on a storage volume before that storage is dismounted and possibly destroyed.

Contents:

Emission sequence

This event is emitted when a request to detach storage has been processed. After the hook completes, the storage will be removed, and the charm will not have further opportunities to interact with it.

Observing this event in Ops

In ops, you can observe the remove event like you would any other:

self.framework.observe(self.on.<storage-name>-storage-detaching, self._on_<storage-name>-storage-detaching)

The event object contains information about which volume was detached.