This repository has been archived by the owner on Apr 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yml
108 lines (103 loc) · 3.03 KB
/
openapi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
openapi: 3.0.0
info:
title: Morty APIs
description: |
This document contains the specification of the public-facing Morty APIs. For function invocation, please see the project README here: https://github.com/morty-faas/controller#readme
version: 0.1.1
paths:
/functions:
get:
tags: [Function]
operationId: getFunctions
summary: Get a list of the available functions
description: Get a list of the available functions
responses:
200:
description: The list of the available functions
content:
application/json:
schema:
$ref: '#/components/schemas/GetFunctionResponse'
500:
description: An internal server error occured. Check the logs for more details
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
post:
tags: [Function]
operationId: createFunction
summary: Create a new function
description: Create a new function in the system to be able to invoke it later.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateFunctionRequest'
responses:
200:
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CreateFunctionResponse'
400:
description: The request body is invalid
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
409:
description: A function already exists with the same name
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
500:
description: An internal server error occured. Check the logs for more details
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
GetFunctionResponse:
type: array
items:
$ref: '#/components/schemas/Function'
CreateFunctionRequest:
type: object
properties:
name:
type: string
image:
type: string
CreateFunctionResponse:
$ref: '#/components/schemas/Function'
UUID:
type: string
example: 'b53b71e0-2633-4a15-8435-8e6c56f66b9d'
description: The identifier of the resource
Function:
type: object
required:
- 'name'
- 'image'
properties:
id:
$ref: '#/components/schemas/UUID'
name:
description: A unique name to your function
example: weatho
type: string
image:
description: The URL of the function image
type: string
Error:
type: object
properties:
message:
example: Some error message
description: Descriptive message of your error
type: string