forked from rootless-containers/rootlesskit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
171 lines (171 loc) · 4.39 KB
/
openapi.yaml
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# When you made a change to this YAML, please validate with https://editor.swagger.io
openapi: 3.0.3
info:
version: 1.1.1
title: RootlessKit API
servers:
- url: 'http://rootlesskit/v1'
description: Local UNIX socket server. The host part of the URL is ignored.
paths:
# /info: API >= 1.1.0
/info:
get:
responses:
'200':
description: Info. Available since API 1.1.0.
content:
application/json:
schema:
$ref: '#/components/schemas/Info'
/ports:
get:
responses:
'200':
description: An array of PortStatus
content:
application/json:
schema:
$ref: '#/components/schemas/PortStatuses'
post:
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PortSpec'
responses:
'201':
description: PortStatus with ID
content:
application/json:
schema:
$ref: '#/components/schemas/PortStatus'
'/ports/{id}':
delete:
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int64
responses:
'200':
description: Null response
components:
schemas:
Proto:
type: string
description: "protocol for listening. Corresponds to Go's net.Listen. The strings with \"4\" and \"6\" suffixes were introduced in API 1.1.0."
enum:
- tcp
- tcp4
- tcp6
- udp
- udp4
- udp6
- sctp
- sctp4
- sctp6
PortSpec:
required:
- proto
properties:
proto:
$ref: '#/components/schemas/Proto'
parentIP:
type: string
parentPort:
type: integer
format: int32
minimum: 1
maximum: 65535
childIP:
type: string
# future version may support requests with parentPort<=0 for automatic port assignment
childPort:
type: integer
format: int32
minimum: 1
maximum: 65535
PortStatus:
required:
- id
properties:
id:
type: integer
format: int64
spec:
$ref: '#/components/schemas/PortSpec'
PortStatuses:
type: array
items:
$ref: '#/components/schemas/PortStatus'
# Info: API >= 1.1.0
Info:
required:
- apiVersion
- version
- stateDir
- childPID
properties:
apiVersion:
type: string
description: "API version, without \"v\" prefix"
example: "1.1.0"
version:
type: string
description: "Implementation version, without \"v\" prefix"
example: "0.42.0-beta.1+dev"
stateDir:
type: string
description: "state dir"
example: "/run/user/1000/rootlesskit"
childPID:
type: integer
description: "child PID"
example: 10042
networkDriver:
$ref: '#/components/schemas/NetworkDriverInfo'
portDriver:
$ref: '#/components/schemas/PortDriverInfo'
NetworkDriverInfo:
required:
- driver
properties:
driver:
type: string
description: "network driver. Empty when --net=host."
example: "slirp4netns"
# TODO: return TAP info
dns:
type: array
description: "DNS addresses"
items:
type: string
example: ["10.0.2.3"]
childIP:
type: string
description: "Child IP (v4)"
example: "10.0.2.100"
dynamicChildIP:
type: boolean
description: "Child IP may change"
PortDriverInfo:
required:
- driver
- supportedProtos
properties:
driver:
type: string
description: "port driver"
example: "builtin"
protos:
type: array
description: "The supported protocol strings for listening ports"
example: ["tcp","udp"]
items:
$ref: '#/components/schemas/Proto'
disallowLoopbackChildIP:
type: boolean
description: "If this field is set to true, loopback IP such as 127.0.0.1 cannot be specified as a child IP"