Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

CleverMaps Shell is controlled solely by a set of predefined commands. These commands can be divided in 4 categories, or workflow states. All commands and parameters are case sensitive.

Each command can be further specified by parameters, which can have default values. Each parameter also has a "--" prefix, which is a technicality, and is not mentioned in the tables below, for the sake of readability.

Parameters with string type take string input as a value, if they are mentioned. Parameters with enum type have predefined enumeration of strings, which can be passed as a value. Parameters with no type (-) are passed no values.

Workflow states

  • Started - you have started the tool
  • Connected to server - you have successfully logged in to your account on a specific server
  • Opened project - you have opened a project you have access to
  • Opened dump - you have created a new dump, or opened an existing one

_

...

_

Started state

login

Log in as a user with correct credentials.

...

email

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

server to connect to

default = https://secure.clevermaps.io

...

Status
colourGreen
titleOPTIONAL

...

proxy server hostname

...

Status
colourGreen
titleOPTIONAL

...

setup

Store your config and credentials in a file so you don't have to specify them each time you log in.

...

email

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

server to connect to

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

proxy server hostname

...

Status
colourGreen
titleOPTIONAL

...

Connected to server

openProject

Open a specific project.

...

project

...

Status
colourRed
titleREQUIRED

...

listProjects

List all your projects on the server.

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

createProject

Create a new project.

...

Status
colourRed
titleREQUIRED

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

editProject

Edit project properties.

...

Status
colourRed
titleREQUIRED

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

deleteProject

Delete an existing project.

...

Status
colourRed
titleREQUIRED

...

Opened project

importProject

Allows you to import either:

You can also import a part of a project with one of the parameters (dashboards, datasets, indicators, indicatorDrills, markers, markerSelectors, metrics, views). If you specify none of these parameters, the whole project will be imported. Everytime you specify a datasets parameter, corresponding data will be imported.

Before each import, validate command is called in the background. If there are any model validation violations in the source project, the import is stopped, unless you also provide the --force parameter.

During the import, the origin key is set to all metadata objects. This key indicates the original location of the object (server and the project). This has a special use in case of datasets & data import. import first takes a look at what datasets currently are in the project and compares them with datasets that are about to be imported. Datasets that are not present in the destination project will be imported automatically. In case of datasets that are present in the destination project, 3 cases might occur:

  • if they have the same name and origin, the dataset will not be imported
  • if they have the same name but different origin, a warning is shown and the dataset will not be imported
  • if a prefix is specified, all source datasets will be imported

...

Status
colourGreen
titleOPTIONAL

...

specifies if the output should be more verbose

default = https://secure.clevermaps.io

...

Status
colourYellow
titleVARIES

...

id of the project to import

either project or dump must be specified

...

Status
colourYellow
titleVARIES

...

id of the dump to import

either project or dump must be specified

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

load and dump request execution type

default = async

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

indicatorDrills

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

ignore source project validate errors and proceed with import anyway

skip failed dataset dumps (for projects with incomplete data)

...

Status
colourGreen
titleOPTIONAL

...

importDatabase

Allows you to create datasets and import data from an external database.

This command reads the database metadata from which datasets are created, then imports the data and saves them as CSV files. You can choose to import either of which with --skipMetadata and --skipData parameters. Please note that this command does not create any other metadata objects than datasets. It's also possible to import only specific tables using the --tables parameter.

The database must be located on a running database server which is accessible under an URL. This can be on localhost, or anywhere on the internet. Valid credentials to the database are of course necessary.

So far, the command supports these database engines:

...

Status
colourRed
titleREQUIRED

...

name of the database engine

...

Status
colourRed
titleREQUIRED

...

database server hostname

for local databases, use localhost

...

Status
colourRed
titleREQUIRED

...

Status
colourGreen
titleOPTIONAL

...

name of the database schema

leave out if your engine does not support schemas, or the schema is public

...

Status
colourRed
titleREQUIRED

...

Status
colourRed
titleREQUIRED

...

Status
colourRed
titleREQUIRED

...

Status
colourGreen
titleOPTIONAL

...

list of tables to import

leave out if you want to import all tables from the database

example = "orders,clients,stores"

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Usage examples:
Code Block
themeMidnight
importDatabase --engine postgresql --host localhost --port 5432 --database my_db --user postgres --password test
importDatabase --engine postgresql --host 172.16.254.1 --port 6543 --schema my_schema --database my_db --user postgres --password test --tables orders,clients,stores

loadCsv

Load data from a CSV file into a specified dataset.

This comand offers the execution parameter, which may be synchronous (sync) or asynchronous (async). Synchronous execution mode loads the CSV content through a single, constantly open connection. In most cases, synchronous execution is sufficient. To upload larger CSV files, it is better to use asynchronous execution. In case of asynchronous execution, after the upload of the content to an external storage (AWS S3), the load to the project itself is processed asynchronously as a job (AWS Step Functions). Shell then polls on this job and waits for a result.

loadCsv also offers various CSV input settings. Your CSV file may contain specific features, like custom quote or separator characters. The parameters with the csv prefix allow you to configure the data load to fit these features, instead of transforming the CSV file to one specific format. Special cases include the csvNull and csvForceNull parameters.

  • csvNull allows you to specify a value, which will be interpreted as a null value
    • e.g. "false" or "_"
  • csvForceNull then specifies on which columns the custom null replacement should be enforced
    • e.g. "name,title,description"

...

Status
colourRed
titleREQUIRED

...

Status
colourRed
titleREQUIRED

...

incremental mode appends the data to the end of the table

full mode truncates the table and loads the table anew

...

Status
colourGreen
titleOPTIONAL

...

load request execution type

default = async

...

[sync, async]

...

csvHeader

...

Status
colourGreen
titleOPTIONAL

...

specifies if the CSV file to upload has a header

default = true

...

[true, false]

...

Status
colourGreen
titleOPTIONAL

...

specifies the CSV column separator character

default = ,

...

Status
colourGreen
titleOPTIONAL

...

specifies the CSV quote character

default = "

...

Status
colourGreen
titleOPTIONAL

...

specifies the CSV escape character

default = \

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

enables more verbose output

default = false

...

Status
colourGreen
titleOPTIONAL

...

enables multipart file upload (recommended for files larger than 2 GB)

default = true

...

Status
colourGreen
titleOPTIONAL

...

enables gzip compression

default = true

...

dumpCsv

Dump data from a specified dataset into a CSV file.

This command also offers the synchronous/asynchronous execution type, analogously to the loadCsv command, as described above.

...

Status
colourGreen
titleOPTIONAL

...

Status
colourRed
titleREQUIRED

...

Status
colourGreen
titleOPTIONAL

...

dump request execution type

default = async

...

dumpProject

Dump project data & metadata to a directory. If the dump if successfull, the current dump is opened.

...

Status
colourGreen
titleOPTIONAL

...

stored in config file

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

dump request execution type

default = async

...

Status
colourGreen
titleOPTIONAL

...

listDumps

List all local project dumps.

...

Status
colourGreen
titleOPTIONAL

...

stored in config file

openDump

Open a specific dump.

...

Status
colourGreen
titleOPTIONAL

...

stored in config file

...

Status
colourGreen
titleOPTIONAL

...

open a specific dump

if not specified, latest dump is opened

truncateProject

Deletes all metadata and data from the project.

This command has no parameters.

validate

Validate the project's data model and data.

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

skip validations of the data itself

...

Status
colourGreen
titleOPTIONAL

...

validation request execution type

default = async

...

Opened dump

addMetadata

Add a metadata object to the project. The file must be located in a currently opened dump, and in the correct directory.

If the --objectName parameter is not specified, addMetadata will add all new objects in the current dump.

...

Status
colourGreen
titleOPTIONAL

...

createMetadata

Create a new metadata object.

(info) At this moment, only dataset type is supported. Datasets are generated from a provided CSV file.

...

Status
colourRed
titleREQUIRED

...

[dataset]

...

Status
colourRed
titleREQUIRED

...

Status
colourYellow
titleVARIES

...

name of the object copy (with or without .json extension)

required only for dataset type

...

Status
colourYellow
titleVARIES

...

path to the CSV file (located either in dump, or anywhere in the file system)

required only for dataset type

...

Status
colourGreen
titleOPTIONAL

...

name of the CSV column that will be marked as primary key

if not specified, first CSV column is selected

...

Status
colourYellow
titleVARIES

...

name of the geometry key

required only for geometryPolygon subtype

...

Status
colourGreen
titleOPTIONAL

...

specifies custom CSV column separator character

default = ,

...

Status
colourGreen
titleOPTIONAL

...

specifies custom CSV column quote character

default = "

...

Status
colourGreen
titleOPTIONAL

...

specifies custom CSV column escape character

default = \

Usage examples:
Code Block
themeMidnight
createMetadata --type dataset --subtype basic --objectName "baskets" --file "baskets.csv" --primaryKey "basket_id"
createMetadata --type dataset --subtype geometryPoint --objectName "shops" --file "shops.csv" --primaryKey "shop_id"
createMetadata --type dataset --subtype geometryPolygon --objectName "district" --geometry "districtgeojson" --file "district.csv" --primaryKey "district_code"

removeMetadata

Remove a metadata object from the project and from the dump. The file must be located in a currently opened dump, and must not be new.

...

Status
colourRed
titleREQUIRED

...

renameMetadata

Rename an object in a local dump and on the server. If the object is referenced in some other objects by URI (/rest/projects/$projectId/md/{objectType}?name=), the references will be renamed as well.

...

Status
colourRed
titleREQUIRED

...

Status
colourRed
titleREQUIRED

...

copyMetadata

Create a copy of an object existing in a currently opened dump.

This command unwraps the object from a wrapper, renames it and removes generated common syntax keys. If the objectName and newName arguments are the same, the object is unwrapped only.

...

Status
colourRed
titleREQUIRED

...

Status
colourRed
titleREQUIRED

...

pushProject

Upload all modified files (data & metadata) to the project.

This command basically wraps the functionality of loadCsv. It collects all modified metadata to upload, and performs asynchronous full load of CSV files.

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

load request execution type

default = async

...

Status
colourGreen
titleOPTIONAL

...

Status
colourGreen
titleOPTIONAL

...

enables more verbose output

default = false

...

Status
colourGreen
titleOPTIONAL

...

enables multipart file upload (recommended for files larger than 2 GB)

default = true

...

Status
colourGreen
titleOPTIONAL

...

enables gzip compression

default = true

...

[true, false]

status

Check the status of a currently opened dump against the project on the server.

This command detects files which have been locally or remotely changed, and also detects files which have a syntax error or constraint violations.

...

Status
colourGreen
titleOPTIONAL

...

applyDiff

Create and apply metadata diff between two live projects.

This command compares all metadata objects of the currently opened project and project specified in the --sourceProject command, and applies changes to the currently opened dump. Metadata objects in dump can be either:

  • added (completely new objects that aren't present in currently opened project)
  • modified
  • deleted (deleted objects not present in the sourceProject)

When the command finishes, you can review the changes applied to the dump using either status or diff comands. The command then tells you to perform specific subsequent steps. This can be one of (or all) these commands:

  • addMetadata (to add the new objects)
  • pushProject (to push the changes in modified objects)
  • removeMetadata (to remove the deleted objects - a command list which must be copypasted to Shell is generated (info))

...

Status
colourGreen
titleOPTIONAL

...

list of object types to be compared

example = "views,indicators,metrics"

diff

Compare local metadata objects with those in project line by line.

If the --objectName parameter is not specified, all wrapped modifed objects are compared.

...

Status
colourGreen
titleOPTIONAL

...

The command outputs sets of changes - "deltas" done in each object. Each object can have multiple deltas, which are followed by header with syntax:

Code Block
themeMidnight
/{objectType}/{objectName}.json
[ A1 A2 | B1 B2 ]
...

Where:
A1 = start delta line number in the dump file
A2 = end delta line number in the dump file
B1 = start delta line number in the remote file
B2 = end delta line number in the remote file

Specific output example:

Image Removed

...

Panel
panelIconId1f389
panelIcon:tada:
panelIconText🎉
bgColor#E3FCEF

The content you are trying to reach has been moved here: https://docs.clevermaps.io/docs/command-list

We are proud to announce that we have launched a new documentation.

Please update your saved links and bookmarks to follow a new address docs.clevermaps.io.