layer-policy

Usage: oredge layer-policy ACTION [OPTIONS]

ACTION:
    create
    list
    show
    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 Layer-policy

Usage: oredge layer-policy create [OPTIONS]

OPTIONS:
    --name string                      name.
    --rule json                        rule.
        gateway integer                gateway.
        upstream integer               upstream.
        backup integer                 backup.

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

Example

# oredge layer-policy create --name test --rule '{"gateway":1, "upstream":2}'
ID: 1

List layer policy

Usage: oredge layer-policy 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 layer-policy list
ID    NAME       CREATE TIME            MODIFY TIME
3     test       2021-06-01 02:40:39    2021-06-01 02:40:39
7     aaa        2021-06-01 06:29:31    2021-06-01 06:29:31

Show Layer policy

Usage: oredge layer-policy 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 layer-policy show 3
ID         : 3
NAME       : test
CREATE TIME: 2021-06-01 02:40:39
MODIFY TIME: 2021-06-01 02:40:39

Modify Layer policy

Usage: oredge layer-policy modify [id] [OPTIONS]

OPTIONS:
    --id integer                       id.
    --name string                      name.
    --rule json                        rule.
        gateway integer                gateway.
        upstream integer               upstream.
        backup integer                 backup.

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

Example

# oredge layer-policy modify 3 --rule '{"gateway":1, "upstream":2}'
OK

Delete Layer-policy

Usage: oredge layer-policy 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 layer-policy delete 21
OK