Coder Social home page Coder Social logo

storehouse's Introduction

Overview

WARNING: As previously announced on our communication channels, the Kytos project will enter the "shutdown" phase on May 31, 2021. After this date, only critical patches (security and core bug fixes) will be accepted, and the project will be in "critical-only" mode for another six months (until November 30, 2021). For more information visit the FAQ at <https://kytos.io/faq>. We'll have eternal gratitude to the entire community of developers and users that made the project so far.

License Build status Code coverage Code-quality score

This NApp is responsible for data persistence, saving and retrieving information. It can be acessed by external agents through the REST API or by other NApps, using the event-based methods.

Each box of data can be saved in a different namespace, with support for nested namespaces.

The NApp is designed to support many options of back-end persistence solutions. Currently it features filesystem operations, but alternatives such as SQL or NoSQL databases will be implemented.

Installing

All of the Kytos Network Applications are located in the NApps online repository. To install this NApp, run:

$ kytos napps install kytos/storehouse

Events

Listened

The NApp listens to events requesting operations. Every event must have a callback function to be executed right after the internal method returns. The signature of the callback function is described with each event.

kytos.storehouse.create

Event requesting to save data to a box in a namespace.

Content

{
    data: <any data to be saved>,
    namespace: <namespace name>,
    callback: <callback function> # To be executed after the method returns.
}

Callback function

def callback_function_name(box, error=False):
    # box: copy of the Box instance stored with data and metadata.
    # error: False when the operation is successful, True otherwise.

kytos.storehouse.retrieve

Event requesting to load data from a box in a namespace.

Content

{
    box_id: <ID of the Box to retrieve data from>,
    namespace: <namespace name>,
    callback: <callback function> # To be executed after the method returns.
}

Callback function

def callback_function_name(box, error=False):
    # box: the retrieved Box instance.
    # error: False when the operation is successful, True otherwise.

kytos.storehouse.list

Event requesting to list all boxes in a namespace.

Content

{
    namespace: <namespace name>,
    callback: <callback function> # To be executed after the method returns.
}

Callback function

def callback_function_name(box_list, error=False):
    # box_list: the retrieved list of Box.box_id.
    # error: False when the operation is successful, True otherwise.

kytos.storehouse.delete

Event requesting to remove a box from a namespace.

Content

{
    box_id: <ID of the Box to be deleted>,
    namespace: <namespace name>,
    callback: <callback function> # To be executed after the method returns.
}

Callback function

def callback_function_name(result, error=False):
    # result: True if the box was deleted, False otherwise .
    # error: False when the operation is successful, True otherwise.

Rest API

You can find a list of the available endpoints and example input/output in the 'REST API' tab in this NApp's webpage in the Kytos NApps Server.

storehouse's People

Contributors

ajoaoff avatar beraldoleal avatar cmagnobarbosa avatar gleybersonandrade avatar hdiogenes avatar josemauro avatar llgoncalves avatar lucasgsfelix avatar macartur avatar niehaus avatar pythrick avatar renanrodrigo avatar viniarck 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.