Skip to main content

Legacy Controller CLI Usage

Please see potctl for current CLI usage: potctl

iofog-controller <command> <action> <options>

Commands

startStart iofog-controller service.
stopStop iofog-controller service.
controllerDisplay iofog-controller service information.
helpDisplay usage information.
userUser operations.
configSet/Display iofog-controller service config.
tunnelTunnel operations.
iofogioFog node operations.
catalogMicroservices catalog operations.
flowApplication flow operations.
microserviceMicroservice instance operations.
registryRegistries instance operations.
diagnosticsDiagnostic instance operations.

start

Start the iofog-controller daemon

iofog-controller start

stop

Stop the iofog-controller daemon

iofog-controller stop

controller

Display iofog-controller service information.

iofog-controller controller <action> <options>

Actions

statusDisplay iofog-controller service status.
email-activationIs email activation.
fog-typesList all Fog-types.
versionDisplay iofog-controller service version.

help

Display the help document

iofog-controller help

user

User operations.

iofog-controller user <action> <options>

Actions

addAdd a new user.
updateUpdate existing user.
removeDelete a user.
listList all users.
generate-tokenGenerate token for a user.
activateActivate a user.
suspendSuspend a user.

Options

add
-f, --first-name stringUser's first name
-l, --last-name stringUser's last name
-e, --email stringUser's email address
-p, --password stringUser's password
iofog-controller user add \
--first-name test1 \
--last-name test2 \
--email test@example.com \
--password password1
update
-f, --first-name stringUser's first name
-l, --last-name stringUser's last name
-e, --email stringUser's email address
-p, --password stringUser's password
remove
-e, --email stringUser's email address
-F, --force booleanUser's force delete
generate-token
-e, --email stringUser's email address
activate
-e, --email stringUser's email address
suspend
-e, --email stringUser's email address

config

Set/Display iofog-controller service config.

iofog-controller config <options>

Actions

addChange current configuration.
listList current configuration.
dev-modeEnable/disable developer mode.
email-activationEnable/disable email activation.

Options

add
-p, --port integerPort
-c, --ssl-cert stringPath to SSL certificate file
-k, --ssl-key stringPath to SSL key file
-i, --intermediate-cert stringPath to SSL intermediate certificate file
-h, --home-url stringHome page url for email activation links
-a, --email-address stringEmail address to send activations from
-w, --email-password stringEmail password to send activations from
-s, --email-service stringEmail service to send activations
-d, --log-dir stringPath to log files directory
-z, --log-size integerLog files size (MB)
dev-mode
-o, --onEnable dev mode
-f, --offDisable dev mode
email-activation
-o, --onEnable
-f, --offDisable

Config Locations

Config files are located in project src/config/<file>.json. When installed using potctl resolves to /opt/iofog/controller/lib/node_modules/iofogcontroller/src/config/. There are 3 config files:

default.json (general data that is used for default values)

{
"App": {
"Name": "iofog-controller"
},
"Viewer": {
"Port": 80
},
"Kubelet": {
"Uri": "http://localhost:1234"
},
"Server": {
"Port": 51121,
"DevMode": false
},
"Email": {
"ActivationEnabled": false,
"HomeUrl": "https://google.com"
},
"Service": {
"LogsDirectory": "/var/log/iofog-controller",
"LogsFileSize": 10485760,
"LogsFileCount": 10
},
"Settings": {
"DefaultJobIntervalSeconds": 120,
"UserTokenExpirationIntervalSeconds": 3600,
"FogTokenExpirationIntervalSeconds": 3600,
"FogStatusUpdateIntervalSeconds": 120,
"FogStatusFrequencySeconds": 60
},
"Diagnostics": {
"DiagnosticDir": "diagnostic"
}
}

development.json (data for dev environment)

{
"App": {
"Name": "iofog-controller-dev"
},
"Viewer": {
"Port": 80
},
"Kubelet": {
"Uri": "http://localhost:1234"
},
"Server": {
"Port": 51121,
"DevMode": true
},
"Email": {
"ActivationEnabled": false,
"HomeUrl": "https://google.com"
},
"Service": {
"LogsDirectory": "/var/log/iofog-controller",
"LogsFileSize": 10485760,
"LogsFileCount": 10
},
"Settings": {
"UserTokenExpirationIntervalSeconds": 360000,
"FogTokenExpirationIntervalSeconds": 3600000,
"FogStatusUpdateIntervalSeconds": 120,
"FogStatusFrequencySeconds": 60
},
"Tunnel": {
"Username": "username",
"Password": "password",
"Host": "23.253.111.231",
"RsaKey": "rsa",
"Lport": 22,
"PortRange": "2000-10000"
},
"Diagnostics": {
"DiagnosticDir": "diagnostic"
},
"Database": {
"Provider": "sqlite",
"Config": {
"databaseName": "dev_database.sqlite",
"logging": false,
"transactionType": "IMMEDIATE",
"pool": {
"maxactive": 1,
"max": 1,
"min": 0,
"idle": 20000
}
}
}
}

production.json (production data)

{
"App": {
"Name": "iofog-controller"
},
"Viewer": {
"Port": 80
},
"Server": {
"Port": 51121,
"DevMode": true
},
"Email": {
"ActivationEnabled": false
},
"Service": {
"LogsDirectory": "/var/log/iofog-controller",
"LogsFileSize": 10485760,
"LogsFileCount": 10
},
"Settings": {
"UserTokenExpirationIntervalSeconds": 3600,
"FogTokenExpirationIntervalSeconds": 3600,
"FogStatusUpdateIntervalSeconds": 120,
"FogStatusFrequencySeconds": 60
},
"Database": {
"Provider": "sqlite",
"Config": {
"databaseName": "prod_database.sqlite",
"logging": false,
"transactionType": "IMMEDIATE",
"pool": {
"maxactive": 1,
"max": 1,
"min": 0,
"idle": 20000
}
}
}
}

tunnel

Tunnel operations.

iofog-controller tunnel <action> <options>

Actions

updateUpdate existing tunnel or create a new one.
listList all tunnels.

Options

update
-a, --action stringType of action: can be 'open' or 'close'
-u, --username stringTunnel username
-p, --password stringTunnel password
-s, --host stringTunnel host address
-k, --rsa-key stringPath to RSA key file
-o, --port integerTunnel port
-i, --iofog-uuid stringioFog node UUID
iofog-controller tunnel update \
--action close \
--username dmitry \
--password dpass \
--host 127.12.14.52 \
--rsa-key /home/dmitrys/documents/rsa.txt \
--port 22 \
--iofog-uuid NH44VjVFnr8946Yr8HPRrJdFZgLN8k7j

iofog

ioFog node operations.

iofog-controller iofog <action> <options>

Actions

addAdd a new ioFog node.
updateUpdate existing ioFog node.
removeDelete an ioFog node.
listList all ioFog nodes.
infoGet ioFog node settings.
provisioning-keyGet provisioning key for an ioFog node.
rebootReboot ioFog node.
prunePrune ioFog node.
versionChange agent version of ioFog node.
hal-hwGet HAL Hardware ioFog node data.
hal-usbGet HAL USB ioFog node data.

Options

add
-u, --user-id integerUser's id
-f, --file stringPath to ioFog settings JSON file
-n, --name stringioFog node name
-l, --location stringioFog node location
-t, --latitude floatioFog node latitude
-g, --longitude floatioFog node longitude
-d, --description stringioFog node description
-D, --docker-url stringioFog node docker url
-M, --disk-limit floatioFog node disk usage limit (MB)
-T, --disk-directory stringioFog node disk directory
-m, --memory-limit floatioFog node memory usage limit (MB)
-c, --cpu-limit floatioFog node CPU usage limit (%)
-G, --log-limit floatioFog node log size limit (MB)
-Y, --log-directory stringioFog node log files directory
-C, --log-file-count integerioFog node log files count
-s, --status-frequency integerioFog node status check frequency (seconds)
-F, --change-frequency integerioFog node configuration change check frequency (seconds)
-Q, --device-frequency integerioFog node device scan frequency (seconds)
-B, --bluetooth-enableEnable bluetooth on ioFog node
-b, --bluetooth-disableDisable bluetooth on ioFog node
-W, --watchdog-enableEnable watchdog on ioFog node
-w, --watchdog-disableDisable watchdog on ioFog node
-a, --abs-hw-disableDisable hardware abstraction on ioFog node
-A, --abs-hw-enableEnable hardware abstraction on ioFog node
-o, --rebootReboot ioFog node
-y, --fog-type integerioFog node architecture type
-L, --log-level stringioFog node log level
-p, --docker-pruning-frequency integerioFog node docker pruning frequency (hours)
-k, --disk-threshold integerioFog node disk threshold (%)
-e, --prunePrune ioFog node
update
-u, --user-id integerUser's id
-f, --file stringPath to ioFog settings JSON file
-n, --name stringioFog node name
-l, --location stringioFog node location
-t, --latitude floatioFog node latitude
-g, --longitude floatioFog node longitude
-d, --description stringioFog node description
-D, --docker-url stringioFog node docker url
-M, --disk-limit floatioFog node disk usage limit (MB)
-T, --disk-directory stringioFog node disk directory
-m, --memory-limit floatioFog node memory usage limit (MB)
-c, --cpu-limit floatioFog node CPU usage limit (%)
-G, --log-limit floatioFog node log size limit (MB)
-Y, --log-directory stringioFog node log files directory
-C, --log-file-count integerioFog node log files count
-s, --status-frequency integerioFog node status check frequency (seconds)
-F, --change-frequency integerioFog node configuration change check frequency (seconds)
-Q, --device-frequency integerioFog node device scan frequency (seconds)
-B, --bluetooth-enableEnable bluetooth on ioFog node
-b, --bluetooth-disableDisable bluetooth on ioFog node
-W, --watchdog-enableEnable watchdog on ioFog node
-w, --watchdog-disableDisable watchdog on ioFog node
-a, --abs-hw-disableDisable hardware abstraction on ioFog node
-A, --abs-hw-enableEnable hardware abstraction on ioFog node
-o, --rebootReboot ioFog node
-y, --fog-type integerioFog node architecture type
-L, --log-level stringioFog node log level
-p, --docker-pruning-frequency integerioFog node docker pruning frequency (hours)
-k, --disk-threshold integerioFog node disk threshold (%)
-e, --prunePrune ioFog node
remove
-i, --iofog-uuid stringioFog node UUID
-u, --user-id integerUser's id
info
-i, --iofog-uuid stringioFog node UUID
provisioning-key
-i, --iofog-uuid stringioFog node UUID
reboot
-i, --iofog-uuid stringioFog node UUID
prune
-i, --iofog-uuid stringioFog node UUID
version
-i, --iofog-uuid stringioFog node UUID
-v, --version-command stringioFog version command <upgrade/rollback>
hal-hw
-i, --iofog-uuid stringioFog node UUID
hal-usb
-i, --iofog-uuid stringioFog node UUID

catalog

Microservices catalog operations for your configured registries.

iofog-controller catalog <action> <options>

Actions

addAdd a new catalog item.
updateUpdate existing catalog item.
removeDelete a catalog item.
listList all catalog items.
infoGet catalog item settings.

Options

add
-u, --user-id integerUser's id
-f, --file stringPath to catalog item settings JSON file
-n, --name stringCatalog item name
-d, --description stringCatalog item description
-c, --category stringCatalog item category
-x, --x86-image stringx86 docker image name
-a, --arm-image stringARM docker image name
-p, --publisher stringCatalog item publisher name
-s, --disk-required integerAmount of disk required to run the microservice (MB)
-r, --ram-required integerAmount of RAM required to run the microservice (MB)
-t, --picture stringCatalog item picture
-P, --publicPublic catalog item
-V, --privatePrivate catalog item
-g, --registry-id integerCatalog item docker registry ID
-I, --input-type stringCatalog item input type
-F, --input-format stringCatalog item input format
-O, --output-type stringCatalog item output type
-T, --output-format stringCatalog item output format
-X, --config-example stringCatalog item config example
update
-i, --item-id integerCatalog item ID
-f, --file stringPath to catalog item settings JSON file
-n, --name stringCatalog item name
-d, --description stringCatalog item description
-c, --category stringCatalog item category
-x, --x86-image stringx86 docker image name
-a, --arm-image stringARM docker image name
-p, --publisher stringCatalog item publisher name
-s, --disk-required integerAmount of disk required to run the microservice (MB
-r, --ram-required integerAmount of RAM required to run the microservice (MB
-t, --picture stringCatalog item picture
-P, --publicPublic catalog item
-V, --privatePrivate catalog item
-g, --registry-id integerCatalog item docker registry ID
-I, --input-type stringCatalog item input type
-F, --input-format stringCatalog item input format
-O, --output-type stringCatalog item output type
-T, --output-format stringCatalog item output format
-X, --config-example stringCatalog item config example
remove
-i, --item-id integerCatalog item ID
info
-i, --item-id integerCatalog item ID

flow

Application flow operations.

iofog-controller flow <action> <options>

Actions

addAdd a new flow.
updateUpdate existing flow.
removeDelete a flow.
listList all flows.
infoGet flow settings.

Options

add
-u, --user-id integerUser's id
-f, --file stringPath to application flow settings JSON file
-n, --name stringApplication flow name
-d, --description stringApplication flow description
-a, --activateActivate application flow
-D, --deactivateDeactivate application flow
update
-i, --flow-id integerApplication flow ID
-f, --file stringPath to application flow settings JSON file
-n, --name stringApplication flow name
-d, --description stringApplication flow description
-a, --activateActivate application flow
-D, --deactivateDeactivate application flow
remove
-i, --flow-id integerApplication flow ID
info
-i, --flow-id integerApplication flow ID

microservice

Microservice instance operations.

iofog-controller microservice <action> <options>

Actions

addAdd a new microservice.
updateUpdate existing microservice.
removeDelete a microservice.
listList all microservices.
infoGet microservice settings.
route-createCreate microservice route.
route-removeRemove microservice route.
port-mapping-createCreate microservice port mapping.
port-mapping-removeRemove microservice port mapping.
port-mapping-listList microservice port mapping.
volume-mapping-createCreate microservice volume mapping.
volume-mapping-removeRemove microservice volume mapping.
volume-mapping-listList microservice volume mapping.

Options

add
-u, --user-id integerUser's id
-f, --file stringPath to microservice settings JSON file
-n, --name stringMicroservice name
-c, --catalog-id integerCatalog item ID
-F, --flow-id integerApplication flow ID
-I, --iofog-uuid stringioFog node UUID
-g, --config stringMicroservice config
-v, --volumes string[]Microservice volume mapping(s)
-l, --log-size integerLog file size limit (MB)
-r, --root-enableEnable root access
-R, --root-disableDisable root access
-p, --ports string[]Container ports
-t, --routes string[]Microservice route(s) (receiving microservices)
-e, --env string[]Microservice environemnt variable(s)
-C, --cmd string[]Microservice container command and argument(s)
-x, --x86-image stringx86 docker image name
-a, --arm-image stringARM docker image name
# Single mapping
iofog-controller microservice add \
--volumes /host_src:/container_src:rw \
--env KEY=value --cmd bash \
[other required options]

# Multiple mappings
iofog-controller microservice add \
--volumes /host_src:/container_src:rw /host_bin:/container_bin:r \
[other required options]

# Port mapping (80:8080:false - internal port : external port : public mode)
iofog-controller microservice add \
--ports 80:8080:false 443:5443:false \
[other required options]

# Add routes (ABC:DEF - source microservice UUID : dest microservice UUID)
iofog-controller microservice add \
--routes ABC:DEF RFG:HJK \
[other required options]
update
-i, --microservice-uuid stringMicroservice UUID
-f, --file stringPath to microservice settings JSON file
-n, --name stringMicroservice name
-F, --flow-id stringApplication flow ID
-I, --iofog-uuid stringioFog node UUID
-g, --config stringMicroservice config
-v, --volumes string[]Microservice volume mapping(s)
-l, --log-size integerLog file size limit (MB)
-r, --root-enableEnable root access
-R, --root-disableDisable root access
-w, --rebuildRebuild microservice image on fog agent
-e, --env string[]Microservice environemnt variable(s)
-C, --cmd string[]Microservice container command and argument(s)
-x, --x86-image stringx86 docker image name
-a, --arm-image stringARM docker image name
iofog-controller update \
--microservice-uuid <microservice-uuid> \
--volumes {'hostDestination':'/var1/dest','containerDestination':'/var/dest','accessMode':'w','type':'bind'} \
--name testcli
remove
-i, --microservice-uuid stringMicroservice UUID
-z, --cleanUpDelete microservice with cleanup
info
-i, --microservice-uuid stringMicroservice UUID
route-create
-T, --route stringMicroservice route (receiving microservices)
# Add route (ABC:DEF - source microservice uuid : dest microservice uuid)
iofog-controller microservice route-create \
--route ABC:DEF
route-remove
-T, --route stringMicroservice route (receiving microservices)
# Delete route (ABC:DEF - source microservice uuid : dest microservice uuid)
iofog-controller microservice route-remove \
--route ABC:DEF
port-mapping-create
-i, --microservice-uuid stringMicroservice UUID
-P, --mapping stringContainer port mapping
# Create port mapping (80:8080:false - internal port : external port : public mode, ABC - microservice)
iofog-controller microservice port-mapping-create \
--mapping 80:8080:false \
--microservice-uuid ABC
port-mapping-remove
-i, --microservice-uuid stringMicroservice UUID
-b, --internal-port integerInternal port
# Delete port mapping (80 - internal port, ABC - microservice uuid)
iofog-controller microservice port-mapping-remove \
--internal-port 80 \
--microservice-uuid ABC
port-mapping-list
-i, --microservice-uuid stringMicroservice UUID
volume-mapping-create
-i, --microservice-uuid stringMicroservice UUID
-P, --mapping stringContainer port mapping
# Create volume mapping
iofog-controller microservice volume-mapping-create \
--mapping /host_src:/container_src:rw \
--microservice-uuid ABC
volume-mapping-remove
-i, --microservice-uuid stringMicroservice UUID
-a, --mapping-id integerVolume mapping id
# Delete volume mapping
iofog-controller microservice volume-mapping-remove \
--microservice-uuid ABC \
--mapping-id 1
volume-mapping-list
-i, --microservice-uuid stringMicroservice UUID

registry

Registries instance operations.

iofog-controller registry <action> <options>

Actions

addAdd a new Registry.
updateUpdate a Registry.
removeDelete a Registry.
listList all Registries.

Options

add
-U, --uri stringRegistry URI
-b, --publicSet registry as public
-r, --privateSet registry as private
-l, --username stringRegistry's user name
-p, --password stringPassword
-c, --requires-certificateRequires certificate
-C, --certificate stringCertificate
-e, --email stringEmail address
-u, --user-id integerUser's id
update
-i, --item-id integerRegistry id
-U, --uri stringRegistry URI
-b, --publicSet registry as public
-r, --privateSet registry as private
-l, --username stringRegistry's user name
-p, --password stringPassword
-c, --requires-certificateRequires certificate
-C, --certificate stringCertificate
-e, --email stringEmail address
remove
-i, --item-id integerItem's id

diagnostics

Diagnostic instance operations.

iofog-controller diagnostics <action> <options>

Actions

strace-updateChange microservice strace status to enabled or disabled.
strace-infoGet microservice strace data.
strace-ftp-postPost microservice strace data to ftp.
image-snapshot-createCreate microservice image snapshot.
image-snapshot-getGet microservice image snapshot.

Options

strace-update
-i, --microservice-uuid stringMicroservice UUID
-e, --enableEnable microservice strace
-o, --disableDisable microservice strace
strace-info
-i, --microservice-uuid stringMicroservice UUID
-f, --format stringFormat of strace data to receive
strace-ftp-post
-i, --microservice-uuid stringMicroservice UUID
--h, --ftpHost stringFTP host
--p, --ftpPort integerFTP port
--u, --ftpUser stringFTP user
--s, --ftpPass stringFTP user password
--d, --ftpDestDir stringFTP destination directory
image-snapshot-create
-i, --microservice-uuid stringMicroservice UUID
image-snapshot-get
-i, --microservice-uuid stringMicroservice UUID