Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

api: remove app_name duplication of route related calls #370

Merged
merged 2 commits into from
Dec 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions docs/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ swagger: '2.0'
info:
title: IronFunctions
description: The open source serverless platform.
version: "0.1.21"
version: "0.1.22"
# the domain of the service
host: "127.0.0.1:8080"
# array of all schemes that your API supports
Expand Down Expand Up @@ -319,10 +319,6 @@ definitions:
allOf:
- type: object
properties:
app_name:
type: string
description: "App this route belongs to."
readOnly: true
path:
type: string
description: URL path that will be matched to this route
Expand Down
11 changes: 5 additions & 6 deletions fn/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,11 @@ func (p *publishcmd) route(path string, ff *funcfile) error {

body := functions.RouteWrapper{
Route: functions.Route{
Path: *ff.Route,
Image: ff.FullName(),
AppName: *ff.App,
Memory: *ff.Memory,
Type_: *ff.Type,
Config: expandEnvConfig(ff.Config),
Path: *ff.Route,
Image: ff.FullName(),
Memory: *ff.Memory,
Type_: *ff.Type,
Config: expandEnvConfig(ff.Config),
},
}

Expand Down
7 changes: 3 additions & 4 deletions fn/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ func (a *routesCmd) create(c *cli.Context) error {

body := functions.RouteWrapper{
Route: functions.Route{
AppName: appName,
Path: route,
Image: image,
Memory: c.Int64("memory"),
Expand Down Expand Up @@ -367,7 +366,7 @@ func (a *routesCmd) configList(c *cli.Context) error {
fmt.Print("export ", k, "=", v, "\n")
}
} else {
fmt.Println(wrapper.Route.AppName, wrapper.Route.Path, "configuration:")
fmt.Println(appName, wrapper.Route.Path, "configuration:")
w := tabwriter.NewWriter(os.Stdout, 0, 8, 1, ' ', 0)
for k, v := range config {
fmt.Fprint(w, k, ":\t", v, "\n")
Expand Down Expand Up @@ -413,7 +412,7 @@ func (a *routesCmd) configSet(c *cli.Context) error {
return fmt.Errorf("error updating route configuration: %v", err)
}

fmt.Println(wrapper.Route.AppName, wrapper.Route.Path, "updated", key, "with", value)
fmt.Println(appName, wrapper.Route.Path, "updated", key, "with", value)
return nil
}

Expand Down Expand Up @@ -456,6 +455,6 @@ func (a *routesCmd) configUnset(c *cli.Context) error {
return fmt.Errorf("error updating route configuration: %v", err)
}

fmt.Println(wrapper.Route.AppName, wrapper.Route.Path, "removed", key)
fmt.Println(appName, wrapper.Route.Path, "removed", key)
return nil
}