Skip to content

Commit de0492b

Browse files
committed
feat: add examples for hash-based routing
1 parent e9f81cd commit de0492b

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

command/v7/map_route_command.go

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

33
import (
44
"code.cloudfoundry.org/cli/v9/actor/actionerror"
5-
"code.cloudfoundry.org/cli/v9/api/cloudcontroller/ccversion"
6-
"code.cloudfoundry.org/cli/v9/command"
5+
"code.cloudfoundry.org/cli/v9/api/cloudcontroller/ccversion"
6+
"code.cloudfoundry.org/cli/v9/command"
77
"code.cloudfoundry.org/cli/v9/command/flag"
8-
"code.cloudfoundry.org/cli/v9/resources"
8+
"code.cloudfoundry.org/cli/v9/resources"
99
)
1010

1111
type MapRouteCommand struct {
@@ -34,10 +34,11 @@ func (cmd MapRouteCommand) Examples() string {
3434
return `
3535
CF_NAME map-route my-app example.com # example.com
3636
CF_NAME map-route my-app example.com --hostname myhost # myhost.example.com
37-
CF_NAME map-route my-app example.com --hostname myhost -o loadbalancing=least-connection # myhost.example.com with a per-route option
3837
CF_NAME map-route my-app example.com --hostname myhost --path foo # myhost.example.com/foo
3938
CF_NAME map-route my-app example.com --hostname myhost --app-protocol http2 # myhost.example.com
4039
CF_NAME map-route my-app example.com --hostname myhost --app-port 8090 # myhost.example.com
40+
CF_NAME map-route my-app example.com --hostname myhost -o loadbalancing=least-connection # myhost.example.com with a per-route option
41+
CF_NAME map-route my-app example.com -o loadbalancing=hash -o hash_header=My-Hash-Header # use hash-based routing for example.com
4142
CF_NAME map-route my-app example.com --port 5000 # example.com:5000`
4243
}
4344

command/v7/update_route_command.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@ 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
38+
`
3639
}
3740
func (cmd UpdateRouteCommand) Execute(args []string) error {
3841
err := cmd.SharedActor.CheckTarget(true, true)

0 commit comments

Comments
 (0)