---
title: Charmhub | Deploy Heat K8S using Charmhub - The Open Operator Collection
description: Deploy the latest version of Heat K8S as a Kubernetes Operator on any
  cloud.
url: https://charmhub.io/heat-k8s/libraries/heat_shared_config
---

# Heat K8S

[OpenStack Charmers](https://charmhub.io/publisher/openstack-charmers "View all packages from OpenStack Charmers")

* [OpenStack Charmers](https://charmhub.io/publisher/openstack-charmers "View all packages from OpenStack Charmers")

Platform:

edge 4

```
juju deploy heat-k8s --channel edge
```

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

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

## charms.heat\_k8s.v0.heat\_shared\_config

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

    Fetch library

    ```
    charmcraft fetch-lib charms.heat_k8s.v0.heat_shared_config
    ```

    [Download heat\_shared\_config.py](https://charmhub.io/heat-k8s/libraries/heat_shared_config/download)
  + *Last updated* 10 Oct 2023
  + *Revision* Library version 0.1

HeatSharedConfig Provides and Requires module.

This library contains the Requires and Provides classes for handling
the heat-shared-config interface.

Import `HeatSharedConfigRequires` in your charm, with the charm object and the
relation name:
- self
- "heat\_config"

Two events are also available to respond to:
- config\_changed
- goneaway

A basic example showing the usage of this relation follows:

```
from charms.heat_k8s.v0.heat_shared_config import (
    HeatSharedConfigRequires
)

class HeatSharedConfigClientCharm(CharmBase):
    def __init__(self, *args):
        super().__init__(*args)
        #  HeatSharedConfig Requires
        self.heat_config = HeatSharedConfigRequires(
            self, "heat_config",
        )
        self.framework.observe(
            self.heat_config.on.config_changed,
            self._on_heat_shared_config_changed
        )
        self.framework.observe(
            self.heat_config.on.goneaway,
            self._on_heat_shared_config_goneaway
        )

    def _on_heat_shared_config_changed(self, event):
        '''React to the Heat shared config changed event.

        This event happens when Heat shared config relation is added to the
        model and relation data is changed.
        '''
        # Do something with the configuration provided by relation.
        pass

    def _on_heat_shared_config_goneaway(self, event):
        '''React to the HeatSharedConfig goneaway event.

        This event happens when Heat shared config relation is removed.
        '''
        # HeatSharedConfig Relation has goneaway.
        pass
```

---

Index

* [class HeatSharedConfigRequestEvent](https://charmhub.io/heat-k8s/libraries/heat_shared_config#heatsharedconfigrequestevent)
* [class HeatSharedConfigProviderEvents](https://charmhub.io/heat-k8s/libraries/heat_shared_config#heatsharedconfigproviderevents)
* [class HeatSharedConfigProvides](https://charmhub.io/heat-k8s/libraries/heat_shared_config#heatsharedconfigprovides)
* + [def \_\_init\_\_(
    self,
    charm,
    relation\_name)](https://charmhub.io/heat-k8s/libraries/heat_shared_config#heatsharedconfigprovides-__init__)
* + [def set\_config(
    self,
    relation,
    auth\_encryption\_key)](https://charmhub.io/heat-k8s/libraries/heat_shared_config#heatsharedconfigprovides-set_config)
* [class HeatSharedConfigChangedEvent](https://charmhub.io/heat-k8s/libraries/heat_shared_config#heatsharedconfigchangedevent)
* [class HeatSharedConfigGoneAwayEvent](https://charmhub.io/heat-k8s/libraries/heat_shared_config#heatsharedconfiggoneawayevent)
* [class HeatSharedConfigRequirerEvents](https://charmhub.io/heat-k8s/libraries/heat_shared_config#heatsharedconfigrequirerevents)
* [class HeatSharedConfigRequires](https://charmhub.io/heat-k8s/libraries/heat_shared_config#heatsharedconfigrequires)
* + [def \_\_init\_\_(
    self,
    charm,
    relation\_name)](https://charmhub.io/heat-k8s/libraries/heat_shared_config#heatsharedconfigrequires-__init__)
* + [def get\_remote\_app\_data(
    self,
    key)](https://charmhub.io/heat-k8s/libraries/heat_shared_config#heatsharedconfigrequires-get_remote_app_data)
* + [def auth\_encryption\_key(
    self)](https://charmhub.io/heat-k8s/libraries/heat_shared_config#heatsharedconfigrequires-auth_encryption_key)

#### class HeatSharedConfigRequestEvent

Description

HeatConfigRequest Event. None

#### class HeatSharedConfigProviderEvents

Description

Events class for `on`. None

#### class HeatSharedConfigProvides

Description

HeatSharedConfigProvides class. None

Methods

HeatSharedConfigProvides.
\_\_init\_\_(

*self*

,
charm: CharmBase

,
relation\_name: str
)

HeatSharedConfigProvides.
set\_config(

*self*

,
relation: Relation

,
auth\_encryption\_key: str
)

Description

Set heat configuration on the relation. None

#### class HeatSharedConfigChangedEvent

Description

HeatSharedConfigChanged Event. None

#### class HeatSharedConfigGoneAwayEvent

Description

HeatSharedConfigGoneAway Event. None

#### class HeatSharedConfigRequirerEvents

Description

Events class for `on`. None

#### class HeatSharedConfigRequires

Description

HeatSharedConfigRequires class. None

Methods

HeatSharedConfigRequires.
\_\_init\_\_(

*self*

,
charm: CharmBase

,
relation\_name: str
)

HeatSharedConfigRequires.
get\_remote\_app\_data(

*self*

,
key: str
)

Description

Return the value for the given key from remote app data. None

HeatSharedConfigRequires.
auth\_encryption\_key(

*self*
)

Description

Return the auth\_encryption\_key. None
