42

GitHub - ioFog/Controller

 5 years ago
source link: https://github.com/ioFog/Controller
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

Fog Controller Usage

$ iofog-controller <command> <options>

Command List

start -- Start iofog-controller service.
stop -- Stop iofog-controller service.
controller -- Display iofog-controller service information.
help -- Display usage information.
user -- User operations.
config -- Set/Display iofog-controller service config.
connector -- Connector operations.
tunnel -- Tunnel operations.
iofog -- ioFog nodes operations.
catalog -- Microservices catalog operations.
flow -- Application flow operations.
microservice -- Microservice instance operations.
registry -- Registries instance operations.
diagnostics -- Diagnostic instance operations.



Controller

$ iofog-controller controller <command> <options>

Command List

  • status -- Display iofog-controller service status.
  • email-activation -- Is email activation.
  • fog-types -- List all Fog-types.
  • version -- Display iofog-controller service version.



User

$ iofog-controller user <command> <options>

Command List

  • add -- Add a new user.
  • update -- Update existing user.
  • remove -- Delete a user.
  • list -- List all users.
  • generate-token -- Generate token for a user.
  • activate -- Activate a user.
  • suspend -- Suspend a user.

add

-f, --first-name string (User's first name)
-l, --last-name string (User's last name)
-e, --email string (User's email address)
-p, --password string (User's password)

update -e <email>

-f, --first-name string (User's first name)
-l, --last-name string (User's last name)
-p, --password string (User's password)

remove

-e, --email string (User's email address)

generate-token

-e, --email string (User's email address)

activate

-e, --email string (User's email address)

suspend

-e, --email string (User's email address)

Example

node src/main.js user add -f test1 -l test2 -e [email protected] -p password1



Config

$ iofog-controller config <options>

add

-p, --port number (Port)
-c, --ssl-cert string (Path to SSL certificate file)
-k, --ssl-key string (Path to SSL key file)
-i, --intermediate-cert string (Path to SSL intermediate certificate file)
-m, --email-activation-on (Email activation required)
-n, --email-activation-off (Email activation not required)
-a, --email-address string (Email address to send activations from)
-w, --email-password string (Email password to send activations from)
-s, --email-service string (Email service to send activations)
-d, --log-dir string (Log files directory)
-z, --log-size number (Log files size (MB))

list

dev-mode

-o, --on (Enable dev mode)
-f, --off (Disable dev mode)




Connector

$ iofog-controller connector <command> <options>

Command List

add -- Add a new Connector.
update -- Update existing Connector.
remove -- Delete a Connector.
list -- List all Connectors.

add

-n, --name string (Connector name)
-d, --domain string (Connector domain name)
-i, --public-ip string (Connector public IP address)
-c, --cert string (Certificate)
-S, --self-signed-on (Switch on self-signed enabled)
-s, --self-signed-off (Switch off self-signed disabled)
-H, --dev-mode-on (Switch on dev mode)
-h, --dev-mode-off (Switch off dev mode)

update -i <public-ip>

-n, --name string (Connector name)
-d, --domain string (Connector domain name)
-c, --cert string (Certificate)
-S, --self-signed-on (Switch on self-signed enabled)
-s, --self-signed-off (Switch off self-signed disabled)
-H, --dev-mode-on (Switch on dev mode)
-h, --dev-mode-off (Switch off dev mode)

remove

-i, --public-ip string (Connector public IP address)




Tunnel

$ iofog-controller tunnel <command> <options>

Command List

update -- Update existing tunnel or create a new one.
list -- List all tunnels.

update -a <action> (Action: can be either 'open' or 'close')

-u, --username string (Tunnel username)
-p, --password string (Tunnel password)
-s, --host string (Tunnel host address)
-k, --rsa-key string (Tunnel RSA key)
-o, --port number (Tunnel port)
-f, --iofogUuid string (Fog UUID)

Example
tunnel update -a close -u dmitry -p dpass -s 127.12.14.52 -k /home/dmitrys/documents/rsa.txt -o 22 -f NH44VjVFnr8946Yr8HPRrJdFZgLN8k7j

list

Example
tunnel list


IoFog

$ iofog-controller iofog <command> <options>

Command List

add -- Add a new ioFog node.
update -- Update existing ioFog node.
remove -- Delete an ioFog node.
list -- List all ioFog nodes.
info -- Get ioFog node settings.
provisioning-key -- Get provisioning key for an ioFog node.
reboot -- Reboot ioFog node.

version -- Change agent version of ioFog node.
hal-hw -- Get HAL Hardware ioFog node data.
hal-usb -- Get HAL USB ioFog node data.

add -u <user-id>

-f, --file string (ioFog settings JSON file)
-n, --name string (ioFog node name)
-l, --location string (ioFog node location)
-t, --latitude number (ioFog node latitude)
-g, --longitude number (ioFog node longitude)
-d, --description string (ioFog node description)
-D, --docker-url string (ioFog node docker url)
-M, --disk-limit number (ioFog node disk usage limit (MB))
-T, --disk-directory string (ioFog node disk directory)
-m, --memory-limit number (ioFog node memory usage limit (MB))
-c, --cpu-limit number (ioFog node CPU usage limit (%))
-G, --log-limit number (ioFog node log size limit (MB))
-Y, --log-directory string (ioFog node log files directory)
-C, --log-file-count number (ioFog node log files count)
-s, --status-frequency number (ioFog node status check frequency (seconds))
-F, --change-frequency number (ioFog node configuration change check frequency (seconds))
-Q, --device-frequency number (ioFog node device scan frequency (seconds))
-B, --bluetooth-enable (Enable bluetooth on ioFog node)
-b, --bluetooth-disable (Disable bluetooth on ioFog node)
-W, --watchdog-enable (Enable watchdog on ioFog node)
-w, --watchdog-disable (Disable watchdog on ioFog node)
-a, --abs-hw-disable (Disable hardware abstraction on ioFog node)
-A, --abs-hw-enable (Enable hardware abstraction on ioFog node)
-o, --reboot (Reboot ioFog node)
-y, --fog-type number (ioFog node architecture type)

update -i <node-id>

-f, --file string (ioFog settings JSON file)
-n, --name string (ioFog node name)
-l, --location string (ioFog node location)
-t, --latitude number (ioFog node latitude)
-g, --longitude number (ioFog node longitude)
-d, --description string (ioFog node description)
-D, --docker-url string (ioFog node docker url)
-M, --disk-limit number (ioFog node disk usage limit (MB))
-T, --disk-directory string (ioFog node disk directory)
-m, --memory-limit number (ioFog node memory usage limit (MB))
-c, --cpu-limit number (ioFog node CPU usage limit (%))
-G, --log-limit number (ioFog node log size limit (MB))
-Y, --log-directory string (ioFog node log files directory))
-C, --log-file-count number (ioFog node log files count)
-s, --status-frequency number (ioFog node status check frequency (seconds))
-F, --change-frequency number (ioFog node configuration change check frequency (seconds))
-Q, --device-frequency number (ioFog node device scan frequency (seconds))
-B, --bluetooth-enable (Enable bluetooth on ioFog node)
-b, --bluetooth-disable (Disable bluetooth on ioFog node)
-W, --watchdog-enable (Enable watchdog on ioFog node)
-w, --watchdog-disable (Disable watchdog on ioFog node)
-a, --abs-hw-disable (Disable hardware abstraction on ioFog node)
-A, --abs-hw-enable (Enable hardware abstraction on ioFog node)
-o, --reboot (Reboot ioFog node)
-y, --fog-type number (ioFog node architecture type)

remove

-i, --node-id string (ioFog node ID)

info

-i, --node-id string (ioFog node ID)

provisioning-key

-i, --node-id string (ioFog node ID)

reboot

-i, --node-id string (ioFog node ID)

version

-i, --node-id string (ioFog node ID)
-v, --version-command string (ioFog version command)

hal-hw

-i, --node-id string (ioFog node ID)

hal-usb

-i, --node-id string (ioFog node ID)

JSON File Schema

name: string
location: string
latitude: number
longitude: number
description: string
dockerUrl: string
diskLimit: number
diskDirectory: string
memoryLimit: number
cpuLimit: number
logLimit: number
logDirectory: string
logFileCount: number
statusFrequency: number
changeFrequency: number
deviceScanFrequency: number
bluetoothEnabled: boolean
watchdogEnabled: boolean
abstractedHardwareEnabled: boolean
reboot: boolean
fogType: number




Catalog

$ iofog-controller catalog <command> <options>

Command List

add -- Add a new catalog item.
update -- Update existing catalog item.
remove -- Delete a catalog item.
list -- List all catalog items.
info -- Get catalog item settings.

add -u <user-id>

-f, --file string (Catalog item settings JSON file)
-n, --name string (Catalog item name)
-d, --description string (Catalog item description)
-c, --category string (Catalog item category)
-x, --x86-image string (x86 docker image name)
-a, --arm-image string (ARM docker image name)
-p, --publisher string (Catalog item publisher name)
-s, --disk-required number (Amount of disk required to run the microservice (MB))
-r, --ram-required number (Amount of RAM required to run the microservice (MB))
-t, --picture string (Catalog item picture)
-P, --public (Public catalog item)
-V, --private (Private catalog item)
-g, --registry-id number (Catalog item docker registry ID)
-I, --input-type string (Catalog item input type)
-F, --input-format string (Catalog item input format)
-O, --output-type string (Catalog item output type)
-T, --output-format string (Catalog item output format)
-X, --config-example string (Catalog item config example)

update -i <item-id>

-f, --file string (Catalog item settings JSON file)
-n, --name string (Catalog item name)
-d, --description string (Catalog item description)
-c, --category string (Catalog item category)
-x, --x86-image string (x86 docker image name)
-a, --arm-image string (ARM docker image name)
-p, --publisher string (Catalog item publisher name)
-s, --disk-required number (Amount of disk required to run the microservice (MB))
-r, --ram-required number (Amount of RAM required to run the microservice (MB))
-t, --picture string (Catalog item picture)
-P, --public (Public catalog item)
-V, --private (Private catalog item)
-g, --registry-id number (Catalog item docker registry ID)
-I, --input-type string (Catalog item input type)
-F, --input-format string (Catalog item input format)
-O, --output-type string (Catalog item output type)
-T, --output-format string (Catalog item output format)
-X, --config-example string (Catalog item config example)

remove

-i, --item-id string -- Catalog item ID

info

-i, --item-id string -- Catalog item ID

JSON File Schema

name: string
description: string
category: string
publisher: string
diskRequired: number
ramRequired: number
picture: string
isPublic: boolean
registryId: number
configExample: string
images: array of objects
containerImage: string
fogTypeId: number
inputType: object
infoType: string
infoFormat: string
outputType: object
infoType: string
infoFormat: string



Flow

$ iofog-controller flow <command> <options>

Command List

add -- Add a new flow.
update -- Update existing flow.
remove -- Delete a flow.
list -- List all flows.
info -- Get flow settings.

add -u <user-id>

-f, --file string (Application flow settings JSON file)
-n, --name string (Application flow name)
-d, --description string (Application flow description)
-a, --activate (Activate application flow)
-D, --deactivate (Deactivate application flow)

update -i <flow-id>

-f, --file string (Application flow settings JSON file)
-n, --name string (Application flow name)
-d, --description string (Application flow description)
-a, --activate (Activate application flow)
-D, --deactivate (Deactivate application flow)

remove

-i, --flow-id string -- Application flow ID

info

-i, --flow-id string -- Application flow ID

JSON File Schema

name: string
description: string
isActivated: boolean




Microservice

$ iofog-controller microservice <command> <options>

Command List

add -- Add a new microservice.
update -- Update existing microservice.
remove -- Delete a microservice.
list -- List all microservices.
info -- Get microservice settings.
route-create -- Create microservice route.

route-remove -- Remove microservice route.

port-mapping-create -- Create microservice port mapping.
port-mapping-remove -- Remove microservice port mapping.
port-mapping-list -- List microservice port mapping.

add -u <user-id>

-f, --file string (Microservice settings JSON file)
-n, --name string (Microservice name)
-c, --catalog-id string (Catalog item ID)
-F, --flow-id string (Application flow ID)
-I, --iofog-id string (ioFog node ID)
-g, --config string (Microservice config)
-v, --volumes string[] (Microservice volume mapping(s))
-l, --log-limit number (Log file size limit (MB))
-r, --root-enable (Enable root access)
-R, --root-disable (Disable root access)
-p, --ports string[] (Container ports)
-t, --routes string[] (Microservice route(s) (receiving microservices))

update -i <microservice-id>

-f, --file string (Microservice settings JSON file)
-n, --name string (Microservice name)
-I, --iofog-id string (ioFog node ID)
-g, --config string (Microservice config)
-v, --volumes string[] (Microservice volume mapping(s))
-l, --log-limit number (Log file size limit (MB))
-r, --root-enable (Enable root access)
-R, --root-disable (Disable root access)
-w, --rebuild (Rebuild microservice image on fog agent)

Example

update -i <microservice-id> -v{'hostDestination':'/var1/dest','containerDestination':'/var/dest','accessMode':'w'} -n testcli

remove

-i, --microservice-id string (Microservice ID)
-z, --cleanUp (Delete microservice with cleanup)

info

-i, --microservice-id string (Microservice ID)

route-create

-T, --route string (Microservice route (receiving microservices))

route-remove

-T, --route string (Microservice route (receiving microservices))

port-mapping-create

-i, --microservice-id string (Microservice ID)

-P, --mapping string (Container port mapping)

port-mapping-remove

-i, --microservice-id string (Microservice ID)
-b, --internal-port string (Internal port)

port-mapping-list

JSON ADD File Schema

{
"name": "string",
"config": "string",
"catalogItemId": 0,
"flowId": 0,
"ioFogNodeId": "string",
"rootHostAccess": true,
"logLimit": 0,
"volumeMappings": [
{
"hostDestination": "/var/dest",
"containerDestination": "/var/dest",
"accessMode": "rw"
}
],
"ports": [
{
"internal": 0,
"external": 0,
"publicMode": true
}
],
"routes": [
"string"
]
}

JSON UPDATE File Schema

{
"name": "string",
"config": "string",
"rebuild": true,
"ioFogNodeId": "string",
"rootHostAccess": true,
"logLimit": 0,
"volumeMappings": [
{
"hostDestination": "/var/dest",
"containerDestination": "/var/dest",
"accessMode": "rw"
}
]
}

Examples

  1. Single mapping
    $ iofog-controller microservice add [other required options] --volumes
    /host_src:/container_src

  2. Multiple mappings
    $ iofog-controller microservice add [other required options] --volumes
    /host_src:/container_src
    /host_bin:/container_bin

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

  4. Add routes (ABC:DEF - source microservice id : dest microservice id)
    $ iofog-controller microservice add [other required options] --routes
    ABC:DEF RFG:HJK

  5. Add route (ABC:DEF - source microservice id : dest microservice id)
    $ iofog-controller microservice route-create --route ABC:DEF

  6. Delete route (ABC:DEF - source microservice id : dest microservice id)
    $ iofog-controller microservice route-remove --route ABC:DEF

  7. Create port mapping (80:8080:false - internal port : external port : public mode, ABC - microservice)
    $ iofog-controller microservice port-mapping-create --mapping 80:8080:false -i ABC

  8. Delete port mapping (80 - internal port, ABC - microservice id)
    $ iofog-controller microservice port-mapping-remove --internal-port 80 -i ABC




Registry

$ iofog-controller registry <command> <options>

Command List

add -- Add a new Registry.
remove -- Delete a Registry.
list -- List all Registries.

add -i <user-id>

-u, --uri string (Registry URI)
-b, --public (Set registry as public)
-r, --private (Set registry as private)
-l, --username string (Registry's user name)
-p, --password string (Password)
-e, --email string (Email address)

remove

-d, --item-id number (Item's id)


Diagnostics

$ iofog-controller diagnostics <command> <options>

Command List

strace-update -- Change microservice strace status to enabled or disabled.
strace-info -- Get microservice strace data.
strace-ftp-post -- Post microservice strace data to ftp.
image-snapshot-create -- Create microservice image snapshot.
image-snapshot-get -- Get microservice image snapshot.

strace-update -i <microservice-id>

-e, --enable (Enable microservice strace)
-o, --disable (Disable microservice strace)

strace-info -i <microservice-id>

-f, --format string (Format of strace data to receive)

strace-ftp-post -i <microservice-id>

-h, --ftpHost string (FTP host)
-p, --ftpPort number (FTP port)
-u, --ftpUser string (FTP user)
-s, --ftpPass string (FTP user password)
-d, --ftpDestDir string (FTP destination directory)

image-snapshot-create

-i, --microservice-id string (Microservice ID)

image-snapshot-get

-i, --microservice-id string (Microservice ID)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK