-
Notifications
You must be signed in to change notification settings - Fork 1
/
ondeviceapi2.yaml
131 lines (128 loc) · 4.05 KB
/
ondeviceapi2.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
swagger: "2.0"
info:
description: "OpenAPI for the gokrazy on-device API"
version: "1.4.0"
title: "gokrazy on-device API"
contact:
email: "[email protected]"
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "gokrazy"
basePath: "/"
schemes:
- "http"
tags:
- name: "supervise"
description: "Process supervision"
- name: "update"
description: "Update"
parameters:
pathParam:
name: "path"
in: "query"
description: "path to the service"
example: "/user/tailscaled"
type: "string"
required: true
paths:
# TODO: add the remaining handlers that are okay for people to use:
#
# http.HandleFunc("/stop", stopstartHandler)
# http.HandleFunc("/restart", stopstartHandler)
#
# update.go
# 286:2: http.HandleFunc("/update/features", func(w http.ResponseWriter, r *http.Request) {
# 312:2: http.HandleFunc("/update/mbr", nonConcurrentUpdateHandler(rootdev.BlockDevice()))
# 313:2: http.HandleFunc("/update/root", nonConcurrentUpdateHandler(rootdev.Partition(inactiveRootPartition)))
# 314:2: http.HandleFunc("/update/switch", nonConcurrentSwitchHandler(inactiveRootPartition))
# 315:2: http.HandleFunc("/update/testboot", nonConcurrentTestbootHandler(inactiveRootPartition))
# 318:3: http.HandleFunc(fmt.Sprintf("/update/device-specific/%s", extraUpdateHandler.name), nonConcurrentLimitedUpdateHandler(extraUpdateHandler.device, extraUpdateHandler.offset, extraUpdateHandler.maxLength))
# 324:2: http.HandleFunc("/update/boot", updateHandler)
# 325:2: http.HandleFunc("/update/bootonly", func(w http.ResponseWriter, r *http.Request) {
# 333:2: http.HandleFunc("/reboot", func(w http.ResponseWriter, r *http.Request) {
# 366:2: http.HandleFunc("/poweroff", func(w http.ResponseWriter, r *http.Request) {
# 399:2: http.HandleFunc("/uploadtemp/", uploadTemp)
# 400:2: http.HandleFunc("/divert", divert)
#
# File: status.go
# 310:2: http.HandleFunc("/log", func(w http.ResponseWriter, r *http.Request) {
/:
get:
tags:
- "supervise"
summary: "Index"
description: "TODO: description"
operationId: "index"
produces:
- "application/json"
responses:
"200":
description: "All search results"
schema:
$ref: "#/definitions/IndexResult"
/status:
get:
tags:
- "supervise"
summary: "Status"
description: "TODO: description"
operationId: "status"
produces:
- "application/json"
parameters:
- $ref: "#/parameters/pathParam"
responses:
"200":
description: "service status"
schema:
$ref: "#/definitions/Service"
definitions:
Service:
type: "object"
properties:
Path:
type: "string"
description: "Path to the service program"
example: "/user/tailscaled"
Args:
type: "array"
description: "Command-line arguments with which to start the service"
items:
type: "string"
example:
- "/user/tailscaled"
- "--statedir=/perm/tailscaled/"
Diverted:
type: "string"
description: "TODO"
Stopped:
type: "boolean"
description: "Whether the service is stopped (gokrazy will not attempt to start it) or supervised"
example: true
StartTime:
type: "string"
description: "TODO"
example: "2024-09-30T07:21:51.199410684+02:00"
Pid:
type: "long"
example: 2342
description: "Linux process id (pid) of the service"
IndexResult:
type: "object"
description: "index of what is supervised"
properties:
Kernel:
type: "string"
description: "The Linux kernel version"
example: "Linux 6.6.28-v8 (aarch64)"
Model:
type: "string"
example: "Raspberry Pi 5 Model B Rev 1.0"
description: "Model name of the machine on which gokrazy is running"
Services:
type: "array"
items:
$ref: "#/definitions/Service"
description: "running services"
# TODO: add the remaining properties