Osm Nbi
- By Charmed Distribution of OSM
Channel | Revision | Published | Runs on |
---|---|---|---|
latest/stable | 1 | 09 Aug 2022 | |
latest/candidate | 1 | 11 Mar 2022 | |
latest/beta | 600 | 30 Sep 2023 | |
latest/beta | 191 | 04 Apr 2023 | |
latest/edge | 408 | 30 Jun 2023 | |
latest/edge | 1 | 31 Jan 2022 | |
14.0/stable | 442 | 20 Jul 2023 | |
14.0/candidate | 442 | 12 Jul 2023 | |
14.0/beta | 442 | 12 Jul 2023 | |
13.0/stable | 731 | 15 Jan 2024 | |
13.0/candidate | 102 | 09 Dec 2022 | |
13.0/beta | 731 | 05 Dec 2023 | |
12.0/stable | 222 | 11 Apr 2023 | |
12.0/beta | 730 | 05 Dec 2023 | |
10.0/stable | 1 | 09 Dec 2022 |
juju deploy osm-nbi
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.osm_nbi.v0.nbi
-
- Last updated 16 Jun 2022
- Revision Library version 0.1
Nbi library.
This library implements both sides of the
nbi
interface.
The provider side of this interface is implemented by the osm-nbi Charmed Operator.
Any Charmed Operator that requires NBI for providing its service should implement the requirer side of this interface.
In a nutshell using this library to implement a Charmed Operator requiring NBI would look like
$ charmcraft fetch-lib charms.osm_nbi.v0.nbi
metadata.yaml
:
requires:
nbi:
interface: nbi
limit: 1
src/charm.py
:
from charms.osm_nbi.v0.nbi import NbiRequires
from ops.charm import CharmBase
class MyCharm(CharmBase):
def __init__(self, *args):
super().__init__(*args)
self.nbi = NbiRequires(self)
self.framework.observe(
self.on["nbi"].relation_changed,
self._on_nbi_relation_changed,
)
self.framework.observe(
self.on["nbi"].relation_broken,
self._on_nbi_relation_broken,
)
self.framework.observe(
self.on["nbi"].relation_broken,
self._on_nbi_broken,
)
def _on_nbi_relation_broken(self, event):
# Get NBI host and port
host: str = self.nbi.host
port: int = self.nbi.port
# host => "osm-nbi"
# port => 9999
def _on_nbi_broken(self, event):
# Stop service
# ...
self.unit.status = BlockedStatus("need nbi relation")
You can file bugs
here, selecting the devops
module!
Index
class NbiRequires
Description
Requires-side of the Nbi relation. None
Methods
NbiRequires. __init__( self , charm: CharmBase , endpoint_name: str )
NbiRequires. host( self )
Description
Get nbi hostname. None
NbiRequires. port( self )
Description
Get nbi port number. None
class NbiProvides
Description
Provides-side of the Nbi relation. None
Methods
NbiProvides. __init__( self , charm: CharmBase , endpoint_name: str )
NbiProvides. set_host_info( self , host: str , port: int , relation )
Set Nbi host and port.
Arguments
Nbi hostname or IP address.
Nbi port.
Relation to update. If not specified, all relations will be updated.
Description
This function writes in the application data of the relation, therefore, only the unit leader can call it.