Wazuh Server
- Canonical IS DevOps
Channel | Revision | Published | Runs on |
---|---|---|---|
latest/edge | 100 | Today |
juju deploy wazuh-server --channel edge
Deploy Kubernetes operators easily with Juju, the Universal Operator Lifecycle Manager. Need a Kubernetes cluster? Install MicroK8s to create a full CNCF-certified Kubernetes system in under 60 seconds.
Platform:
charms.wazuh_server.v0.wazuh_api
-
- Last updated 04 Apr 2025
- Revision Library version 0.1
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.
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
the relation data.
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.