Overview

Config

The default config file is ~/.oredge/config.

[admin]
host=domain.of.your.admin
port=443
verify_ssl=true
api_token=xxxxxxxxxxxxxxxxxxxxxx

Usage

oredge help will print the usage of the command.

Usage: oredge RESOURCE ACTION [OPTIONS]

RESOURCE:
    app
    cache
    http-proxy
    sock5-proxy
    upstream
    k8s
    gateway
    dns
    page-rule
    global-rule
    dns-record
    cert
    global-cert
    http-proxy-auth
    txlog
    port
    test
    partition
    user
    user-group
    webhook
    waf
    lua-module
    lua-extension
    layer-policy
    acme-provider
    app-ip-list
    global-ip-list
    dymetrics
    node
    help

ACTION:
    list                               list resource.
    show                               show resource detail.
    create                             create resource.
    delete                             delete resource.
    modify                             modify resource.
    purge(for cache purge only)
    help

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

You can print help in RESOURCE context like this:

# oredge app help
Usage: oredge app ACTION [OPTIONS]

ACTION:
    list
    show
    create
    modify
    delete
    help

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

Under each RESOURCE, you can also print help for each ACTION context.

#oredge app list help
Usage: oredge app list [OPTIONS]

OPTIONS:
    --type string                      http(default) or stream.
    --page integer                     1(default).
    --page-size integer                20(default).

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

Specify config file

Use --config to specify the config file other than ~/.oredge/config.

# oredge app list --config=./config
ID     TYPE    DOMAINS                    PARTITIONS    LABEL               MODIFY TIME            CREATE TIME
788    http    test-3.com                 1                                 2021-05-06 20:52:01    2021-04-25 07:21:36
786    http    edge-test.com              1                                 2021-04-25 07:31:28    2021-04-22 09:35:05
785    http    test-delete-app.com        1                                 2021-04-21 06:31:16    2021-04-21 06:31:16
782    http    test-split.com             1                                 2021-04-12 02:25:29    2021-04-12 02:25:29
781    http    demo-test.com              1                                 2021-04-10 21:44:38    2021-04-10 21:44:13
780    http    new-app-test.com           1             Test add new app    2021-05-06 20:43:42    2021-04-09 05:00:58

Use --show-api to print restful API requests the command line use.

# oredge app list --type=stream --page=2 --page-size=10 --show-api
> GET /admin-api/applications?page_size=10&force=true&detail=1&type=stream&start_time=0&partition_id=&page=2&end_time=0 HTTP/1.1
> Host: admin-dev.openresty.com
> User-Agent: libwww-perl/6.53
> Content-Length: 0
> API-token: ***
>

ID    TYPE    DOMAINS       PARTITIONS    LABEL    MODIFY TIME            CREATE TIME
25    tcp                   1                      2021-02-25 21:32:17    2021-02-25 21:32:17
24    tls     Rxyngv.com    1                      2021-02-25 21:31:50    2021-02-25 21:31:50
23    tcp                   1                      2021-02-24 02:43:37    2021-02-24 02:43:14
18    tcp                   1                      2020-11-02 02:18:03    2020-11-02 02:18:03
17    tls     a.test.com    1                      2020-10-14 22:42:33    2020-10-14 22:42:33
16    tcp                   1                      2020-09-16 12:33:14    2020-09-16 12:33:14
11    tls     test01.com    1                      2020-09-10 06:13:38    2020-09-10 06:13:38
2     tls     BKAkoK.com    1                      2020-09-01 07:15:19    2020-09-01 07:15:19
1     tls     c.com         1                      2021-03-22 02:12:53    2020-07-12 23:51:15