Usage
Working with Memphis CLI

Usage

Connect

Once connected, all features offered by Memphis are available.

Connection to Memphis control plane:

1
$ mem connect -s <control-plane> -u root -p memphis
Copied!

Required parameters:

1
-u, --user User
2
-p, --password <password> Password
3
-s, --server <server> Memphis control plane
4
-h, --help display help for command
Copied!

Example:

1
$ mem connect -u root -p memphis -s http://control-plane
2
Connected successfully to Memphis control plane.
Copied!

Factory

A factory binds stations that close business logic.
1
$ mem factory <command> [options]
Copied!

Factory commands:

1
ls List of factories
2
create Create new factory
3
edit Edit factory name and/or description
4
del Delete a factory
Copied!

Factory options:

1
-d, --desc <factory-description> Factory description
2
-h, --help display help for command
Copied!

Examples:

1
$ mem factory ls
2
┌─────────┬────────┬─────────────┬─────────────────┬────────────────────────────┐
3
(index) │ name │ description │ created_by_user │ creation_date │
4
├─────────┼────────┼─────────────┼─────────────────┼────────────────────────────┤
5
│ 0 │ 'test''''root''2022-04-19T06:21:19.029Z'
6
└─────────┴────────┴─────────────┴─────────────────┴────────────────────────────┘
Copied!
1
$ mem factory create myfactory
2
Factory myfactory was created.
3
4
$ mem factory ls
5
┌─────────┬─────────────┬────────────────────┬─────────────────┬────────────────────────────┐
6
(index) │ name │ description │ created_by_user │ creation_date │
7
├─────────┼─────────────┼────────────────────┼─────────────────┼────────────────────────────┤
8
│ 0 │ 'test''''root''2022-04-19T06:21:19.029Z'
9
│ 1 │ 'myfactory''''root''2022-04-20T09:22:49.037Z'
10
└─────────┴─────────────┴────────────────────┴─────────────────┴────────────────────────────┘
Copied!
1
$ mem factory edit myfactory -d 'my first factory'
2
Factory myfactory was edited.
3
4
$ mem factory ls
5
┌─────────┬─────────────┬────────────────────┬─────────────────┬────────────────────────────┐
6
(index) │ name │ description │ created_by_user │ creation_date │
7
├─────────┼─────────────┼────────────────────┼─────────────────┼────────────────────────────┤
8
│ 0 │ 'test''''root''2022-04-19T06:21:19.029Z'
9
│ 1 │ 'myfactory''my first factory''root''2022-04-20T09:22:49.037Z'
10
└─────────┴─────────────┴────────────────────┴─────────────────┴────────────────────────────┘
Copied!
1
$ mem factory del myfactory
2
Factory myfactory was removed.
3
4
$ mem factory ls
5
┌─────────┬────────┬─────────────┬─────────────────┬────────────────────────────┐
6
(index) │ name │ description │ created_by_user │ creation_date │
7
├─────────┼────────┼─────────────┼─────────────────┼────────────────────────────┤
8
│ 0 │ 'test''''root''2022-04-19T06:21:19.029Z'
9
└─────────┴────────┴─────────────┴─────────────────┴────────────────────────────┘
Copied!

Stations

A station is Memphis' version of a queue/topic/channel/subject.
1
$ mem station <command> [options]
Copied!

Station commands:

1
ls List of stations
2
create Create new station
3
info Specific station's info
4
del Delete a station
Copied!

Station options:

1
-f, --factory <factory> Factory name
2
-rt, --retentiontype <retention-type> Retention type
3
-rv, --retentionvalue <retention-value> Retention value
4
-s, --storage <storage-type> Storage type
5
-r, --replicas <replicas> Replicas
6
-de, --dedupenabled <dedup-enabled> Dedup enabled
7
-dw, --dedupwindow <dedup-window-in-ms> Dedup window in ms
8
-h, --help display help for command
Copied!

Examples:

1
$ mem station ls
2
┌─────────┬────────┬─────────┬───────────────────┬────────────────────┬──────────────┬──────────┬───────────────┬─────────────────┬────────────┬───────────────┬──────────────┐
3
(index) │ name │ factory │ retention type │ retentention value │ storage type │ replicas │ dedup enabled │ dedup window ms │ created by │ creation date │ last_update │
4
├─────────┼────────┼─────────┼───────────────────┼────────────────────┼──────────────┼──────────┼───────────────┼─────────────────┼────────────┼───────────────┼──────────────┤
5
│ 0 │ 'test''test''message_age_sec' │ 604800 │ '' │ 1 │ false │ 0 │ 'root''2022-04-20''2022-04-20'
6
└─────────┴────────┴─────────┴───────────────────┴────────────────────┴──────────────┴──────────┴───────────────┴─────────────────┴────────────┴───────────────┴──────────────┘
Copied!
1
$ mem station create mystation -f myfactory
2
Station mystation was created with the following details:
3
┌─────────┬─────────────┬───────────────────┬────────────────────┬──────────────┬──────────┬───────────────┬─────────────────┬────────────┬───────────────┐
4
(index) │ name │ retention type │ retentention value │ storage type │ replicas │ dedup enabled │ dedup window ms │ created by │ creation date │
5
├─────────┼─────────────┼───────────────────┼────────────────────┼──────────────┼──────────┼───────────────┼─────────────────┼────────────┼───────────────┤
6
│ 0 │ 'mystation''message_age_sec' │ 604800 │ '' │ 1 │ false │ 0 │ 'root''2022-04-20'
7
└─────────┴─────────────┴───────────────────┴────────────────────┴──────────────┴──────────┴───────────────┴─────────────────┴────────────┴───────────────┘
8
9
$ mem station ls
10
┌─────────┬─────────────┬─────────────┬───────────────────┬────────────────────┬──────────────┬──────────┬───────────────┬─────────────────┬────────────┬───────────────┬──────────────┐
11
(index) │ name │ factory │ retention type │ retentention value │ storage type │ replicas │ dedup enabled │ dedup window ms │ created by │ creation date │ last_update │
12
├─────────┼─────────────┼─────────────┼───────────────────┼────────────────────┼──────────────┼──────────┼───────────────┼─────────────────┼────────────┼───────────────┼──────────────┤
13
│ 0 │ 'test''test''message_age_sec' │ 604800 │ '' │ 1 │ false │ 0 │ 'root''2022-04-20''2022-04-20'
14
│ 1 │ 'mystation''myfactory''message_age_sec' │ 604800 │ '' │ 1 │ false │ 0 │ 'root''2022-04-20''2022-04-20'
15
└─────────┴─────────────┴─────────────┴───────────────────┴────────────────────┴──────────────┴──────────┴───────────────┴─────────────────┴────────────┴───────────────┴──────────────┘
Copied!
1
$ mem station info mystation
2
Station info:
3
{
4
id: '62600a5a03e78b618f036364',
5
name: 'mystation',
6
factory_id: '62600a4503e78b618f036363',
7
retention_type: 'message_age_sec',
8
retention_value: 604800,
9
storage_type: '',
10
replicas: 1,
11
dedup_enabled: false,
12
dedup_window_in_ms: 0,
13
created_by_user: 'root',
14
creation_date: '2022-04-20T13:27:54.818Z',
15
last_update: '2022-04-20T13:27:54.818Z',
16
functions: []
17
}
Copied!
1
$ mem station del mystation
2
Statoin mystation was removed.
3
4
$ mem station ls
5
┌─────────┬────────┬─────────┬───────────────────┬────────────────────┬──────────────┬──────────┬───────────────┬─────────────────┬────────────┬───────────────┬──────────────┐
6
(index) │ name │ factory │ retention type │ retentention value │ storage type │ replicas │ dedup enabled │ dedup window ms │ created by │ creation date │ last_update │
7
├─────────┼────────┼─────────┼───────────────────┼────────────────────┼──────────────┼──────────┼───────────────┼─────────────────┼────────────┼───────────────┼──────────────┤
8
│ 0 │ 'test''test''message_age_sec' │ 604800 │ '' │ 1 │ false │ 0 │ 'root''2022-04-20''2022-04-20'
9
└─────────┴────────┴─────────┴───────────────────┴────────────────────┴──────────────┴──────────┴───────────────┴─────────────────┴────────────┴───────────────┴──────────────┘
Copied!

Users

You can manage users and permissions.
1
$ mem user <command> [options]
Copied!

User commands:

1
ls List of users
2
add Add new user
3
del Delete user
Copied!

User options:

1
-u, --username <username> Username
2
-p, --password <user-password> User password
3
-t, --type <user-type> User type (default: "management") - application/management
4
-a, --avatar <avatar-id> Avatar id (default: 1) - 1-4
5
-h, --help display help for command
Copied!

Examples:

1
$ mem user ls
2
┌─────────┬───────────┬────────────────────────────┬───────────┐
3
(index) │ user_name │ creation_date │ user_type │
4
├─────────┼───────────┼────────────────────────────┼───────────┤
5
│ 0 │ 'root''2022-04-18T12:38:47.034Z''root'
6
└─────────┴───────────┴────────────────────────────┴───────────┘
Copied!
1
$ mem user add --name shay --password 123456
2
{ type: 'management', avatar: 1, name: 'shay', password: '123456' }
3
User shay was created.
Copied!
1
$ mem user add --name sveta --type application --avatar 3
2
{ type: 'application', avatar: '3', name: 'sveta' }
3
User sveta was created.
4
Broker connection credentials: imeD5g08Bz8mbJavU4zi
5
These credentials CANT be restored, save them in a safe place
6
7
$ mem user ls
8
┌─────────┬───────────┬────────────────────────────┬───────────────┐
9
(index) │ user_name │ creation_date │ user_type │
10
├─────────┼───────────┼────────────────────────────┼───────────────┤
11
│ 0 │ 'root''2022-04-18T12:38:47.034Z''root'
12
│ 1 │ 'shay''2022-04-20T13:54:32.571Z''management'
13
│ 2 │ 'sveta''2022-04-20T13:56:46.589Z''application'
14
└─────────┴───────────┴────────────────────────────┴───────────────┘
Copied!
1
$ mem user del shay
2
User shay was removed.
3
4
$ mem user ls
5
┌─────────┬───────────┬────────────────────────────┬───────────────┐
6
(index) │ user_name │ creation_date │ user_type │
7
├─────────┼───────────┼────────────────────────────┼───────────────┤
8
│ 0 │ 'root''2022-04-18T12:38:47.034Z''root'
9
│ 1 │ 'sveta''2022-04-20T14:01:38.494Z''application'
10
└─────────┴───────────┴────────────────────────────┴───────────────┘
Copied!

Producers

A producer is an entity that can send messages into stations.

Producer commands:

1
ls List of Producers
Copied!

Producer options:

1
-s, --station <station-name> Producers by station
2
-h, --help display help for command
Copied!

Examples:

1
$ mem producer ls
2
┌─────────┬──────┬──────┬─────────────────┬──────────────┬──────────────┬───────────────┐
3
(index) │ name │ type │ created_by_user │ station_name │ factory_name │ creation_date │
4
├─────────┼──────┼──────┼─────────────────┼──────────────┼──────────────┼───────────────┤
5
│ 0 │ ' '' '' '' '' '' '
6
└─────────┴──────┴──────┴─────────────────┴──────────────┴──────────────┴───────────────┘
Copied!

Consumers

A consumer is an entity that can consume messages from stations.

Consumer commands:

1
ls List of Consumers
Copied!

Consumer options:

1
-s, --station <station-name> Consumers by station
2
-h, --help display help for command
Copied!

Examples:

1
$ mem consumer ls
2
┌─────────┬──────┬──────┬────────────────┬─────────────────┬──────────────┬──────────────┬───────────────┐
3
(index) │ name │ type │ consumer_group │ created_by_user │ station_name │ factory_name │ creation_date │
4
├─────────┼──────┼──────┼────────────────┼─────────────────┼──────────────┼──────────────┼───────────────┤
5
│ 0 │ ' '' '' '' '' '' '' '
6
└─────────┴──────┴──────┴────────────────┴─────────────────┴──────────────┴──────────────┴───────────────┘
Copied!

Init

Creates an example project for working with Memphis.

Examples:

1
$ mem init
2
3
'mem init' creates an example project for connecting an app with Memphis.
4
5
The default language is nodejs.
6
If you want to use different language use 'mem init -l/--language <language>'.
7
Currently supported languages: nodejs.
8
9
For more help use 'mem init -h'.
10
11
The project will be created in directory /Users/myUser/myCurrentDir
12
continue? Y/n
13
index.js was created.
Copied!