forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_route_command.go
28 lines (23 loc) · 1.54 KB
/
create_route_command.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package v2
import (
"os"
"code.cloudfoundry.org/cli/cf/cmd"
"code.cloudfoundry.org/cli/command"
"code.cloudfoundry.org/cli/command/flag"
)
type CreateRouteCommand struct {
RequiredArgs flag.SpaceDomain `positional-args:"yes"`
Hostname string `long:"hostname" short:"n" description:"Hostname for the HTTP route (required for shared domains)"`
Path string `long:"path" description:"Path for the HTTP route"`
Port int `long:"port" description:"Port for the TCP route"`
RandomPort bool `long:"random-port" description:"Create a random port for the TCP route"`
usage interface{} `usage:"Create an HTTP route:\n CF_NAME create-route SPACE DOMAIN [--hostname HOSTNAME] [--path PATH]\n\n Create a TCP route:\n CF_NAME create-route SPACE DOMAIN (--port PORT | --random-port)\n\nEXAMPLES:\n CF_NAME create-route my-space example.com # example.com\n CF_NAME create-route my-space example.com --hostname myapp # myapp.example.com\n CF_NAME create-route my-space example.com --hostname myapp --path foo # myapp.example.com/foo\n CF_NAME create-route my-space example.com --port 5000 # example.com:5000"`
relatedCommands interface{} `related_commands:"check-route, domains, map-route"`
}
func (_ CreateRouteCommand) Setup(config command.Config, ui command.UI) error {
return nil
}
func (_ CreateRouteCommand) Execute(args []string) error {
cmd.Main(os.Getenv("CF_TRACE"), os.Args)
return nil
}