This repository has been archived by the owner on Aug 20, 2021. It is now read-only.
generated from peter-evans/swagger-github-pages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.yml
97 lines (91 loc) · 2.23 KB
/
api.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
openapi: '3.0.2'
info:
title: "VM Manager API"
description: |
<https://hackmd.io/xh0yaESoTqS2JqsxB7tm5w?view>
version: "0.1"
servers:
- url: http://192.168.100.1:59487
components:
schemas:
VM:
properties:
id:
type: integer
create_time:
type: string
password:
type: string
name:
type: string
example:
id: 6005
create_time: "2021-05-13T18:28:30.20365668+08:00"
password: "B0f73igR"
name: "NISRA-VM-6005"
paths:
/list:
get:
summary: List all VMs
description: Returns a list a VM infos.
responses:
'200':
description: Successful operation
content:
application/json:
schema:
type: object
properties:
<id>:
type: object
$ref: "#/components/schemas/VM"
/del/{id}:
get:
summary: Delete a VM by ID
description: Returns the status of the delete operation
parameters:
- in: path
name: "id"
schema:
type: integer
required: true
responses:
'200':
description: Successfully delete a VM
content:
application/json:
schema:
type: object
properties:
id:
type: integer
ok:
type: string
example:
id: 6005
ok: "ok"
'418':
description: Failed to delete a VM
content:
application/json:
schema:
type: object
properties:
id:
type: integer
ok:
type: string
example:
id: 6005
ok: "nope"
/new:
get:
summary: Create a new VM
description: Returns the info of the newly created VM
responses:
'200':
description: Successfully create a VM
content:
application/json:
schema:
$ref: "#/components/schemas/VM"