Adjusted Swagger.yaml accordingly to feedback

Signed-off-by: Simon Pelczer <templum.dev@gmail.com>
This commit is contained in:
Simon Pelczer 2018-06-07 20:44:22 +02:00 committed by Alex Ellis
parent f674211ee8
commit 4963f39e87

View File

@ -44,7 +44,7 @@ paths:
'400': '400':
description: Bad Request description: Bad Request
'500': '500':
description: Internal server error description: Internal Server Error
put: put:
summary: Update a function. summary: Update a function.
description: '' description: ''
@ -67,7 +67,7 @@ paths:
'404': '404':
description: Not Found description: Not Found
'500': '500':
description: Internal server error description: Internal Server Error
delete: delete:
summary: Remove a deployed function. summary: Remove a deployed function.
description: '' description: ''
@ -90,7 +90,7 @@ paths:
'404': '404':
description: Not Found description: Not Found
'500': '500':
description: Internal server error description: Internal Server Error
'/system/alert': '/system/alert':
post: post:
summary: 'Event-sink for AlertManager, for auto-scaling' summary: 'Event-sink for AlertManager, for auto-scaling'
@ -183,7 +183,7 @@ paths:
'404': '404':
description: Not Found description: Not Found
'500': '500':
description: Internal server error description: Internal Server Error
'/function/{functionName}': '/function/{functionName}':
post: post:
summary: Invoke a function defined in OpenFaaS summary: Invoke a function defined in OpenFaaS
@ -253,7 +253,7 @@ paths:
'404': '404':
description: Not Found description: Not Found
'500': '500':
description: Internal server error description: Internal Server Error
'/system/info': '/system/info':
get: get:
summary: Get info such as provider version number and provider orchestrator summary: Get info such as provider version number and provider orchestrator
@ -262,15 +262,12 @@ paths:
responses: responses:
'200': '200':
description: Info result description: Info result
examples:
application/json: |-
{"provider":"faas-swarm","version":{"sha":"7108418d9dd6b329ddff40e7393b3166f8160a88","release":"0.2.6"},"orchestration":"swarm"}
schema: schema:
$ref: '#/definitions/Info' $ref: '#/definitions/Info'
'404': '404':
description: Endpoint Info not supported description: Provider does not support info endpoint
'500': '500':
description: Internal server error description: Internal Server Error
'/healthz': '/healthz':
get: get:
summary: Healthcheck summary: Healthcheck
@ -279,22 +276,31 @@ paths:
description: Healthy description: Healthy
'500': '500':
description: Not healthy description: Not healthy
securityDefinitions:
basicAuth:
type: basic
definitions: definitions:
Info: Info:
type: object type: object
properties: properties:
provider: provider:
type: string type: string
description: The OpenFaaS Provider
example: faas-swarm
version: version:
type: object type: object
description: Version of the OpenFaaS Provider
properties: properties:
sha: sha:
type: string type: string
example: 7108418d9dd6b329ddff40e7393b3166f8160a88
release: release:
type: string type: string
format: semver format: semver
example: 0.2.6
orchestration: orchestration:
type: string type: string
example: swarm
required: required:
- provider - provider
- version - version
@ -305,6 +311,7 @@ definitions:
functionName: functionName:
type: string type: string
description: Name of deployed function description: Name of deployed function
example: nodeinfo
required: required:
- functionName - functionName
FunctionDefintion: FunctionDefintion:
@ -313,15 +320,19 @@ definitions:
service: service:
type: string type: string
description: Name of deployed function description: Name of deployed function
example: nodeinfo
network: network:
type: string type: string
description: 'Docker swarm network, usually func_functions' description: Docker swarm network, usually func_functions
example: func_functions
image: image:
type: string type: string
description: Docker image in accessible registry description: Docker image in accessible registry
example: functions/nodeinfo:latest
envProcess: envProcess:
type: string type: string
description: Process for watchdog to fork description: Process for watchdog to fork
example: node main.js
envVars: envVars:
type: object type: object
additionalProperties: additionalProperties:
@ -331,27 +342,30 @@ definitions:
type: array type: array
items: items:
type: string type: string
description: Constraints are specific to back-end orchestration platform description: Constraints are specific to OpenFaaS Provider
example: "node.platform.os == linux"
labels: labels:
type: array
items:
type: string type: string
items:
type: array
description: An array of labels used by the back-end for making scheduling or routing decisions description: An array of labels used by the back-end for making scheduling or routing decisions
annotations: annotations:
type: array
items:
type: string type: string
description: An array of annotations used by the back-end for management, orchestration, events and build tasks description: An array of annotations used by the back-end for management, orchestration, events and build tasks
items:
type: array
secrets: secrets:
type: array type: array
items: items:
type: string type: string
description: An array of names of secrets that are required to be loaded from the Docker Swarm. description: An array of names of secrets that are required to be loaded from the Docker Swarm.
example: "secret-name-1"
registryAuth: registryAuth:
type: string type: string
description: >- description: >-
Private registry base64-encoded basic auth (as present in Private registry base64-encoded basic auth (as present in
~/.docker/config.json) ~/.docker/config.json)
example: Basic dXNlcjpwYXNzd29yZA==
limits: limits:
type: object type: object
properties: properties:
@ -363,6 +377,13 @@ definitions:
example: "0.01" example: "0.01"
requests: requests:
type: object type: object
properties:
memory:
type: string
example: "128M"
cpu:
type: string
example: "0.01"
required: required:
- service - service
- image - image
@ -371,22 +392,36 @@ definitions:
type: object type: object
properties: properties:
name: name:
description: The name of the function
type: string type: string
example: nodeinfo
image: image:
description: The fully qualified docker image name of the function
type: string type: string
example: functions/nodeinfo:latest
invocationCount: invocationCount:
description: The amount of invocations for the specified function
type: number type: number
format: integer format: integer
example: 1337
replicas: replicas:
description: The current minimal ammount of replicas
type: number type: number
format: integer format: integer
example: 2
availableReplicas: availableReplicas:
description: The current available amount of replicas
type: number type: number
format: integer format: integer
example: 2
envProcess: envProcess:
description: Process for watchdog to fork
type: string type: string
example: node main.js
labels: labels:
type: object type: object
additionalProperties:
type: string
required: required:
- name - name
- image - image