Object Storage & Indexing System (OSIS)

this is the object storage system as part of this wiki & application server. OSIS allows you to define complex types and lots of code is autogenerated for you.

for spec format of model check:

OISS requires several client connection to be configured.

  • mongodb_client
  • influxdb_client
  • redis

It uses mongodb to store the objects.
Redis is used for temperary models and caching.
Influxdb is used for metric data gather from the nodes.

Structure

OSIS structures models under namespaces this is a logical seperation of models. Each model inside a namespace we call a category

The basepath of OSIS is typically /opt/jumpscale7/apps/osis

Under this path we have a folder logic where our namespaces are stored.

In a namespace we can define how objects should be processed.

We have three files to manage this OSIS_auth.py OSIS_category_template.py OSIS_parent.py

OSIS_parent

from JumpScale import j
from JumpScale.grid.osis.OSISStoreMongo import OSISStoreMongo

class mainclass(OSISStoreMongo):
    pass

Typicly we inherit from OSISStoreMongo and use the default settings. It is possible to overwrite the set method and preprocess the data comming in.

OSIS_category_template

This files is used during generation how each category should store its models. Typicly this files inherits from the namespace itself.

from JumpScale import j

parentclass=j.core.osis.getOsisImplementationParentClass("system")  #is the name of the namespace

class mainclass(parentclass):
    """
    """

OSIS_auth

In OSIS_auth we can specify the authentication for each and every call. Typicly we validate if admin level is require or node level

Example

from JumpScale import j
import ujson

class AUTH():

    def load(self,osis):
        pass

    def authenticate(self,osis,method,user,passwd, session):
        if j.core.osis.cmds._authenticateAdmin(user=user,passwd=passwd, die=False):
            return True
        return False

results matching ""

    No results matching ""