From 1e15b72bfccd9d95b3807c867b77ab15c320e476 Mon Sep 17 00:00:00 2001 From: Carlos C Date: Wed, 30 Nov 2016 19:53:28 +0100 Subject: [PATCH] api: remove app_name duplication of route related calls --- docs/swagger.yml | 6 +----- fn/publish.go | 11 +++++------ fn/routes.go | 7 +++---- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/docs/swagger.yml b/docs/swagger.yml index 28639f52..3b1eed9d 100644 --- a/docs/swagger.yml +++ b/docs/swagger.yml @@ -6,7 +6,7 @@ swagger: '2.0' info: title: IronFunctions description: The open source serverless platform. - version: "0.1.20" + version: "0.1.22" # the domain of the service host: "127.0.0.1:8080" # array of all schemes that your API supports @@ -309,10 +309,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 diff --git a/fn/publish.go b/fn/publish.go index 897be178..da99587d 100644 --- a/fn/publish.go +++ b/fn/publish.go @@ -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), }, } diff --git a/fn/routes.go b/fn/routes.go index c38ae07f..175249dc 100644 --- a/fn/routes.go +++ b/fn/routes.go @@ -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"), @@ -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") @@ -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 } @@ -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 }