Shell

Managing the database of the vantage6 server can be done by an administrator through the shell.

The preferred method of managing entities is using the API, instead of the shell interface. This because the API will perform validation of the input, whereas in the shell all inputs are accepted.

Through the shell it is possible to manage all server entities. To start the shell, use vserver shell [options].

The initialization of the shell

In the next sections the different database models that are available are explained. You can retrieve any record and edit any property of it. Don't forget to call .save() once you are done editing.

Every db. object has a help() method which prints some info on what data is stored in it (e.g. db.Organization.help()).

Organizations

Organizations have a public key that is used for end-to-end encryption. This key is automatically created and/or uploaded by the Node the first time it's run.

To store an organization you can use the db.Organization model:

Retrieving organizations from the database:

A lot of entities (e.g. users) at the server are connected to an organization. E.g. you can see which (computation) tasks are issued by the organization or see which collaborations it is participating in.

Roles and Rules

A user can have multiple roles and rules assigned to them. These are used to determine if the user has permission to view, edit, create or delete certain resources using the API. A role is a collection of rules.

Users

Users belong to an organization. So if you have not created an organization as of yet, then you should do this first. To create a user you can use the db.User model:

You can retrieve users in the following ways:

To modify a user, simply adjust the properties and save the object.

Collaborations

A collaboration consists of one or more organizations. To create a collaboration you need at least one organization in your database. To create a collaboration you can use the db.Collaboration model:

Tasks, nodes and organizations are directly related to collaborations. We can obtain these by:

Nodes

Before nodes can login, they need to exist in the server's database. A new node can be created as follows:

Tasks and Results

A task is intended for one or more organizations. For each organization the task is intended for, a corresponding (initially empty) result should be created. Each task can have multiple results, for example a result from each organization.

Tasks can have a child/parent relationship. Note that the run_id is for parent and child tasks the same.

Obtaining results:

Last updated

Was this helpful?