Estimated Reading time: 4 minutes
|
Last modified: 2021-12-31, 11:27:28 amupstream
Usage: oredge upstream ACTION [OPTIONS]
ACTION:
create
list
show
modify
delete
GLOBAL OPTIONS:
--help
--show-api print restful api request.
--json print json format.
--config specify config file, default is ~/.oredge/config.
Create upstream
Usage: oredge upstream create [OPTIONS]
OPTIONS:
--global create a global upstream.
--http integer create a http upstream, http application id.
--sni-proxy integer create a sni proxy upstream, sni proxy id.
--tcp integer create a tcp proxy upstream. tcp id.
--checker json checker.
always_check bool always check.
report_interval integer report interval.
report_interval_unit string min, sec, hour.
timeout integer timeout.
timeout_unit string timeout unit.
type string tcp or http.
--disable-ssl-verify bool disable ssl verify.
--enable-checker bool enable checker.
--is-k8s-service bool is k8s service.
--k8s integer k8s id.
--k8s-namespace string k8s namespace.
--k8s-service string k8s service.
--k8s-service-port integer k8s service port.
--name string name.
--node json node, can add multiple times, a json string of node infos.
netns string netns.
port integer port.
weight integer weight.
status integer status.
use_proxy_host bool use proxy host.
ip string ip.
domain string domain.
name string name.
--gid integer user group id, can add multiple times.
GLOBAL OPTIONS:
--help
--show-api print restful api request.
--json print json format.
--config specify config file, default is ~/.oredge/config.
Example
Create a global upstream
# oredge upstream create --global --name wangyao --node '{"netns":"","port":80,"weight":1,"status":1,"name":"","use_proxy_host":false,"ip":"10.1.1.1","domain":null}'
ID: 18
Create a HTTP upstream
# oredge upstream create --http 892 --name testa --node '{"ip":"192.168.1.1", "port":80}'
ID: 892-1729
List upstreams
Usage: oredge upstream list [OPTIONS]
OPTIONS:
--page integer page, 1(default).
--page-size integer page size, 20(default).
--global list a global upstream, no argument.
--http integer list a http application upstream, http application id.
--sni-proxy integer list a sni-proxy application upstream, sni-proxy id.
--tcp integer list a tcp application upstream, tcp id.
GLOBAL OPTIONS:
--help
--show-api print restful api request.
--json print json format.
--config specify config file, default is ~/.oredge/config.
Example
List global upstreams
# oredge upstream list --global
ID NAME CREATOR DISABLE SSL VERIFY CREATE TIME MODIFY TIME
14 test 1 true 2021-05-18 05:20:12 2021-05-18 06:52:59
18 test1 1 true 2021-05-25 03:58:54 2021-05-25 03:58:54
List HTTP upstreams
# bin/oredge upstream list --http 892
ID NAME CREATOR DISABLE SSL VERIFY CREATE TIME MODIFY TIME
892-1729 testa 2 true 2021-07-15 06:49:38 2021-07-15 06:49:38
Get upstream’s details
Usage: oredge upstream show [id] [OPTIONS]
OPTIONS:
--id integer id.
--global show a global upstream, no argument.
--http show a http upstream, no argument.
--tcp show a tcp upstream, no argument.
--sni-proxy show a sni-proxy upstream, no argument.
GLOBAL OPTIONS:
--help
--show-api print restful api request.
--json print json format.
--config specify config file, default is ~/.oredge/config.
Example
Get details of a global upstream
# ./oredge upstream show 14 --global
ID : 14
NAME : test
CREATOR : 1
DISABLE SSL VERIFY: false
CREATE TIME : 2021-05-18 05:20:12
MODIFY TIME : 2021-05-18 06:52:59
Get details of a HTTP upstream
# oredge upstream show 892-1729 --http
ID : 1729
NAME : testa
CREATOR : 2
DISABLE SSL VERIFY: false
CREATE TIME : 2021-07-15 06:49:38
MODIFY TIME : 2021-07-15 06:49:38
Modify upstream
Usage: oredge upstream modify [id] [OPTIONS]
OPTIONS:
--id id.
--global modify a global upstream, no argument.
--tcp modify a tcp upstream, no argument.
--sni-proxy modify a sni-proxy upstream, no argument.
--http modify a http upstream, no argument.
--checker json checker.
always_check bool always check.
report_interval integer report interval.
report_interval_unit string min, sec, hour.
timeout integer timeout.
timeout_unit string timeout unit.
type string tcp or http.
--disable-ssl-verify bool disable ssl verify.
--enable-checker bool enable checker.
--is-k8s-service bool is k8s service.
--k8s integer k8s id.
--k8s-namespace string k8s namespace.
--k8s-service string k8s service.
--k8s-service-port integer k8s service port.
--name string name.
--node json node, can add multiple times, a json string of node infos.
netns string netns.
port integer port.
weight integer weight.
status integer status.
use_proxy_host bool use proxy host.
ip string ip.
domain string domain.
name string name.
--gid integer user group id, can add multiple times.
GLOBAL OPTIONS:
--help
--show-api print restful api request.
--json print json format.
--config specify config file, default is ~/.oredge/config.
Example
Modify a global upstream
# oredge upstream modify 21 --name test --global
OK
Modify a HTTP upstream
# oredge upstream modify 892-1729 --http --name test
OK
Delete upstream
Usage: oredge upstream delete [id] [OPTIONS]
OPTIONS:
--id integer upstream id.
--global delete a global upstream, no argument.
--http delete a http application upstream, no argument.
--sni-proxy delete a sni-proxy application upstream, no argument.
--tcp delete a tcp application upstream, no argument.
GLOBAL OPTIONS:
--help
--show-api print restful api request.
--json print json format.
--config specify config file, default is ~/.oredge/config.
Example
Delete a global upstream
# oredge upstream delete 21 --global
OK
Delete a HTTP upstream
# oredge upstream delete 892-1729 --http
OK