mirror of
https://github.com/faas-rs/faasd-in-rust.git
synced 2025-06-08 15:56:48 +00:00
* feat: introduce awc crate to match actix-web streaming requests * fix(ci): fix the integration_tests mod --------- Co-authored-by: Samuka007 <dailvchen@dragonos.org>
192 lines
5.4 KiB
YAML
192 lines
5.4 KiB
YAML
openapi: 3.0.1
|
|
info:
|
|
title: faasd-in-rs API Gateway
|
|
description: faasd-in-rs API documentation
|
|
license:
|
|
name: GPL-3.0
|
|
version: 0.1.0
|
|
servers:
|
|
- url: "http://localhost:8090"
|
|
description: Local server
|
|
tags:
|
|
- name: internal
|
|
description: Internal use only
|
|
- name: system
|
|
description: System endpoints for managing functions and related objects
|
|
- name: function
|
|
description: Endpoints for invoking functions
|
|
paths:
|
|
"/system/functions":
|
|
get:
|
|
operationId: GetFunctions
|
|
description: Get a list of deployed functions
|
|
summary: 'Get a list of deployed functions with: stats and image digest'
|
|
tags:
|
|
- system
|
|
responses:
|
|
'200':
|
|
description: List of deployed functions.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items:
|
|
"$ref": "#/components/schemas/FunctionStatus"
|
|
'400':
|
|
description: Bad Request
|
|
'500':
|
|
description: Internal Server Error
|
|
post:
|
|
operationId: DeployFunction
|
|
description: Deploy a new function.
|
|
summary: Deploy a new function.
|
|
tags:
|
|
- system
|
|
requestBody:
|
|
description: Function to deploy
|
|
content:
|
|
application/json:
|
|
schema:
|
|
"$ref": "#/components/schemas/FunctionDeployment"
|
|
required: true
|
|
responses:
|
|
'202':
|
|
description: Accepted
|
|
'400':
|
|
description: Bad Request
|
|
'500':
|
|
description: Internal Server Error
|
|
delete:
|
|
operationId: DeleteFunction
|
|
description: Remove a deployed function.
|
|
summary: Remove a deployed function.
|
|
tags:
|
|
- system
|
|
requestBody:
|
|
description: Function to delete
|
|
content:
|
|
application/json:
|
|
schema:
|
|
"$ref": "#/components/schemas/DeleteFunctionRequest"
|
|
required: true
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
'404':
|
|
description: Not Found
|
|
'500':
|
|
description: Internal Server Error
|
|
"/function/{function_name}":
|
|
post:
|
|
operationId: InvokeFunction
|
|
description: Invoke a function in the default namespace.
|
|
summary: |
|
|
Synchronously invoke a function defined in te default namespace.
|
|
|
|
Any additional path segments and query parameters will be passed to the function as is.
|
|
tags:
|
|
- function
|
|
parameters:
|
|
- name: function_name
|
|
in: path
|
|
description: Function name
|
|
required: true
|
|
schema:
|
|
type: string
|
|
requestBody:
|
|
description: "(Optional) data to pass to function"
|
|
content:
|
|
"*/*":
|
|
schema:
|
|
type: string
|
|
format: binary
|
|
example: '{"hello": "world"}'
|
|
required: false
|
|
responses:
|
|
'200':
|
|
description: Value returned from function
|
|
'404':
|
|
description: Not Found
|
|
'405':
|
|
description: Method Not Allowed
|
|
'500':
|
|
description: Internal server error
|
|
'503':
|
|
description: Error Service Unavailable
|
|
components:
|
|
schemas:
|
|
FunctionDeployment:
|
|
required:
|
|
- function_name
|
|
- image
|
|
type: object
|
|
properties:
|
|
function_name:
|
|
type: string
|
|
description: Name of deployed function
|
|
example: nginx
|
|
image:
|
|
type: string
|
|
description: Docker image in accessible registry
|
|
example: docker.io/library/nginx:alpine
|
|
namespace:
|
|
type: string
|
|
description: Namespace to deploy function to. When omitted, the default namespace
|
|
is used, typically this is `faasd-in-rs-fn` but is configured by the provider.
|
|
example: faasd-in-rs-fn
|
|
envProcess:
|
|
type: string
|
|
description: |
|
|
Process for watchdog to fork, i.e. the command to start the function process.
|
|
|
|
This value configures the `fprocess` env variable.
|
|
example: main
|
|
envVars:
|
|
type: object
|
|
additionalProperties:
|
|
type: string
|
|
description: Overrides to environmental variables
|
|
labels:
|
|
type: object
|
|
nullable: true
|
|
additionalProperties:
|
|
type: string
|
|
description: A map of labels for making scheduling or routing decisions
|
|
example:
|
|
foo: bar
|
|
DeleteFunctionRequest:
|
|
required:
|
|
- function_name
|
|
type: object
|
|
properties:
|
|
function_name:
|
|
type: string
|
|
description: Name of deployed function
|
|
example: nginx
|
|
FunctionStatus:
|
|
type: object
|
|
required:
|
|
- function_name
|
|
- image
|
|
properties:
|
|
function_name:
|
|
type: string
|
|
description: The name of the function
|
|
example: nginx
|
|
image:
|
|
type: string
|
|
description: The fully qualified docker image name of the function
|
|
example: docker.io/library/nginx:alpine
|
|
namespace:
|
|
type: string
|
|
description: The namespace of the function
|
|
example: faasd-in-rs-fn
|
|
envProcess:
|
|
type: string
|
|
description: Process for watchdog to fork
|
|
example: main
|
|
envVars:
|
|
type: object
|
|
additionalProperties:
|
|
type: string
|
|
description: environment variables for the function runtime |