---
title: Charmhub | Deploy Storage Libs using Charmhub - The Open Operator Collection
description: Deploy the latest version of Storage Libs on any cloud.
url: https://charmhub.io/storage-libs/libraries/cephfs_interfaces
---

# Storage Libs

[HPC Charm Team](https://charmhub.io/publisher/hpc-charmers "View all packages from HPC Charm Team")

* [HPC Charm Team](https://charmhub.io/publisher/hpc-charmers "View all packages from HPC Charm Team")

Platform:

22.04

stable 1

```
juju deploy storage-libs
```

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

[Toggle side navigation](https://charmhub.io/storage-libs/libraries/cephfs_interfaces#drawer)

## charms.storage\_libs.v0.cephfs\_interfaces

* [*Docstrings*Docstrings](https://charmhub.io/storage-libs/libraries/cephfs_interfaces)
  [*Code*Source code](https://charmhub.io/storage-libs/libraries/cephfs_interfaces/source-code)
* + Download

    Fetch library

    ```
    charmcraft fetch-lib charms.storage_libs.v0.cephfs_interfaces
    ```

    [Download cephfs\_interfaces.py](https://charmhub.io/storage-libs/libraries/cephfs_interfaces/download)
  + *Last updated* 21 May 2024
  + *Revision* Library version 0.2

Library to manage integrations between CephFS share providers and consumers.

This library contains the CephFSProvides and CephFSRequires classes for managing an
integration between a CephFS server operator and a CephFS client operator.

##### CephFSRequires (CephFS Client)

This class provides a uniform interface for charms that need to mount, unmount,
or request CephFS shares, and convenience methods for consuming data sent by a
CephFS server charm.

###### Defined events

* `server_connected`: Event emitted when the CephFS client is connected to the CephFS server.
  Here is where CephFS clients will commonly request the CephFS share they need created.
* `mount_share`: Event emitted when the CephFS share is ready to be mounted.
* `umount_share`: Event emitted when the CephFS share is ready or needs to be unmounted.

> **Note:** This charm library only supports a 1-on-1 relation between a CephFS server and a CephFS client.
> This is to prevent the CephFS client from having to manage and request multiple CephFS shares,
> and ensure that CephFS clients are creating unique mount points.

##### CephFSProvides (CephFS Server)

This library provides a uniform interface for charms that need to process CephFS share
requests, and convenience methods for consuming data sent by a CephFS client charm.

###### Defined events

* `share_requested`: Event emitted when the CephFS client requests a CephFS share.

> **Note:** It is the responsibility of the CephFS Provider charm to provide
> the implementation for creating a new CephFS share. CephFSProvides just provides
> the interface for the integration.

---

Index

* [class ServerConnectedEvent](https://charmhub.io/storage-libs/libraries/cephfs_interfaces#serverconnectedevent)
* [class CephFSAuthInfo](https://charmhub.io/storage-libs/libraries/cephfs_interfaces#cephfsauthinfo)
* [class CephFSShareInfo](https://charmhub.io/storage-libs/libraries/cephfs_interfaces#cephfsshareinfo)
* + [def \_\_init\_\_(
    self,
    fsid,
    name,
    path,
    monitor\_hosts)](https://charmhub.io/storage-libs/libraries/cephfs_interfaces#cephfsshareinfo-__init__)
* [class MountShareEvent](https://charmhub.io/storage-libs/libraries/cephfs_interfaces#mountshareevent)
* [class UmountShareEvent](https://charmhub.io/storage-libs/libraries/cephfs_interfaces#umountshareevent)
* [class ShareRequestedEvent](https://charmhub.io/storage-libs/libraries/cephfs_interfaces#sharerequestedevent)
* + [def name(
    self)](https://charmhub.io/storage-libs/libraries/cephfs_interfaces#sharerequestedevent-name)
* [class CephFSRequires](https://charmhub.io/storage-libs/libraries/cephfs_interfaces#cephfsrequires)
* + [def \_\_init\_\_(
    self,
    charm,
    integration\_name)](https://charmhub.io/storage-libs/libraries/cephfs_interfaces#cephfsrequires-__init__)
* + [def request\_share(
    self,
    integration\_id,
    name)](https://charmhub.io/storage-libs/libraries/cephfs_interfaces#cephfsrequires-request_share)
* [class CephFSProvides](https://charmhub.io/storage-libs/libraries/cephfs_interfaces#cephfsprovides)
* + [def \_\_init\_\_(
    self,
    charm,
    integration\_name)](https://charmhub.io/storage-libs/libraries/cephfs_interfaces#cephfsprovides-__init__)
* + [def set\_share(
    self,
    integration\_id,
    share\_info,
    auth\_info)](https://charmhub.io/storage-libs/libraries/cephfs_interfaces#cephfsprovides-set_share)

#### class ServerConnectedEvent

Description

Emit when a CephFS server is integrated with CephFS client. None

#### class CephFSAuthInfo

Authorization info to access a CephFS share.

Attributes

username

Name of the user authorized to access the Ceph filesystem.

key

Cephx key for the authorized user.

#### class CephFSShareInfo

Information about a shared CephFS.

Attributes

fsid

ID of the Ceph cluster.

name

Name of the exported Ceph filesystem.

path

Exported path of the Ceph filesystem.

monitor\_hosts

Address list of the available Ceph MON nodes.

Methods

CephFSShareInfo.
\_\_init\_\_(

*self*

,
fsid: str

,
name: str

,
path: str

,
monitor\_hosts
)

#### class MountShareEvent

Description

Emit when CephFS share is ready to be mounted. None

#### class UmountShareEvent

Description

Emit when CephFS share needs to be unmounted. None

#### class ShareRequestedEvent

Description

Emit when a consumer requests a new CephFS share be created by the provider. None

Methods

ShareRequestedEvent.
name(

*self*
)

Description

Get name of requested CephFS share. None

#### class CephFSRequires

Description

Consumer-side interface of CephFS share integrations. None

Methods

CephFSRequires.
\_\_init\_\_(

*self*

,
charm: CharmBase

,
integration\_name: str
)

CephFSRequires.
request\_share(

*self*

,
integration\_id: int

,
name: str
)

Request access to a CephFS share.

Arguments

integration\_id

Identifier for specific integration.

name

Name of the CephFS share.

#### class CephFSProvides

Description

Provider-side interface of CephFS share integrations. None

Methods

CephFSProvides.
\_\_init\_\_(

*self*

,
charm: CharmBase

,
integration\_name: str
)

CephFSProvides.
set\_share(

*self*

,
integration\_id: int

,
share\_info: CephFSShareInfo

,
auth\_info: CephFSAuthInfo
)

Set info for mounting a CephFS share.

Arguments

integration\_id

Identifier for specific integration.

share\_info

Information required to mount the CephFS share.

auth\_info

Information required to authenticate against the Ceph cluster.
