---
title: Charmhub | Deploy S3proxy Charmed Operator using Charmhub - The Open Operator
  Collection
description: Deploy the latest version of S3proxy Charmed Operator as a Kubernetes
  Operator on any cloud.
url: https://charmhub.io/s3proxy-k8s/libraries/object_storage
---

# S3proxy Charmed Operator

[Ryan Barry](https://charmhub.io/publisher/rbarry "View all packages from Ryan Barry")

* [Ryan Barry](https://charmhub.io/publisher/rbarry "View all packages from Ryan Barry")

Platform:

edge 10

```
juju deploy s3proxy-k8s --channel edge
```

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

[Toggle side navigation](https://charmhub.io/s3proxy-k8s/libraries/object_storage#drawer)

## charms.s3proxy\_k8s.v0.object\_storage

* [*Docstrings*Docstrings](https://charmhub.io/s3proxy-k8s/libraries/object_storage)
  [*Code*Source code](https://charmhub.io/s3proxy-k8s/libraries/object_storage/source-code)
* + Download

    Fetch library

    ```
    charmcraft fetch-lib charms.s3proxy_k8s.v0.object_storage
    ```

    [Download object\_storage.py](https://charmhub.io/s3proxy-k8s/libraries/object_storage/download)
  + *Last updated* 28 Jan 2023
  + *Revision* Library version 0.1

#### S3-Compatible Object Storage Library.

This library wraps relation endpoints using the `s3` interface
and provides a Python API both for requesting and providing per-application
object storage.

##### Getting Started

To get started using the library, you just need to fetch the library using `charmcraft`.

```
cd some-charm
charmcraft fetch-lib charms.s3proxy_k8s.v0.object-storage
```

In the `metadata.yaml` of the charm, add the following:

```
requires:
    s3:
        interface: s3
```

Then, to initialise the library:

```
from charms.s3proxy_k8s.v0.object_storage import (ObjectStorageRequirer,
  ObjectStorageReadyEvent)

class SomeCharm(CharmBase):
  def __init__(self, *args):
    # ...
    self.blobstore = ObjectStorageRequirer(self, bucket="some-charm")
    # The following event is triggered when the Object Storage to be used
    # by this deployment of the `SomeCharm` is ready (or changes).
    self.framework.observe(
        self.blobstore.on.ready, self._on_object_storage_ready
    )

    def _on_object_storage_ready_ready(self, event: ObjectStorageReadyEvent):
        # Configure with:
        #  event.access_key
        #  event.secret_key
        #  event.path
        #  event.endpoint
        pass
```

---

Index

* [class DataValidationError](https://charmhub.io/s3proxy-k8s/libraries/object_storage#datavalidationerror)
* [class ObjectStorageDataProvidedEvent](https://charmhub.io/s3proxy-k8s/libraries/object_storage#objectstoragedataprovidedevent)
* [class ObjectStorageDataRefreshEvent](https://charmhub.io/s3proxy-k8s/libraries/object_storage#objectstoragedatarefreshevent)
* [class ObjectStorageProviderCharmEvents](https://charmhub.io/s3proxy-k8s/libraries/object_storage#objectstorageprovidercharmevents)
* [class SingleAuthObjectStorageProvider](https://charmhub.io/s3proxy-k8s/libraries/object_storage#singleauthobjectstorageprovider)
* + [def \_\_init\_\_(
    self,
    charm,
    relation\_name,
    refresh\_event)](https://charmhub.io/s3proxy-k8s/libraries/object_storage#singleauthobjectstorageprovider-__init__)
* + [def update\_endpoints(
    self,
    data,
    relation\_id)](https://charmhub.io/s3proxy-k8s/libraries/object_storage#singleauthobjectstorageprovider-update_endpoints)
* [class ObjectStorageReadyEvent](https://charmhub.io/s3proxy-k8s/libraries/object_storage#objectstoragereadyevent)
* [class ObjectStorageBrokenEvent](https://charmhub.io/s3proxy-k8s/libraries/object_storage#objectstoragebrokenevent)
* [class ObjectStorageRequirerCharmEvents](https://charmhub.io/s3proxy-k8s/libraries/object_storage#objectstoragerequirercharmevents)
* [class ObjectStorageRequirer](https://charmhub.io/s3proxy-k8s/libraries/object_storage#objectstoragerequirer)
* + [def \_\_init\_\_(
    self,
    charm,
    relation\_name,
    bucket)](https://charmhub.io/s3proxy-k8s/libraries/object_storage#objectstoragerequirer-__init__)
* + [def relation(
    self)](https://charmhub.io/s3proxy-k8s/libraries/object_storage#objectstoragerequirer-relation)
* + [def bucket\_info(
    self)](https://charmhub.io/s3proxy-k8s/libraries/object_storage#objectstoragerequirer-bucket_info)

#### class DataValidationError

Description

Raised when data validation fails on IPU relation data. None

#### class ObjectStorageDataProvidedEvent

Description

Event representing that object storage data has been provided for an app. None

#### class ObjectStorageDataRefreshEvent

Description

Request a refresh of data. None

#### class ObjectStorageProviderCharmEvents

Description

List of events that the auth provider charm can leverage. None

#### class SingleAuthObjectStorageProvider

Class for single authentication object storage providers.

Description

For now (with s3proxy), authentication details are the same for all
clients, differing only in the bucket.

Methods

SingleAuthObjectStorageProvider.
\_\_init\_\_(

*self*

,
charm: CharmBase

,
relation\_name: str

,
refresh\_event
)

SingleAuthObjectStorageProvider.
update\_endpoints(

*self*

,
data

,
relation\_id
)

Description

Update relation data bags with endpoint information. None

#### class ObjectStorageReadyEvent

Description

Event representing that object storage data has been provided for an app. None

#### class ObjectStorageBrokenEvent

Description

Event representing that an object storage relation has been broken. None

#### class ObjectStorageRequirerCharmEvents

Description

List of events that the object storage requirer charm can leverage. None

#### class ObjectStorageRequirer

Description

Authentication configuration requirer class. None

Methods

ObjectStorageRequirer.
\_\_init\_\_(

*self*

,
charm

,
relation\_name: str

,
bucket
)

Constructs a requirer that consumes object storage.

Arguments

charm

CharmBase: the charm which manages this object.

relation\_name

str: name of the relation in `metadata.yaml` that has the
`s3` interface.

refresh\_event

an optional bound event which will be observed to re-set
authentication configuration.

bucket

Optional[str]: bucket name to request on the endpoint. If not
provided, {model.name}-{app.name} will be used.

Description

This class can be initialized as follows:

```
self.object_storage = ObjectStorageRequirer(
self,
bucket="some-app"
)
```

ObjectStorageRequirer.
relation(

*self*
)

Description

The established Relation instance, or None if still unrelated. None

ObjectStorageRequirer.
bucket\_info(

*self*
)

Description

Indicate whether a remote bucket is available. None
