Git Product home page Git Product logo

oranos-ix-client's Introduction

oranos-ix-client

Python library that enables data transmission from xApps to the ORANOS Ix server and potentially to remote RIC xApps.

Prerequisites

  1. Ix server URL
  2. Ix credentials are generated for each xApp when it registers to its local Ix server. In order to register, the developer can do so through POST /internal/register.

xApp registration to Ix interface

Installation

This is a private library, thus not published on PyPi. You can still use pip to install it, but you have to provide the repo's url.

pip install git+ssh://[email protected]/hpn-bristol/oranos-ix-client.git

IxClient

This class implements an ORANOS Ix client that enables xApp communication to their respective Ix server. It uses socket.io websockets and long-polling requests to achieve minimal transmit latency.

Init parameters

Parameter Type Description
url str Root URL of the xApp's local Ix server
username str The ix_username provided by the Ix server after registering the xApp.
password str The ix_password provided by the Ix server after registering the xApp.
data_logging bool (Optional) If True, a copy of the trasported data will be printed in the logs. Default is False.

Functions

is_connected()

Returns the current connection status of the Ix client.

connect(relation_id)

Initiate the Ix client's connection to the Ix server.

Parameter Type Description
relation_id str (Optional) The relation_id provided by the Ix server upon relation creation.

If a relation_id is provided, the Ix server will create a pipeline to the remote Ix and xApp found in the relation details.

disconnect()

Terminate the Ix client's connection to the Ix server.

send(data)

Transmit data to the Ix server.

Parameter Type Description
data dict Data in the form of a dictionary.

If the connection was made with a relation_id, the data will also be forwarded to the remote Ix server and xApp found in the relation details.

Examples

Transmitting data to xApp's local Ix server

from oranos_ix_client import IxClient

# Create an Ix client instance
client = IxClient(url='http://localhost:80', username="some_xapp_name", password="SuperSecurePassword")

# Initiate the Ix client connection
client.connect()

# Use IxClient.is_connected property to transmit data while the connection remains active
while client.is_connected:
    data_example: {"attenuation": 13.2, "health": 0.74}
    client.send(data=data_example)

Using xApp relations

Firstly, in order to use an xApp relation you first need to create one. To do so, the xApp developer should request it from the Ix through POST /internal/relations.

xApp relation creation with remote xApp

Then, the xApp can make use of the relation and forward data to a remote Ix server. The only code change required is to define the optional relation_id parameter during the connection step.

client.connect(relation_id="rel521ff72fda23360e")

oranos-ix-client's People

Contributors

savvasmohito avatar

Watchers

Anderson Bravalheri avatar Rafael S. Guimarães avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.