---
title: Charmhub | Deploy OSM VCA Integrator using Charmhub - The Open Operator Collection
description: Deploy the latest version of OSM VCA Integrator on any cloud.
url: https://charmhub.io/osm-vca-integrator/libraries/vca
---

# OSM VCA Integrator

[Charmed Distribution of OSM](https://charmhub.io/publisher/charmed-osm "View all packages from Charmed Distribution of OSM")

* [Charmed Distribution of OSM](https://charmhub.io/publisher/charmed-osm "View all packages from Charmed Distribution of OSM")

Platform:

22.04

20.04

beta 294

```
juju deploy osm-vca-integrator --channel beta
```

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

[Toggle side navigation](https://charmhub.io/osm-vca-integrator/libraries/vca#drawer)

## charms.osm\_vca\_integrator.v0.vca

* [*Docstrings*Docstrings](https://charmhub.io/osm-vca-integrator/libraries/vca)
  [*Code*Source code](https://charmhub.io/osm-vca-integrator/libraries/vca/source-code)
* + Download

    Fetch library

    ```
    charmcraft fetch-lib charms.osm_vca_integrator.v0.vca
    ```

    [Download vca.py](https://charmhub.io/osm-vca-integrator/libraries/vca/download)
  + *Last updated* 30 Jun 2022
  + *Revision* Library version 0.3

VCA Library.

VCA stands for VNF Configuration and Abstraction, and is one of the core components
of OSM. The Juju Controller is in charged of this role.

This [library](https://juju.is/docs/sdk/libraries) implements both sides of the
`vca` [interface](https://juju.is/docs/sdk/relations).

The *provider* side of this interface is implemented by the
[osm-vca-integrator Charmed Operator](https://charmhub.io/osm-vca-integrator).

helps to integrate with the
vca-integrator charm, which provides data needed to the OSM components that need
to talk to the VCA, and

Any Charmed OSM component that *requires* to talk to the VCA should implement
the *requirer* side of this interface.

In a nutshell using this library to implement a Charmed Operator *requiring* VCA data
would look like

```
$ charmcraft fetch-lib charms.osm_vca_integrator.v0.vca
```

`metadata.yaml`:

```
requires:
  vca:
    interface: osm-vca
```

`src/charm.py`:

```
from charms.osm_vca_integrator.v0.vca import VcaData, VcaIntegratorEvents, VcaRequires
from ops.charm import CharmBase

class MyCharm(CharmBase):

    on = VcaIntegratorEvents()

    def __init__(self, *args):
        super().__init__(*args)
        self.vca = VcaRequires(self)
        self.framework.observe(
            self.on.vca_data_changed,
            self._on_vca_data_changed,
        )

    def _on_vca_data_changed(self, event):
        # Get Vca data
        data: VcaData = self.vca.data
        # data.endpoints => "localhost:17070"
```

You can file bugs
[here](https://github.com/charmed-osm/osm-vca-integrator-operator/issues)!

---

Index

* [class VcaDataChangedEvent](https://charmhub.io/osm-vca-integrator/libraries/vca#vcadatachangedevent)
* + [def \_\_init\_\_(
    self,
    handle)](https://charmhub.io/osm-vca-integrator/libraries/vca#vcadatachangedevent-__init__)
* [class VcaIntegratorEvents](https://charmhub.io/osm-vca-integrator/libraries/vca#vcaintegratorevents)
* [class VcaData](https://charmhub.io/osm-vca-integrator/libraries/vca#vcadata)
* + [def \_\_init\_\_(
    self,
    data)](https://charmhub.io/osm-vca-integrator/libraries/vca#vcadata-__init__)
* [class VcaDataMissingError](https://charmhub.io/osm-vca-integrator/libraries/vca#vcadatamissingerror)
* [class VcaRequires](https://charmhub.io/osm-vca-integrator/libraries/vca#vcarequires)
* + [def \_\_init\_\_(
    self,
    charm,
    endpoint\_name)](https://charmhub.io/osm-vca-integrator/libraries/vca#vcarequires-__init__)
* + [def data(
    self)](https://charmhub.io/osm-vca-integrator/libraries/vca#vcarequires-data)
* [class VcaProvides](https://charmhub.io/osm-vca-integrator/libraries/vca#vcaprovides)
* + [def \_\_init\_\_(
    self,
    charm,
    endpoint\_name)](https://charmhub.io/osm-vca-integrator/libraries/vca#vcaprovides-__init__)
* + [def update\_vca\_data(
    self,
    vca\_data)](https://charmhub.io/osm-vca-integrator/libraries/vca#vcaprovides-update_vca_data)

#### class VcaDataChangedEvent

Description

Event emitted whenever there is a change in the vca data. None

Methods

VcaDataChangedEvent.
\_\_init\_\_(

*self*

,
handle
)

#### class VcaIntegratorEvents

VCA Integrator events.

Description

This class defines the events that ZooKeeper can emit.

Events:
vca\_data\_changed (\_VcaDataChanged)

#### class VcaData

Description

Vca data class. None

Methods

VcaData.
\_\_init\_\_(

*self*

,
data
)

#### class VcaDataMissingError

Description

Data missing exception. None

#### class VcaRequires

Requires part of the vca relation.

Attributes

endpoint\_name

Endpoint name of the charm for the vca relation.

data

Vca data from the relation.

Methods

VcaRequires.
\_\_init\_\_(

*self*

,
charm: CharmBase

,
endpoint\_name: str
)

VcaRequires.
data(

*self*
)

Description

Vca data from the relation. None

#### class VcaProvides

Provides part of the vca relation.

Attributes

endpoint\_name

Endpoint name of the charm for the vca relation.

Methods

VcaProvides.
\_\_init\_\_(

*self*

,
charm: CharmBase

,
endpoint\_name: str
)

VcaProvides.
update\_vca\_data(

*self*

,
vca\_data: VcaData
)

Update vca data in relation.

Arguments

vca\_data

VcaData object.
