File tree Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -116,12 +116,16 @@ def exec(data):
116
116
117
117
def status ():
118
118
sts = get_status ()
119
+ # getting reset log file
120
+ with open ('/home/pi/log/reset_trigger_service.log' , 'r' ) as log_file :
121
+ data = [x for x in log_file .read ().split ('\n ' ) if x ]
119
122
120
123
return {
121
124
"status" : "ok" ,
122
125
"internetConnectivity" : sts ["internet_status" ],
123
126
"temp" : sts ["temp" ],
124
127
"uptime" : sts ["uptime" ],
128
+ "log" : data
125
129
}
126
130
127
131
def info ():
@@ -210,10 +214,8 @@ def reset():
210
214
pi = pigpio .pi ('localhost' )
211
215
pi .write (BUTTON_PIN , 0 )
212
216
pi .write (BUTTON_PIN , 1 )
213
- with open ('/home/pi/log/reset_trigger_service.log' , 'r' ) as log_file :
214
- data = [x for x in log_file .read ().split ('\n ' ) if x ]
215
217
216
218
return {
217
- "log" : data ,
218
- "status" : "ok"
219
+ "status" : "ok"
219
220
}
221
+
Original file line number Diff line number Diff line change @@ -164,12 +164,21 @@ paths:
164
164
/status :
165
165
get :
166
166
operationId : " api.status"
167
- summary : " Bot general informations and execution status"
167
+ summary : " Bot general informations, execution status and reset log file "
168
168
tags :
169
169
- Status informations
170
170
responses :
171
171
200 :
172
172
description : " Bot status"
173
+ /reset :
174
+ get :
175
+ operationId : " api.reset"
176
+ summary : " Reset coderbot by restoring boot partition"
177
+ tags :
178
+ - Coderbot reset
179
+ responses :
180
+ 200 :
181
+ description : " resets coderbot entirely"
173
182
/info :
174
183
get :
175
184
operationId : " api.info"
@@ -179,15 +188,6 @@ paths:
179
188
responses :
180
189
200 :
181
190
description : " Bot status"
182
- /reset :
183
- get :
184
- operationId : " api.reset"
185
- summary : " Reset coderbot by restoring boot partition"
186
- tags :
187
- - Coderbot reset
188
- responses :
189
- 200 :
190
- description : " reset log file"
191
191
/stop :
192
192
post :
193
193
operationId : " api.stop"
You can’t perform that action at this time.
0 commit comments