Skip to content

Commit 0fd6140

Browse files
committed
add examples for hash-based routing
1 parent 8da618e commit 0fd6140

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

command/v7/map_route_command.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package v7
22

33
import (
44
"code.cloudfoundry.org/cli/v8/actor/actionerror"
5-
"code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccversion"
6-
"code.cloudfoundry.org/cli/v8/command"
5+
"code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccversion"
6+
"code.cloudfoundry.org/cli/v8/command"
77
"code.cloudfoundry.org/cli/v8/command/flag"
88
"code.cloudfoundry.org/cli/v8/resources"
99
)
@@ -33,9 +33,10 @@ func (cmd MapRouteCommand) Examples() string {
3333
return `
3434
CF_NAME map-route my-app example.com # example.com
3535
CF_NAME map-route my-app example.com --hostname myhost # myhost.example.com
36-
CF_NAME map-route my-app example.com --hostname myhost -o loadbalancing=least-connection # myhost.example.com with a per-route option
3736
CF_NAME map-route my-app example.com --hostname myhost --path foo # myhost.example.com/foo
3837
CF_NAME map-route my-app example.com --hostname myhost --app-protocol http2 # myhost.example.com
38+
CF_NAME map-route my-app example.com --hostname myhost -o loadbalancing=least-connection # myhost.example.com with a per-route option
39+
CF_NAME map-route my-app example.com -o loadbalancing=hash -o hash_header=My-Hash-Header # use hash-based routing for example.com
3940
CF_NAME map-route my-app example.com --port 5000 # example.com:5000`
4041
}
4142

command/v7/update_route_command.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ Update an existing HTTP route:
2929

3030
func (cmd UpdateRouteCommand) Examples() string {
3131
return `
32-
CF_NAME update-route example.com -o loadbalancing=round-robin,
33-
CF_NAME update-route example.com -o loadbalancing=least-connection,
34-
CF_NAME update-route example.com -r loadbalancing,
35-
CF_NAME update-route example.com --hostname myhost --path foo -o loadbalancing=round-robin`
32+
CF_NAME update-route example.com -o loadbalancing=round-robin # use round-robin load balancing for route
33+
CF_NAME update-route example.com -o loadbalancing=least-connection # use least-connection load balancing for route
34+
CF_NAME update-route example.com -o loadbalancing=hash -o hash_header=My-Hash-Header # use hash-based load balancing for route
35+
CF_NAME update-route example.com -o loadbalancing=hash -o hash_header=My-Hash-Header -o hash_balance=1.3 # use hash-based load balancing with balance factor
36+
CF_NAME update-route example.com -r loadbalancing # remove load balancing option
37+
CF_NAME update-route example.com --hostname myhost --path foo -o loadbalancing=round-robin # update route myhost.example.com/foo`
3638
}
3739
func (cmd UpdateRouteCommand) Execute(args []string) error {
3840
err := cmd.SharedActor.CheckTarget(true, true)

0 commit comments

Comments
 (0)