This is a shared library for sharing functionality between various components in a running Indigo system. It is intended to be included by the indigo-web and indigo-agent components.
Configuration is specified with the INDIGO_CONFIG environment variable
export INDIGO_CONFIG=settings
The file at settings.py only needs to be changed should the Cassandra Keyspace name change. By default the keyspace is called Indigo.
This module contains Indigo model-specific exceptions to be handled if problems occur when writing to the database, such as UniqueError to be raised when an attempt is made to write a new Collection with the name of an existing one.
Whenever indigo is installed in a sub-component's virtualenv, the indigo command is available from inside the activated virtualenv to interact with the system.
Creates/Syncs the database defined in configuration with the latest models.
indigo create
Provides a guided interface to create a new user. You will be asked if this is an administrative user, their password and their email address.
indigo user-create
Displays a list of all known users within the current indigo system.
indigo user-list
Creates a new group within the system. Requires the name of the group and the name of the owning user.
indigo group-create GROUP_NAME OWNING_USERNAME
List all currently known groups
indigo group-list
Adds a user to a group by specifying the group name and the username
indigo group-add-user GROUP_NAME USER_NAME
Deletes the specified group
indigo group-delete GROUP_NAME
The ingest
command is used to import existing data into the Indigo system. By providing a directory the command will walk the files and sub-folders within that directory adding them as collections and resources in Indigo. The created collection structure will mirror the provided local directory.
This command needs at least 3 arguments, they are:
- group - The group name which will be given ownership of the newly created resources and collections
- user - The user who will be used to create the resources and collections.
- folder - The local folder to be ingested.
By default, all created resources are stored in Cassandra (the system default), and are created with URLs that point to a Blob in the Cassandra DB. It is possible to create the collections and resources but without uploading any files - this will mean that the created resource URLs will point to the local agent (which will then deliver the content). To perform this type of import the noimport
and localip
are required. The first is a boolean flag, the second a string with the IP address of the local agent.
Imports all of the folders and resources under /data into Cassandra.
indigo ingest --group TEST_GROUP--user TEST_USER --folder /data
In this case it is important that the agent is configured to point to /data for its disk storage as the URLs created will be relative to this. So a local file /data/test/somedata.csv will be given the URL file://192.168.10.10/test/somedata.csv
.
indigo ingest --group TEST_GROUP--user TEST_USER --folder /data --localip 192.168.10.10 --noimport