aiomsa-0.1.0a8
توضیحات
Asynchronous xApp framework
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | aiomsa-0.1.0a8 |
| نام | aiomsa |
| نسخه کتابخانه | 0.1.0a8 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Facebook Connectivity |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | https://github.com/facebookexternal/aiomsa |
| آدرس اینترنتی | https://pypi.org/project/aiomsa/ |
| مجوز | BSD-3-Clause |
# aiomsa
[](https://github.com/facebookexternal/aiomsa/actions/workflows/build.yml)
[](https://github.com/psf/black)

*aiomsa* is a Python 3.7+ framework built using `asyncio`. At its core, *aiomsa*
provides a simple and standardized way to write xApps that can be deployed as
microservices in Python.
## Installation
*aiomsa* can be installed from PyPI.
```bash
pip install aiomsa
```
You can also get the latest code from GitHub.
```bash
poetry add git+https://github.com/facebookexternal/aiomsa
```
## Getting Started
The follwing example shows how to use *aiomsa* to create a simple xApp for subscribing
to the E2T service for a particular custom service model.
```python
import asyncio
import aiomsa
import aiomsa.abc
from onos_ric_sdk_py import E2Client, SDLClient
from .models import MyModel
async def run(e2: aiomsa.abc.E2Client, e2_node_id: str) -> None:
subscription = await e2.subscribe(
e2_node_id,
service_model_name="my_model",
service_model_version="v1",
subscription_id="my_app-my_model-sub",
trigger=bytes(MyModel(param="foo")),
actions=[
aiomsa.abc.RICAction(
id=1,
type=aiomsa.abc.RICActionType.REPORT,
subsequent_action_type=aiomsa.abc.RICSubsequentActionType.CONTINUE,
time_to_wait=aiomsa.abc.RICTimeToWait.ZERO,
)
],
)
async for (_header, message) in subscription:
print(message)
async def main() -> None:
async with E2Client(app_id="my_app", e2t_endpoint="e2t:5150") as e2, SDLClient(
topo_endpoint="topo:5150"
) as sdl:
async for e2_node in sdl.watch_e2_connections():
asyncio.create_task(run(e2, e2_node.id))
if __name__ == "__main__":
aiomsa.run(main())
```
نیازمندی
| مقدار | نام |
|---|---|
| >=3.5.4,<4.0.0 | aiohttp |
| >=1.0.9,<2.0.0 | aiohttp-swagger |
| >=19.2.0,<20.0.0 | prometheus-async |
| >=2021.2.21b25,<2022.0.0) | furo |
| >=3.4.3,<4.0.0) | sphinx |
| >=1.11.1,<2.0.0) | sphinx-autodoc-typehints |
| >=0.7.0,<0.8.0) | sphinxcontrib-openapi |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7,<4.0 | Python |
نحوه نصب
نصب پکیج whl aiomsa-0.1.0a8:
pip install aiomsa-0.1.0a8.whl
نصب پکیج tar.gz aiomsa-0.1.0a8:
pip install aiomsa-0.1.0a8.tar.gz