isoprene-pumpjack

Installation

Install with pip:

pip install isoprene-pumpjack

Use

To run with Gunicorn prod server:

gunicorn isoprene_pumpjack.wsgi:app

To run with Flask dev server:

isoprene-pumpjack

Neo-D3-JSON

Data is often returned from isoprene-pumpjack to instruct synpatic-scout how to draw a graph.

This is done in a standard JSON format, described below:

Neo-D3-JSON Specification

Nodes

Node objects have no additional properties.

Neo-D3-JSON Example Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "nodes":[
        {
            "labels":[
                "Document"
            ],
            "id":0,
            "props":{
                "isopump_fully_loaded":true,
                "label":"AVrDasjxocluSgWq6vsT",
                "isopump_load_last":1490949576577,
                "id":"AVrDasjxocluSgWq6vsT",
                "isopump_load_initial":1490714160644
            }
        },
        {
            "labels":[
                "Dolphin"
            ],
            "id":1,
            "props":{
                "isopump_fully_loaded":true,
                "id":"Zap",
                "label":"Zap",
                "isopump_load_last":1490949577244,
                "isopump_load_initial":1490714160644
            }
        }
    ],
    "links":[
        {
            "props":{

            },
            "labels":[
                "Source"
            ],
            "id":0,
            "target":0,
            "source":1
        }
    ]
}

RESTful API

General API Notes

If one of the backend services (Neo4j, Elasticsearch) is unavailable, a 503 error will be returned instead of a JSON response:

statuscode 503:Service unavailable

Neat API

This API documentation is manually updated.

GET /dev/elastic/set/dolphins

Create and load dolphins index

Status Codes:
GET /dev/neo/set/dolphins

Drop database and upload dolphins JSON data into Neo4j

Status Codes:

Return the elastic results of a document search using query parameters.

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "_index": "dolphins",
        "_source": {
            "dolphins": [
                "Zap",
                "CCL"
            ]
        },
        "_id": "AVrDasjxocluSgWq6vsT",
        "_type": "dolphin_sighting",
        "_score": 2.6732156
    },
    {
        "_index": "dolphins",
        "_source": {
            "dolphins": [
                "Zap",
                "Double"
            ]
        },
        "_id": "AVrDasj8ocluSgWq6vsU",
        "_type": "dolphin_sighting",
        "_score": 2.6732156
    }
]
Query Parameters:
 
  • label (string) – id of dolphin to search documents for
Status Codes:
GET /dev/elastic/reset

Drop elastic indexes

Status Codes:
GET /dev/elastic/seed

Seed a node (and mentioning documents) from elastic to neo, and return the node id

Example response:

HTTP/1.1 201 CREATED
Content-Type: application/json

{
    "id": "Zap"
}
Query Parameters:
 
  • label (string) – id of dolphin to search documents for
Status Codes:
GET /dev/neo/fullgraph

Get JSON representing full graph

See Neo-D3-JSON Example Response.

Status Codes:
GET /dev/neo/reset

Drop neo4j database

Status Codes:
GET /configuration/synaptic-scout

Get JSON config for synaptic-scout

GET /

Get JSON representing endpoints

GET /dev/neo/subgraph/(string: central_node_id)

Get JSON representing subgraph centered on a single node

See Neo-D3-JSON Example Response.

Status Codes:
GET /explore/subgraph/(string: central_node_id)

Get JSON representing subgraph centered on a single node

See Neo-D3-JSON Example Response.

Status Codes:
GET /static/(path: filename)

Function used internally to send static files from the static folder to the browser.

New in version 0.5.

Full API

This API documentation is automatically generated.

GET /

Get JSON representing endpoints

GET /configuration/synaptic-scout

Get JSON config for synaptic-scout

GET /dev/elastic/reset

Drop elastic indexes

Status Codes:

Return the elastic results of a document search using query parameters.

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "_index": "dolphins",
        "_source": {
            "dolphins": [
                "Zap",
                "CCL"
            ]
        },
        "_id": "AVrDasjxocluSgWq6vsT",
        "_type": "dolphin_sighting",
        "_score": 2.6732156
    },
    {
        "_index": "dolphins",
        "_source": {
            "dolphins": [
                "Zap",
                "Double"
            ]
        },
        "_id": "AVrDasj8ocluSgWq6vsU",
        "_type": "dolphin_sighting",
        "_score": 2.6732156
    }
]
Query Parameters:
 
  • label (string) – id of dolphin to search documents for
Status Codes:
GET /dev/elastic/seed

Seed a node (and mentioning documents) from elastic to neo, and return the node id

Example response:

HTTP/1.1 201 CREATED
Content-Type: application/json

{
    "id": "Zap"
}
Query Parameters:
 
  • label (string) – id of dolphin to search documents for
Status Codes:
GET /dev/elastic/set/dolphins

Create and load dolphins index

Status Codes:
GET /dev/neo/fullgraph

Get JSON representing full graph

See Neo-D3-JSON Example Response.

Status Codes:
GET /dev/neo/reset

Drop neo4j database

Status Codes:
GET /dev/neo/set/dolphins

Drop database and upload dolphins JSON data into Neo4j

Status Codes:
GET /dev/neo/subgraph/(string: central_node_id)

Get JSON representing subgraph centered on a single node

See Neo-D3-JSON Example Response.

Status Codes:
GET /explore/subgraph/(string: central_node_id)

Get JSON representing subgraph centered on a single node

See Neo-D3-JSON Example Response.

Status Codes:
GET /static/(path: filename)

Function used internally to send static files from the static folder to the browser.

New in version 0.5.

Indices and tables