Estimated Reading Time: 2 minutes|Last Updated: 11/19/2021, 7:57:43 AM

# Create Upstream

# usage

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

  1. create 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
  1. create a http upstream.
# oredge upstream create --http 892 --name testa --node '{"ip":"192.168.1.1", "port":80}'
ID: 892-1729