Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hydra-flask-server

Minimal Flask portal that exposes hydra-base functions over JSON HTTP.

Scope

  • No dependency on legacy SOAP/JSON-RPC server code
  • No protocol bridge layer
  • Direct invocation of public callables from hydra_base.lib.*

Endpoints

  • POST /auth/login
  • POST /auth/logout
  • GET /health
  • GET /api (function index)
  • POST /api/<module>/<function>
  • GET /api/<module>/<function>

Where <module> maps to selected modules under hydra_base.lib, for example:

  • /api/project/get_project
  • /api/network/get_network
  • /api/scenario/add_scenario

Request format

Preferred:

{
  "args": [12, "Y"],
  "kwargs": {
    "include_data": "N"
  }
}

Named-parameter shortcut:

{
  "project_id": 12,
  "include_data": "Y"
}

Authentication

  • Login uses hydra_base.lib.service.login.
  • After login, session keys are stored in Flask session (user_id, username, session_id).
  • API endpoints inject user_id and username into function kwargs.

Quick start

pip install -e .
hydra-flask-server --host 127.0.0.1 --port 8080

About

A flask implementation of the hydra-server API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages