GrapheneDB Management API

Information

Our management API is currently in closed beta, so please contact us at support@graphenedb.com and we’ll provide you access.

With this HTTP REST API you'll be able to perform and automate common operations on your databases:

  • DB instances: create, delete, empty, restart.
  • Backups: schedule, restore, export, import, manual snapshot.

Following the guidelines below, clients can be developed in virtually any programming language. Tools such as cURL or httpie can be used to debug and develop on top of this API. Additionally, for those users interested in web applications, we have included CORS support.

Versioning

A new version of this API will be released when there are backwards-incompatible changes. All clients are recommended to always stay current, so a upgrade guide will be provided, together with a changelog.

This the version 1.0 of the API, which means that the root path must be set to /v1. All new versions will be announced and the old ones will be kept unaffected for several months so that clients can be migrated. New features can be added to an existing version if there are no breaking changes.

API root

Our only supported endpoint is https://api.graphenedb.com/v1

Live documentation

Our API uses Swagger. It’s a de-facto standard for describing REST-based HTTP APIs that will make your life easier. Please find a live documentation and an embedded client to test our API here:
https://api.graphenedb.com/swagger-ui/

API Reference

This API is organized around REST, which means that:

  • Resources can be accessed in a stateless, predictable manner.
  • Each resource is identified by a URL.
    • Entities are identified by a UUID
      • /databases/822b16bb0c0d4631ae30719cab74c352
    • Collections of entities can be obtained by not specifying a UUID:
      • /databases
    • Nested subresources are used:
      • /databases/822b16bb0c0d4631ae30719cab74c352/restart
      • /databases/822b16bb0c0d4631ae30719cab74c352/backups/latest
  • The entities and collections handled by this API can be obtained using standard HTTP/1.1 methods.
    • POST creates a new entity.
    • GET reads an entity or collection.
    • PUT updates an entity or executes a command on it.
    • DELETE deletes an entity.
  • Each method can return HTTP success or error responses, always following the guidelines of RFC 2616, but with an additional meaning to our API:
    • 200: Immediate, synchronous responses from GET, PUT.
    • 201: New entities created via POST.
    • 202: Costly operations from PUT, POST are asynchronous.
    • 204: Empty content from PUT, DELETE.
    • 400: The client provided a bad request payload (eg. format or schema issues) to a POST, PUT operation.
    • 401: The client is unauthorized.
    • 404: The resource path does not exist in the API.
    • 405: The client used an undefined HTTP method on a resource.
    • 409: There’s another operation in progress on the same resource.
    • 500: there was an error on our side.
    • 501: the operation hasn’t been implemented yet.
    • 502: the public API received an unexpected response from our internal infrastructure.
    • 504: the public API didn’t receive a response from the internal infrastructure.
  • The standard encoding for all requests and responses is JSON
  • The accepted charset for all communications is UTF-8
  • All dates are expressed in compliance with RFC 7231
    • Sun, 06 Nov 1994 08:49:37 GMT

Async operations

Depending on the database characteristics (size, instance type), some actions might take longer than others to complete. If the action is a costly one (eg. create a large instance, restart a db), the API will return a 202 Accepted together with an operation id. For immediate actions, the API returns a 2xx code.

User files

In some actions the user will be required to provide a valid file (eg. import a backup). In these cases, the user must provide an URL to a AWS S3 bucket. The file must be given all the required permissions so that our infrastructure can access it. In most cases, a random UUID and a public bucket will be enough.

Backup support

Some operations are only available starting from Standard plans:

  • Scheduled daily backups
  • Manual backups (snapshots)
    All plans include an export option which will generate a downloadable secure link to S3. The import can be applied by uploading the exported file to a valid S3 bucket (see above).

Payment method

Please make sure you have entered a valid payment method in GrapheneDB’s admin interface. Otherwise, the database creation operations will fail.

Authentication & Security

The only way to access the API is through HTTPS. The API is protected by our wildcard SSL certificate issued by Amazon.
Download the information about the root CAs here.

Authentication is performed via a special header named api_key which must be set to a value provided by the admin web interface:

Response Objects

Error

4xx errors indicate that there is something wrong in the client request. For instance, the state of the resource is incompatible with the requested operation, or maybe the supplied JSON payload doesn’t match the expected schema. 5xx errors point to an unhandled failure in the server. In some cases, the message returned by the server is:

{ "error": "string" }

The value of the string points to the actual cause. For security reasons, 500 errors include only a nonce (UUID) that should be provided to our support team.

Catalogs

Version

Represents a supported Neo4j version.

Request path

/databases/versions

version

String (id)

Version identifier

description

String (text)

Version description

Plan

GrapheneDB plans:

  • sandbox
  • developer0
  • s1
  • s2
  • p1
  • p2
  • p3
  • p4
  • cluster

Regions

The supported EC2 regions (as of API version 1.0) are:

  • us-east-1
  • us-west-1
  • us-west-2
  • eu-west-1
  • eu-west-2
  • ap-northeast-1
  • ap-southeast-1
  • ap-southeast-2

Operation

The same API endpoint can return a sync or async operation, depending on the database size and plan. The “operation” object represents an asynchronous operation.

Resource path

/operations/{operationId}

id

String (uuid)

Operation id

databaseId

String (uuid)

Database id

description

String (text)

Operation description

stopped

Boolean

Is the database stopped?

createdAt

String (tstamp)

UNIX epoch

currentState

String (enum)

global operation status:

  • started
  • finished
  • failed

events

Array

Collection of events

Operation Event

state

String (enum)

Event identifier (human-readable). Examples:

  • freezing-volume
  • creating-snapshot
  • copy-snapshot
  • ...

createdAt

Integer (tstamp)

UNIX epoch

Database

Resource path

/databases/{databaseId}

id

String (uuid)

Database identifier

name

String (text)

Database name

url

String (url)

Access the Neo4j REST API through this endpoint

boltURL

String (url)

Endpoint for Bolt, new Neo4j binary protocol. Available as of Neo4j 3.0

webAdminURL

String

Neo4j browser URL. Use Basic Auth with the same credentials as above. This is a REST endpoint.

metricsURL

String (url, optional)

createdAt

String (timestamp)

db creation date, in ISO-8601

version

String (text)

Full description of the installed Neo4j version

currentSize

Integer (long)

Database size in bytes

plugins

Array (object)

Installed extensions

maxSize

Integer (long)

Maximum database size in bytes, depending on the plan

plan

Object

Plan object

awsRegion

String

EC2 region identifier

counters

Object (optional)

Current number of nodes and relationships

cluster

Object (optional)

Information about the cluster, in case the instance is a member

Plugin object

id

String(uuid)

Plugin UUID

name

String

Plugin name

enabled

Boolean

Is the extension enabled?

isManaged

Boolean

Is it a managed extension?

kind

String(enum, optional)

Extension type:

  • storedprocedure
  • extension

createdAt

String(date)

ISO-8601 date with creation timestamp

Plan object

type

String(enum)

Plan type (see corresponding section)

limits

Object

Plan limits

Limits object

Nodes

Integer(long)

Max no. of nodes in this plan

Relationships

Integer(long)

Max no. of relationships in this plan

Counters object

Nodes

Integer(long)

Current no. of nodes

Relationships

Integer(long)

Current no. of relationships

Cluster object

masterURL

String(url)

URL of the master node

nodes

Array (serverId)

Array of nodes

ServerId object

serverId

Integer

Node identifier

Backup

Resource path

/databases/{databaseId}/backups/{backupId}

id

String(uuid)

Backup identifier

state

String(enum)

Backup status:

  • done
  • working

origin

String(enum)

Backup origin:

  • scheduled
  • manual
  • automatic

timestamp

String(date)

ISO-8601 timestamp of the backup termination

size

Integer(long)

Backup size in bytes

duration

Integer(long)

Backup duration in seconds

packageURL

String(UrlPath)

Path to append to the API root to produce a downloadable link with the package (graph.tar.gz)

downloadable

Boolean

Can the user download the backup package?

Backup Schedule

Resource path

/databases/{databaseId}/backups/schedule

time

String(time)

H:mm:SS

timezone

String(enum)

Always set to UTC

frequency

String(enum)

Always set to “daily”

Backup Package

Resource path

/databases/{databaseId}/backups/{backupId}/package

backupUrl

String(url)

Secure one-time URL pointing to a volatile S3 bucket.

Database Export

Resource path

/databases/{databaseId}/export

url

String(url)

Secure one-time URL pointing to a volatile S3 bucket.

size

Integer

Export file size (graphdb.zip)

Request Objects

Database

Resource path

/databases

name

String

Name of the database

version

String(id)

Version identifier, eg. “v236”

awsRegion

String(id)

EC2 valid region, eg. “eu-west-1”

plan

String(id)

GrapheneDB plan. “cluster” is not accepted

Backup schedule

Resource path

/databases/{databaseId}/backups/schedule

time

String(time)

H:mm:SS

timezone

String(enum)

Always set to UTC

frequency

String(enum)

Always set to “daily”

Database Import

Resource path

/databases/{databaseId}/import

url

String(url)

Link to the S3-stored graphdb.zip. Please give it permissions so our internal infrastructure can access it.

GrapheneDB Management API