Usage of the aktool utility
Description
aktool — is a command tool that gives administrators access to various platform management functions through the terminal. With aktool you can perform various operations such as migration, data cleansing, account management, user management, tariffs and other system entities.
To run aktool, start the terminal and, while in the root directory of the platform, execute the command:
./aktool --help
This command will display the available commands and flags.
In some cases, upgrading the platform may require you to perform a migration using aktool. This allows you to losslessly update your data to the new platform version. In the description of a release that requires such a migration, we describe in detail which commands can be used to perform it.
List of aktool commands
For more information about a specific command, type the following:
./aktool [command] --help
| Command | Description |
|---|---|
| accounts | Managing accounts |
| admins | Managing administrators |
| akmta | AKMTA management |
| cleanup | Cleaning up data for an instance |
| completion | Generate an autocomplete script for the specified shell |
| configs | Configuration management |
| field_migrator | Migrating one field to another |
| help | Get help on any command |
| history_storage | Actions with history storage tables |
| indexes | Creating indexes in the platform database |
| keys | Managing keys |
| migrate | Perform data migration |
| nodes | Managing nodes |
| printconf | Display current values of platform configs |
| profile_history | Manage profile history tables |
| rabbitmq | Manage RabbitMQ |
| resource_system_fields | Adding system fields to a resource |
| roles | Actions with roles in accounts |
| smid | [SMID] decoder(/en/admin-guide/extra/56257642) |
| stats | Manage statistics tables |
| tariffs | Manage tariffs |
| users | Manage account users |
| workflow | Scenarios management |
accounts
./aktool accounts
The accounts command allows you to interact with accounts
Usage:
aktool accounts [command]
Available Commands:
create Create account
delete Delete account
disable Disable account
enable Enable account
list Show list of accounts
update Update account
Flags:
-h, --help help for accounts
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
admins
./aktool admins
The accounts command allows you to interact with accounts
Usage:
aktool accounts [command]
Available Commands:
create Create account
delete Delete account
disable Disable account
enable Enable account
list Show list of accounts
update Update account
Flags:
-h, --help help for accounts
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
akmta
./aktool akmta
The accounts command allows you to interact with accounts
Usage:
aktool accounts [command]
Available Commands:
create Create account
delete Delete account
disable Disable account
enable Enable account
list Show list of accounts
update Update account
Flags:
-h, --help help for accounts
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
cleanup
./aktool cleanup
The accounts command allows you to interact with accounts
Usage:
aktool accounts [command]
Available Commands:
create Create account
delete Delete account
disable Disable account
enable Enable account
list Show list of accounts
update Update account
Flags:
-h, --help help for accounts
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
completion
./aktool completion
The accounts command allows you to interact with accounts
Usage:
aktool accounts [command]
Available Commands:
create Create account
delete Delete account
disable Disable account
enable Enable account
list Show list of accounts
update Update account
Flags:
-h, --help help for accounts
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
configs
./aktool configs
The accounts command allows you to interact with accounts
Usage:
aktool accounts [command]
Available Commands:
create Create account
delete Delete account
disable Disable account
enable Enable account
list Show list of accounts
update Update account
Flags:
-h, --help help for accounts
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
field_migrator
./aktool field_migrator
Migrates value from old field to new. Now support ONLY phone field
If new field is not exists it will be created.
If new field is exists, value from old field (if it not empty) will override new field
Usage:
aktool field_migrator --accID=int --dbID=int --old_field=string --new_field=string [flags]
Examples:
field_migrator --accID=1 --dbID=2 --old_field=phone --new_field=mbl_phone --config=path/to/main.json
Flags:
--accID int account id where placed database
--dbID int database with field to be migrated
-h, --help help for field_migrator
--new_field string new field to migrate to
--old_field string field name to be migrated
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
help
./aktool help
Help provides help for any command in the application.
Simply type aktool help [path to command] for full details.
Usage:
aktool help [command] [flags]
Flags:
-h, --help help for help
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
history_storage
./aktool history_storage
The command allows you to manipulate with history storage tables.
Usage:
aktool history_storage [command]
Available Commands:
init Init history tables
Flags:
-h, --help help for history_storage
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
indexes
./aktool indexes
The commands allows you to create all platform database indexes
Usage:
aktool indexes [command]
Available Commands:
ensure Ensure indexes [account_id_1,account_id_2,...]
Flags:
-h, --help help for indexes
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
keys
./aktool keys
The keys command allows you to interact with keys.
Usage:
aktool keys [command]
Available Commands:
import Import a key
list Show all keys
remove Remove a key
Flags:
-h, --help help for keys
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
migrate
./aktool migrate
Perform some data migration
Usage:
aktool migrate [command]
Available Commands:
importempty Mountiong checkboxes for scheduled imports for account(s)
importfeed Update column for import feed
log Migrate old logs for account(s)
ssdbhbsupp Transfer data from ssdb hbsupp to mongodb
ssdbnotify Transfer 30 days data from ssdb notify to mongodb
webversion Transfer web version to s3like storage
Flags:
-h, --help help for migrate
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
nodes
./aktool nodes
The nodes command allows you to interact with nodes
Usage:
aktool nodes [command]
Available Commands:
create Create a node
list Show all nodes
remove Remove a node
update Update a node
Flags:
-h, --help help for nodes
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
printconf
./aktool printconf
The nodes command allows you to interact with nodes
Usage:
aktool nodes [command]
Available Commands:
create Create a node
list Show all nodes
remove Remove a node
update Update a node
Flags:
-h, --help help for nodes
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
Use "aktool nodes [command] --help" for more information about a command.
root@dev-georgy-shanin:/opt/MarketingPlatform# ./aktool printconf --help
Print full config parameters static or dynamic in JSON
Usage:
aktool printconf [type=base|trk] [flags]
Flags:
-h, --help help for printconf
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
profile_history
./aktool profile_history
The command allows you to interact with profile history tables
Usage:
aktool profile_history [command]
Available Commands:
delete Delete profile history table
fill Fill profile history table
init Init profile history table
Flags:
-h, --help help for profile_history
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
rabbitmq
./aktool rabbitmq
The command allows you to interact with profile history tables
Usage:
aktool profile_history [command]
Available Commands:
delete Delete profile history table
fill Fill profile history table
init Init profile history table
Flags:
-h, --help help for profile_history
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
resource_system_fields
./aktool resource_system_fields
Add system fields in resource
Usage:
aktool resource_system_fields [flags]
Flags:
-h, --help help for resource_system_fields
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
roles
./aktool roles
Actions with roles in accounts
Usage:
aktool roles [command]
Available Commands:
tag_manager_def_role Fix rights for tag_manager object in default roles
Flags:
-h, --help help for roles
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
smid
./aktool smid
Decode send message id
Usage:
aktool smid [flags]
Flags:
-h, --help help for smid
--json pretty json
--to string convert send message id to ESMID|USMID
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
stats
./aktool stats
The stats command allows you to interact with stat tables
Usage:
aktool stats [command]
Available Commands:
delete Delete stat table
fill Fill stats table
init Init stat table
Flags:
-h, --help help for stats
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
tariffs
./aktool tariffs
The tariffs command allows you to interact with tariffs
Usage:
aktool tariffs [command]
Available Commands:
create Create a tariff
list Show all tariffs
remove Remove a tariff.
update Update a tariff
Flags:
-h, --help help for tariffs
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
users
./aktool users
The users command allows you to interact with account users
Usage:
aktool users [command]
Available Commands:
create Create user
list Show all users
password Change password
remove Remove user
update Update user
Flags:
-h, --help help for users
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output
workflow
./aktool workflow
The workflows command allows you to interact with workflows
Usage:
aktool workflow [command]
Available Commands:
api_nodes_convert convert api_nodes struct
Flags:
-h, --help help for workflow
Global Flags:
--clickhouse_database_name string usage database for clickhouse
--config string config path (default "/opt/akd/config/main.json")
-o, --output string file path to output in the result of the command (default "stdout")
--truncate whether to truncate the file specified by --output