From 0fd614074f304ccda0fac75db2b6b1b75aea422c Mon Sep 17 00:00:00 2001 From: Tamara Boehm Date: Tue, 24 Mar 2026 10:48:02 +0100 Subject: [PATCH] add examples for hash-based routing --- command/v7/map_route_command.go | 7 ++++--- command/v7/update_route_command.go | 10 ++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/command/v7/map_route_command.go b/command/v7/map_route_command.go index 1c572ed933f..191fcc3d12b 100644 --- a/command/v7/map_route_command.go +++ b/command/v7/map_route_command.go @@ -2,8 +2,8 @@ package v7 import ( "code.cloudfoundry.org/cli/v8/actor/actionerror" - "code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccversion" - "code.cloudfoundry.org/cli/v8/command" + "code.cloudfoundry.org/cli/v8/api/cloudcontroller/ccversion" + "code.cloudfoundry.org/cli/v8/command" "code.cloudfoundry.org/cli/v8/command/flag" "code.cloudfoundry.org/cli/v8/resources" ) @@ -33,9 +33,10 @@ func (cmd MapRouteCommand) Examples() string { return ` CF_NAME map-route my-app example.com # example.com CF_NAME map-route my-app example.com --hostname myhost # myhost.example.com -CF_NAME map-route my-app example.com --hostname myhost -o loadbalancing=least-connection # myhost.example.com with a per-route option CF_NAME map-route my-app example.com --hostname myhost --path foo # myhost.example.com/foo CF_NAME map-route my-app example.com --hostname myhost --app-protocol http2 # myhost.example.com +CF_NAME map-route my-app example.com --hostname myhost -o loadbalancing=least-connection # myhost.example.com with a per-route option +CF_NAME map-route my-app example.com -o loadbalancing=hash -o hash_header=My-Hash-Header # use hash-based routing for example.com CF_NAME map-route my-app example.com --port 5000 # example.com:5000` } diff --git a/command/v7/update_route_command.go b/command/v7/update_route_command.go index 1107f647a4d..50b00140e0a 100644 --- a/command/v7/update_route_command.go +++ b/command/v7/update_route_command.go @@ -29,10 +29,12 @@ Update an existing HTTP route: func (cmd UpdateRouteCommand) Examples() string { return ` -CF_NAME update-route example.com -o loadbalancing=round-robin, -CF_NAME update-route example.com -o loadbalancing=least-connection, -CF_NAME update-route example.com -r loadbalancing, -CF_NAME update-route example.com --hostname myhost --path foo -o loadbalancing=round-robin` +CF_NAME update-route example.com -o loadbalancing=round-robin # use round-robin load balancing for route +CF_NAME update-route example.com -o loadbalancing=least-connection # use least-connection load balancing for route +CF_NAME update-route example.com -o loadbalancing=hash -o hash_header=My-Hash-Header # use hash-based load balancing for route +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 +CF_NAME update-route example.com -r loadbalancing # remove load balancing option +CF_NAME update-route example.com --hostname myhost --path foo -o loadbalancing=round-robin # update route myhost.example.com/foo` } func (cmd UpdateRouteCommand) Execute(args []string) error { err := cmd.SharedActor.CheckTarget(true, true)