swagger fixes and appname -> app_name (#294)

* swagger fixes and appname -> app_name

* Swagger errors fixed
This commit is contained in:
Travis Reeder
2016-11-15 08:13:53 -08:00
committed by GitHub
parent f1c890d8d1
commit 616112b349
5 changed files with 8 additions and 12 deletions

View File

@@ -25,7 +25,7 @@ var (
type Routes []*Route
type Route struct {
AppName string `json:"appname,omitempty"`
AppName string `json:"app_name,omitempty"`
Path string `json:"path,omitempty"`
Image string `json:"image,omitempty"`
Memory uint64 `json:"memory,omitempty"`

View File

@@ -46,7 +46,7 @@ $ curl -H "Content-Type: application/json" -X POST -d '{ "app": { "name":"myapp"
{"message":"App successfully created","app":{"name":"myapp","config":null}}
$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"iron/hello" } }' http://$IRON_FUNCTION/v1/apps/myapp/routes
{"message":"Route successfully created","route":{"appname":"myapp","path":"/hello-sync","image":"iron/hello","memory":128,"type":"sync","config":null}}
{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"iron/hello","memory":128,"type":"sync","config":null}}
$ curl -H "Content-Type: application/json" -X POST -d '{ "name":"Johnny" }' http://$IRON_FUNCTION/r/myapp/hello-sync
Hello Johnny!
@@ -126,7 +126,7 @@ $ curl -H "Content-Type: application/json" -X POST -d '{ "app": { "name":"myapp"
{"message":"App successfully created","app":{"name":"myapp","config":null}}
$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"iron/hello" } }' http://$IRON_FUNCTION/v1/apps/myapp/routes
{"message":"Route successfully created","route":{"appname":"myapp","path":"/hello-sync","image":"iron/hello","memory":128,"type":"sync","config":null}}
{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"iron/hello","memory":128,"type":"sync","config":null}}
$ curl -H "Content-Type: application/json" -X POST -d '{ "name":"Johnny" }' http://$IRON_FUNCTION/r/myapp/hello-sync
Hello Johnny!

View File

@@ -50,7 +50,7 @@ $ curl -H "Content-Type: application/json" -X POST -d '{ "app": { "name":"myapp"
{"message":"App successfully created","app":{"name":"myapp","config":null}}
$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"iron/hello" } }' http://$IRON_FUNCTION/v1/apps/myapp/routes
{"message":"Route successfully created","route":{"appname":"myapp","path":"/hello-sync","image":"iron/hello","memory":128,"type":"sync","config":null}}
{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"iron/hello","memory":128,"type":"sync","config":null}}
$ curl -H "Content-Type: application/json" -X POST -d '{ "name":"Johnny" }' http://$IRON_FUNCTION/r/myapp/hello-sync
Hello Johnny!
@@ -103,7 +103,7 @@ $ curl -H "Content-Type: application/json" -X POST -d '{ "app": { "name":"myapp"
{"message":"App successfully created","app":{"name":"myapp","config":null}}
$ curl -H "Content-Type: application/json" -X POST -d '{ "route": { "type": "sync", "path":"/hello-sync", "image":"iron/hello" } }' http://$IRON_FUNCTION/v1/apps/myapp/routes
{"message":"Route successfully created","route":{"appname":"myapp","path":"/hello-sync","image":"iron/hello","memory":128,"type":"sync","config":null}}
{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello-sync","image":"iron/hello","memory":128,"type":"sync","config":null}}
$ curl -H "Content-Type: application/json" -X POST -d '{ "name":"Johnny" }' http://$IRON_FUNCTION/r/myapp/hello-sync
Hello Johnny!

View File

@@ -5,8 +5,8 @@
swagger: '2.0'
info:
title: IronFunctions
description:
version: "0.0.14"
description: The open source serverless platform.
version: "0.1.0"
# the domain of the service
host: "127.0.0.1:8080"
# array of all schemes that your API supports
@@ -313,9 +313,6 @@ definitions:
type: array
items:
$ref: '#/definitions/Route'
cursor:
type: string
description: Used to paginate results. If this is returned, pass it into the same query again to get more results.
error:
$ref: '#/definitions/ErrorBody'
@@ -423,7 +420,6 @@ definitions:
type: object
required:
- image
- priority
properties:
image:
type: string

View File

@@ -51,7 +51,7 @@ $ vagrant ssh
$ curl -H "Content-Type: application/json" -X POST -d '{"app": { "name":"myapp" }}' http://localhost:8080/v1/apps
{"message":"App successfully created","app":{"name":"myapp","config":null}}
$ curl -H "Content-Type: application/json" -X POST -d '{"route": {"path":"/hello","image":"iron/hello"}}' http://localhost:8080/v1/apps/myapp/routes
{"message":"Route successfully created","route":{"appname":"myapp","path":"/hello","image":"iron/hello","memory":128,"type":"sync","config":null}}
{"message":"Route successfully created","route":{"app_name":"myapp","path":"/hello","image":"iron/hello","memory":128,"type":"sync","config":null}}
```
## Start a Nova compute instance inside OpenStack