lua-extension

Usage: oredge lua-extension ACTION [OPTIONS]

ACTION:
    create
    list
    show
    execute
    modify
    delete
    help

GLOBAL OPTIONS:
    --help
    --show-api                         print restful api request.
    --json                             print json format.
    --config                           specify config file, default is ~/.oredge/config.

Create Lua-extension

Usage: oredge lua-extension create [OPTIONS]

OPTIONS:
    --name string                      name.
    --code string                      code.
    --trigger-type string              cron(default) or event.
    --interval integer                 30(default).
    --event-type string                node_offline, node_online, release.

GLOBAL OPTIONS:
    --help
    --show-api                         print restful api request.
    --json                             print json format.
    --config                           specify config file, default is ~/.oredge/config.

Example

  1. create lua extension with trigger type event.

    # oredge lua-extension create --name test --code "a=1" --event-type node_offline --trigger-type event
    ID: 1
    
  2. create lua extension with trigger type corn.

    # oredge lua-extension create --name test --code "a=1" --interval 30
    ID: 1
    

List Lua-extension

Usage: oredge lua-extension list [OPTIONS]

OPTIONS:
    --page integer                     page, 1(default).
    --page-size integer                page size, 20(default).

GLOBAL OPTIONS:
    --help
    --show-api                         print restful api request.
    --json                             print json format.
    --config                           specify config file, default is ~/.oredge/config.

Example

# oredge lua-extension list
ID    NAME      CREATE TIME            MODIFY TIME
1     test      2021-06-01 00:42:30    2021-06-02 02:59:26

Show Lua-extension

Usage: oredge lua-extension show [id] [OPTIONS]

OPTIONS:
    --id integer                       id.

GLOBAL OPTIONS:
    --help
    --show-api                         print restful api request.
    --json                             print json format.
    --config                           specify config file, default is ~/.oredge/config.

Example

# oredge lua-extension show 1
ID         : 1
NAME       : test
CREATE TIME: 2021-06-01 00:42:30
MODIFY TIME: 2021-06-02 03:03:26
CODE       : local a = ""

Execute Lua-extension

Usage: oredge lua-extension execute [id] [OPTIONS]

OPTIONS:
    --id integer                       id.

GLOBAL OPTIONS:
    --help
    --show-api                         print restful api request.
    --json                             print json format.
    --config                           specify config file, default is ~/.oredge/config.

Example

# oredge lua-extension execute 1
OK

Modify Lua-extension

Usage: oredge lua-extension modify [id] [OPTIONS]

OPTIONS:
    --id integer                       id.
    --name string                      name.
    --code string                      code.
    --trigger-type string              cron(default) or event.
    --interval integer                 30(default).
    --event-type string                node_offline, node_online, release.

GLOBAL OPTIONS:
    --help
    --show-api                         print restful api request.
    --json                             print json format.
    --config                           specify config file, default is ~/.oredge/config.

Example

# oredge lua-extension modify 1 --name test --trigger-type event --event-type node_offline
OK

Delete Lua-extension

Usage: oredge lua-extension delete [id] [OPTIONS]

OPTIONS:
    --id integer                       id.

GLOBAL OPTIONS:
    --help
    --show-api                         print restful api request.
    --json                             print json format.
    --config                           specify config file, default is ~/.oredge/config.

Example

# oredge lua-extension delete 1
OK