http-apis.github.io

HydraEcoSystem: Main documentation entrypoint for HYDRA-based applications

View on GitHub

Command Line Utility - Hydrus

This page explains in detail the usage of the command line utility of hydrus.

Table of contents

Using the CLI

The serve command starts the server. Using hydrus serve from the terminal simply fires up the server with the following default values:

--adduser: tuple([1, "test"])
--api: "serverapi"
--auth/--no-auth: True
--dburl: "sqlite:///:memory:"
--hydradoc: "doc.jsonld"
--port: 8080
--serverurl: "http://localhost/"
--token/--no-token: True

Options

–adduser / -u

Adds a new user to the API with the given username and passphrase.
Syntax:
--adduser <username (integer)> <passphrase (text)>

or

-u <username (integer)> <passphrase (text)>

–api / -a

Sets a custom API name.
Syntax:
--api <API Name (text)>

or

-a <API Name (text)>

–auth / –no-auth

Enables/Disables the user authentication for the API.
Syntax:
--auth

or

--no-auth

–dburl / -b

Sets the database URL for the API.
Syntax:
--dburl <DB URL (text/url)>

or

-b <DB URL (text/url)>

–hydradoc / -d

Sets the location to HydraDocumentation (in jsonld) for the server.
Syntax:
--hydradoc <Link to file (text)>

or

-d <Link to file (text)>

–port / -p

Sets the port for the API server.
Syntax:
--port <Port number (integer)>

or

-p <Port number (integer)>

–serverurl / -s

Sets the URL for the server to be hosted at.
Syntax:
--serverurl <URL (text/url)>

or

-s <URL (text/url)>

–token / –no-token

Enables/Disables the user token for the API.
Syntax:
--token

or

--no-token

Arguments

serve: Fires up the server with the given options, or using default values.

Example Server Setup

Setting up a server with custom options can be done as follows:

hydrus serve --api hydrus --port 9000 --adduser 1 test2