Giter Club home page Giter Club logo

nmos-node's Introduction

NMOS Node API

An implementation of an AMWA NMOS IS-04 Node API.

Introduction

Package providing a basic NMOS Node API implementation. It takes the form of a "Node Facade" which accepts data from private back-end data providers.

State Diagram

Installation

Requirements

  • Linux (untested on Windows and Mac)
  • Python 2.7 (also Python 3.6.9 on Ubuntu 18.04)
  • Python Pip
  • NMOS Common

Steps

# Install Python setuptools
$ pip install setuptools

# Install the service
$ sudo python setup.py install

Configuration

The Node API makes use of a configuration file provided by the NMOS Common Library. Please see that repository for configuration details.

Usage

The following code snippet demonstrates registering a service and its resources with the Node API.

from nmosnode.facade import Facade

# Initialise service name to use for Node API interactions
nodeapi = Facade("myservice/v1.0")

# Register the service with the Node API including its own API endpoint
nodeapi.register_service("http://127.0.0.1", "myservice/v1.0")

# Heartbeat with the Node API - You'll need to call this every 5 seconds from another thread
nodeapi.heartbeat_service()

# Register your resources with the Node API
nodeapi.addResource("device", "my-device-uuid", "my-device-json-here")

Non-blocking

Run the following script to start the Node Facade in a non-blocking manner, and then stop it again at a later point:

    from nmosnode.nodefacadeservice import NodeFacadeService

    service = NodeFacadeService()
    service.start()

    # Do something else until ready to stop

    service.stop()

Blocking

It is also possible to run Node Facade in a blocking manner:

    from nmosnode.nodefacadeservice import NodeFacadeService

    service = NodeFacadeService()
    service.run() # Runs forever

Development

Testing

# Run the tests
$ make test

Packaging

Packaging files are provided for internal BBC R&D use. These packages depend on packages only available from BBC R&D internal mirrors, and may not work in other environments. For use outside the BBC please use python installation method.

# Debian packaging
$ make deb

# RPM packaging
$ make rpm

Versioning

We use Semantic Versioning for this repository

Changelog

See CHANGELOG.md

Contributing

See CONTRIBUTING.md

Please ensure you have run the test suite before submitting a Pull Request, and include a version bump in line with our Versioning policy.

License

See LICENSE.md

nmos-node's People

Contributors

alexrawcliffe avatar andrewbonney avatar cnorthwood avatar dannymeloy avatar j616 avatar jamesba avatar jamesgibo avatar kierank avatar peterbrightwell avatar samdbmg avatar simonrankine avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nmos-node's Issues

No documentation and examples don't work

There is essentially no documentation in this project.
The two examples don't work (I've fixed some of them), nor is there any explanation of what they are trying to achieve.

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.