---
title: Charmhub | Deploy Filesystem Client using Charmhub - The Open Operator Collection
description: Deploy the latest version of Filesystem Client on any cloud.
url: https://charmhub.io/filesystem-client/libraries/mount_info
---

# Filesystem Client

[José Julián Espina Del Ángel](https://charmhub.io/publisher/jedel "View all packages from José Julián Espina Del Ángel")

* [José Julián Espina Del Ángel](https://charmhub.io/publisher/jedel "View all packages from José Julián Espina Del Ángel")

Platform:

26.04

24.04

beta 1e5e5b8

```
juju deploy filesystem-client --channel beta
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

[Toggle side navigation](https://charmhub.io/filesystem-client/libraries/mount_info#drawer)

## charms.filesystem\_client.v0.mount\_info

* [*Docstrings*Docstrings](https://charmhub.io/filesystem-client/libraries/mount_info)
  [*Code*Source code](https://charmhub.io/filesystem-client/libraries/mount_info/source-code)
* + Download

    Fetch library

    ```
    charmcraft fetch-lib charms.filesystem_client.v0.mount_info
    ```

    [Download mount\_info.py](https://charmhub.io/filesystem-client/libraries/mount_info/download)
  + *Last updated* 10 Jul 2025
  + *Revision* Library version 0.1

Library to manage relations between a filesystem client and a mount requirer.

This library contains the MountProvides and MountRequires classes for managing a
relation between a filesystem client operator and a mount requirer.

##### MountInfo (mount information)

This class defines information about the mount provided by the filesystem client.

##### MountRequires (filesystem client)

This class provides a uniform interface for charms that require a mounted shared filesystems,
and convenience methods for consuming data sent by the filesystem client charm.

###### Defined events

* `connected`: Event emitted when the filesystem client is ready to receive mount information.
* `mounted`: Event emitted when the filesystem is mounted in the system.
* `unmounted`: Event emitted when the filesystem is unmounted from the system.
* `disconnected`: Event emitted when the filesystem client has disconnected from the mount requirer.

###### Example

```
import ops
from charms.filesystem_client.v0.mount_info import MountRequires, MountInfo

class MountClient(ops.CharmBase):

    def __init__(self, *args, **kwargs) -> None:
        super().__init__(*args, **kwargs)
        self._mount = MountRequires(self, "mount")
        self.framework.observe(self._mount.on.mount_provider_connected, self._on_mount_provider_connected)
        self.framework.observe(self._mount.on.mounted_filesystem, self._on_mounted_filesystem)
        self.framework.observe(self._mount.on.unmounted_filesystem, self._on_unmounted_filesystem)

    def _on_mount_provider_connected(self, event: EventBase) -> None:
        for relation in self._mount.relations:
            self._mount.set_mount_info(relation.id, MountInfo(mountpoint="/srv"))

        self.unit.status = ops.ActiveStatus()

    def _on_mounted_filesystem(self, _) -> None:
        self.write_files()

    def _on_unmounted_filesystem(self, _) -> None:
        self.recover_files()
```

##### MountProvides (filesystem client)

This library provides an interface for the filesystem client operator to receive
mount share requests.

###### Defined events

* `requested`: Event emitted when a mount requirer requests mounting a filesystem.
* `unrequested`: Event emitted when the mount requirer withdraws its mount request.

---

Index

* [class MountInfoError](https://charmhub.io/filesystem-client/libraries/mount_info#mountinfoerror)
* [class MountInfo](https://charmhub.io/filesystem-client/libraries/mount_info#mountinfo)
* [class MountProviderConnectedEvent](https://charmhub.io/filesystem-client/libraries/mount_info#mountproviderconnectedevent)
* [class MountedFilesystemEvent](https://charmhub.io/filesystem-client/libraries/mount_info#mountedfilesystemevent)
* [class UnmountedFilesystemEvent](https://charmhub.io/filesystem-client/libraries/mount_info#unmountedfilesystemevent)
* [class MountProviderDisconnectedEvent](https://charmhub.io/filesystem-client/libraries/mount_info#mountproviderdisconnectedevent)
* [class MountRequiresEvents](https://charmhub.io/filesystem-client/libraries/mount_info#mountrequiresevents)
* [class MountRequires](https://charmhub.io/filesystem-client/libraries/mount_info#mountrequires)
* + [def \_\_init\_\_(
    self,
    charm,
    relation\_name)](https://charmhub.io/filesystem-client/libraries/mount_info#mountrequires-__init__)
* + [def set\_mount\_info(
    self,
    relation\_id,
    info)](https://charmhub.io/filesystem-client/libraries/mount_info#mountrequires-set_mount_info)
* [class MountRequestedEvent](https://charmhub.io/filesystem-client/libraries/mount_info#mountrequestedevent)
* [class MountUnrequestedEvent](https://charmhub.io/filesystem-client/libraries/mount_info#mountunrequestedevent)
* [class MountProvidesEvents](https://charmhub.io/filesystem-client/libraries/mount_info#mountprovidesevents)
* [class MountProvides](https://charmhub.io/filesystem-client/libraries/mount_info#mountprovides)
* + [def \_\_init\_\_(
    self,
    charm,
    relation\_name)](https://charmhub.io/filesystem-client/libraries/mount_info#mountprovides-__init__)
* + [def mount\_info(
    self,
    relation\_id)](https://charmhub.io/filesystem-client/libraries/mount_info#mountprovides-mount_info)
* + [def set\_mount\_status(
    self,
    mounted)](https://charmhub.io/filesystem-client/libraries/mount_info#mountprovides-set_mount_status)

#### class MountInfoError

Description

Exception raised when an operation failed. None

#### class MountInfo

Description

Information required to mount a filesystem. None

#### class MountProviderConnectedEvent

Description

Emit when a mount provider is waiting for the mount info. None

#### class MountedFilesystemEvent

Description

Emit when a mount provider has mounted the filesystem. None

#### class UnmountedFilesystemEvent

Description

Emit when a mount provider has unmounted the filesystem. None

#### class MountProviderDisconnectedEvent

Description

Emit when a mount provider has left the charm relation. None

#### class MountRequiresEvents

Description

Events that mount providers can emit. None

#### class MountRequires

Description

Consumer-side interface of mount integrations. None

Methods

MountRequires.
\_\_init\_\_(

*self*

,
charm: CharmBase

,
relation\_name: str
)

MountRequires.
set\_mount\_info(

*self*

,
relation\_id: int

,
info: MountInfo
)

Set mount info for mounting the filesystem.

Arguments

relation\_id

Identifier for the specific relation.

info

Information to mount the filesystem.

#### class MountRequestedEvent

Description

Emit when a mount requirer has provided the mount info. None

#### class MountUnrequestedEvent

Description

Emit when a mount requirer has removed its mount info. None

#### class MountProvidesEvents

Description

Events that mount requirers can emit. None

#### class MountProvides

Description

Provider-side interface of mount integrations. None

Methods

MountProvides.
\_\_init\_\_(

*self*

,
charm: CharmBase

,
relation\_name: str
)

MountProvides.
mount\_info(

*self*

,
relation\_id: int
)

Fetch the mount information of a relation.

Returns

MountInfo

information to mount a filesystem. None if the relation has not provided
the required information.

Description

Notes:
Method cannot be used in `*-relation-broken` events and will raise an exception.

MountProvides.
set\_mount\_status(

*self*

,
mounted: bool
)

Set the current mount status of the filesystem.

Arguments

mounted

boolean representing the mount status of the filesystem.
