Wazuh Server
Platform:
| Channel | Revision | Published | Runs on |
|---|---|---|---|
| 4.11/stable | 274 | 26 Aug 2026 | |
| 4.11/edge | 286 | 10 Oct 2026 | |
| 4.14/stable | 303 | Today | |
| 4.14/edge | 303 | 17 Nov 2026 |
juju deploy wazuh-server --channel 4.11/stable
charms.wazuh_server.v0.wazuh_api
-
- Last updated 10 Nov 2026
- Revision Library version 0.5
Library to manage the integration with the Wazuh Server charm.
This library contains the Requires and Provides classes for handling the integration
between an application and a charm providing the wazuh-apli-client integration.
This library also contains a WazuhApiRelationData class to wrap the data that will
be shared via the integration.
Requirer Charm
from charms.wazuh_server.v0.wazuh_api import WazuhApiDataAvailableEvent, WazuhApiRequires
class WazuhApiRequirerCharm(ops.CharmBase):
def __init__(self, *args):
super().__init__(*args)
self.wazuh_api = wazuh_api.WazuhApiRequires(self)
self.framework.observe(self.wazuh_api.on.wazuh_api_data_available, self._handler)
...
def _handler(self, events: WazuhApiDataAvailableEvent) -> None:
...
As shown above, the library provides a custom event to handle the scenario in which new Wazuh API data has been added or updated.
Credential reads refresh the consumer's tracked secret revision and read both
fields from one content snapshot. Requirers should also observe secret-changed
and call get_relation_data() when their credentials secret changes: rotating a
secret does not necessarily change the relation databag.
get_relation_data() returns None with a diagnostic when published data is
incomplete, invalid, or its secret is unavailable. Credential access through the
custom event raises SecretError when the secret cannot be used.
Provider Charm
Following the previous example, this is an example of the provider charm.
from charms.wazuh_server.v0.wazuh_api import import WazuhApiProvides
class WazuhApiProviderCharm(ops.CharmBase):
def __init__(self, *args):
super().__init__(*args)
self.wazuh_api = WazuhApiProvides(self)
...
The WazuhApiProvides object wraps the list of relations into a relations property
and provides an update_relation_data method to update the relation data by passing
a WazuhApiRelationData data object.
class WazuhApiProviderCharm(ops.CharmBase):
...
def _on_config_changed(self, _) -> None:
for relation in self.model.relations[self.wazuh_api.relation_name]:
self.wazuh_api.update_relation_data(relation, self._get_wazuh_api_data())
Index
class SecretError
Description
Common ancestor for Secrets related exceptions. None
class WazuhApiRelationData
Represent the relation data.
Attributes
Methods
WazuhApiRelationData. to_relation_data( self )
Convert an instance of WazuhApiRelationData to the relation representation.
Returns
Dict containing the representation.
class WazuhApiDataAvailableEvent
Event emitted when relation data has changed.
Attributes
Methods
WazuhApiDataAvailableEvent. endpoint( self )
Description
Fetch the endpoint from the relation. None
WazuhApiDataAvailableEvent. user( self )
Description
Fetch the user from the relation. None
WazuhApiDataAvailableEvent. password( self )
Description
Fetch the password from the relation. None
class WazuhApiRequiresEvents
Wazuh API events.
Attributes
Description
This class defines the events that a requirer can emit.
class WazuhApiRequires
Requirer side of the Wazuh API client relation.
Attributes
Methods
WazuhApiRequires. __init__( self , charm , relation_name: str )
Construct.
Arguments
the provider charm.
the relation name.
WazuhApiRequires. get_relation_data( self )
Retrieve the relation data.
Returns
validated data, or None if not ready or unusable.
class WazuhApiProvides
Description
Provider side of the Wazuh API relation. None
Methods
WazuhApiProvides. __init__( self , charm , relation_name: str )
Construct.
Arguments
the provider charm.
the relation name.
WazuhApiProvides. update_relation_data( self , relation , wazuh_api_data: WazuhApiRelationData )
Update the relation data.
Arguments
the relation for which to update the data.
a WazuhApiRelationData instance wrapping the data to be updated.