Update with invoke URLs and new website.

This commit is contained in:
Alex Ellis
2017-08-25 10:25:41 +01:00
committed by GitHub
parent 9639bc732b
commit 1286e34a11

View File

@ -1,25 +1,25 @@
swagger: "2.0" swagger: '2.0'
info: info:
description: "FaaS API documentation" description: FaaS API documentation
version: "0.5.4" version: 0.5.4
title: "FaaS API Gateway" title: FaaS API Gateway
license: license:
name: "MIT" name: MIT
basePath: "/" basePath: /
schemes: schemes:
- "http" - http
paths: paths:
/system/functions: /system/functions:
get: get:
summary: "Get a list of deployed functions with: stats and image digest" summary: 'Get a list of deployed functions with: stats and image digest'
description: "" description: ''
consumes: consumes:
- "application/json" - application/json
produces: produces:
- "application/json" - application/json
responses: responses:
200: '200':
description: "List of deployed functions." description: List of deployed functions.
examples: examples:
application/json: |- application/json: |-
[ [
@ -27,53 +27,53 @@ paths:
{"name":"func_fanclub","image":"alexellis2/fanclub:18-04-2017@sha256:37bb3fabee7e36abab7e6250bb7d13c9ab66e983782b35200470fe2a3aa14daa","invocationCount":1125,"replicas":1} {"name":"func_fanclub","image":"alexellis2/fanclub:18-04-2017@sha256:37bb3fabee7e36abab7e6250bb7d13c9ab66e983782b35200470fe2a3aa14daa","invocationCount":1125,"replicas":1}
] ]
post: post:
summary: "Deploy a new function." summary: Deploy a new function.
description: "" description: ''
consumes: consumes:
- "application/json" - application/json
produces: produces:
- "application/json" - application/json
parameters: parameters:
- in: "body" - in: body
name: "body" name: body
description: "Function to deploy" description: Function to deploy
required: true required: true
schema: schema:
$ref: "#/definitions/CreateFunctionRequest" $ref: '#/definitions/CreateFunctionRequest'
responses: responses:
200: '200':
description: "OK" description: OK
delete: delete:
summary: "Remove a deployed function." summary: Remove a deployed function.
description: "" description: ''
consumes: consumes:
- "application/json" - application/json
produces: produces:
- "application/json" - application/json
parameters: parameters:
- in: "body" - in: body
name: "body" name: body
description: "Function to delete" description: Function to delete
required: true required: true
schema: schema:
$ref: "#/definitions/DeleteFunctionRequest" $ref: '#/definitions/DeleteFunctionRequest'
responses: responses:
200: '200':
description: "OK" description: OK
404: '404':
description: "Function not found in gateway" description: Function not found in gateway
/system/alert: /system/alert:
post: post:
summary: "Event-sink for AlertManager, for auto-scaling" summary: 'Event-sink for AlertManager, for auto-scaling'
description: "Internal use for AlertManager, requires valid AlertManager alert JSON" description: 'Internal use for AlertManager, requires valid AlertManager alert JSON'
consumes: consumes:
- "application/json" - application/json
produces: produces:
- "application/json" - application/json
parameters: parameters:
- in: "body" - in: body
name: "body" name: body
description: "Function to delete" description: Function to delete
schema: schema:
type: object type: object
example: |- example: |-
@ -124,41 +124,74 @@ paths:
"groupKey": 18195285354214864953 "groupKey": 18195285354214864953
} }
responses: responses:
200: '200':
description: "Alert handled successfully" description: Alert handled successfully
500: '500':
description: "Internal error with swarm or request JSON invalid" description: Internal error with swarm or request JSON invalid
/async-function/{functionName}:
post:
summary: 'Invoke a function asynchronously in OpenFaaS - coming in PR 131'
parameters:
- in: path
name: functionName
description: Function name
type: string
required: true
responses:
'202':
description: Request accepted and queued
'500':
description: Internal server or queue error
'404':
description: Requested function not found
/function/{functionName}:
post:
summary: 'Invoke a function defined in OpenFaaS'
parameters:
- in: path
name: functionName
description: Function name
type: string
required: true
responses:
'200':
description: Value returned from function
'500':
description: Error connecting to function
'404':
description: Function not found
definitions: definitions:
DeleteFunctionRequest: DeleteFunctionRequest:
type: "object" type: object
properties: properties:
functionName: functionName:
type: "string" type: string
description: "Name of deployed function" description: Name of deployed function
CreateFunctionRequest: CreateFunctionRequest:
type: "object" type: object
properties: properties:
service: service:
type: "string" type: string
description: "Name of deployed function" description: Name of deployed function
network: network:
type: "string" type: string
description: "Docker swarm network, usually func_functions" description: 'Docker swarm network, usually func_functions'
image: image:
type: "string" type: string
description: "Docker image in accessible registry" description: Docker image in accessible registry
envProcess: envProcess:
type: "string" type: string
description: "Process for watchdog to fork" description: Process for watchdog to fork
envVars: envVars:
type: "array" type: array
items: items:
type: "string" type: string
description: "Overrides to environmental variables" description: Overrides to environmental variables
registryAuth: registryAuth:
type: "string" type: string
description: "Private registry base64-encoded basic auth (as present in ~/.docker/config.json)" description: >-
Private registry base64-encoded basic auth (as present in
~/.docker/config.json)
externalDocs: externalDocs:
description: "More documentation available on Github" description: More documentation available on Github
url: "http://docs.get-faas.com" url: 'https://github.com/alexellis/faas'