API: Servers

Functions & Classes

Note

This module has been designed to work on Linux and may not operate correctly - or at all - on other platforms.

The server module provides classes for downloading and working with Neo4j server installations.

py2neo.server.dist_name(edition, version)[source]

Get the full Neo4j distribution name for the given edition and version, e.g. 'neo4j-community-2.1.5'.

py2neo.server.dist_archive_name(edition, version)[source]

Get the full Neo4j archive name for the given edition and version, e.g. 'neo4j-community-2.1.5-unix.tar.gz'.

py2neo.server.download(edition, version, path='.')[source]

Download the Neo4j server archive for the given edition and version. The download URI is built using the value in the environment variable NEO4J_DIST as a base or http://dist.neo4j.org/ if this is not set.

class py2neo.server.GraphServer(home='.')[source]

Represents a Neo4j server installation on disk. If no path is supplied to the constructor, the value is taken from the NEO4J_HOME environment variable. If this is not set, the current directory is assumed.

conf

Server configuration read from Java properties files. This is returned in a (slightly modified) SafeConfigParser instance and can be queried as per the standard library version of this class:

>>> from py2neo.server import GraphServer
>>> server = GraphServer("/home/nigel/opt/neo4j")
>>> server.conf.get("neo4j-server", "org.neo4j.server.webadmin.data.uri")
'/db/data/'
graph

The graph exposed by this server.

Returns:py2neo.Graph
home = None

The base directory of this server installation.

info

Dictionary of server information.

pid

The PID of the current executing process for this server,

reload_conf()[source]

Reload configuration from properties files.

restart()[source]

Restart the server.

script

The file name of the control script for this server installation.

service_root

The service root exposed by this server.

Returns:py2neo.ServiceRoot
start()[source]

Start the server.

Return type:py2neo.server.GraphServerProcess
stop()[source]

Stop the server.

store

The store for this server.

Return type:py2neo.store.GraphStore
class py2neo.server.GraphServerProcess(server, service_root, **kwargs)[source]

A Neo4j server process.

graph

The graph exposed by this server process.

Return type:py2neo.Graph
jvm_arguments = None

The JVM arguments with which this process was started.

pid = None

The PID of this process.

server = None

The server installation behind this process.

service_root = None

The service root exposed by this server process.

stop()[source]

Stop this server process.

Command Line

To download a Neo4j server distribution, use the neoget command line tool:

$ neoget community 2.1.5