@@ -171,7 +171,7 @@ std::string Health::getQueue(){
171
171
return response;
172
172
}
173
173
else {
174
- throw AppwriteException (" Error fetching time . Status code: " + std::to_string (statusCode) + " \n\n Response: " + response);
174
+ throw AppwriteException (" Error fetching queue . Status code: " + std::to_string (statusCode) + " \n\n Response: " + response);
175
175
}
176
176
}
177
177
@@ -192,7 +192,7 @@ std::string Health::getCertificate(const std::string& domain){
192
192
return response;
193
193
}
194
194
else {
195
- throw AppwriteException (" Error fetching time . Status code: " + std::to_string (statusCode) + " \n\n Response: " + response);
195
+ throw AppwriteException (" Error fetching certificates . Status code: " + std::to_string (statusCode) + " \n\n Response: " + response);
196
196
}
197
197
}
198
198
@@ -213,7 +213,7 @@ std::string Health::getQueueBuilds(const std::string& threshold){
213
213
return response;
214
214
}
215
215
else {
216
- throw AppwriteException (" Error fetching time . Status code: " + std::to_string (statusCode) + " \n\n Response: " + response);
216
+ throw AppwriteException (" Error fetching queue builds . Status code: " + std::to_string (statusCode) + " \n\n Response: " + response);
217
217
}
218
218
}
219
219
@@ -234,7 +234,7 @@ std::string Health::getQueueCertificates(const std::string& threshold){
234
234
return response;
235
235
}
236
236
else {
237
- throw AppwriteException (" Error fetching time . Status code: " + std::to_string (statusCode) + " \n\n Response: " + response);
237
+ throw AppwriteException (" Error fetching queue certificate . Status code: " + std::to_string (statusCode) + " \n\n Response: " + response);
238
238
}
239
239
}
240
240
@@ -255,7 +255,7 @@ std::string Health::getQueueUsageWebhooks(const std::string& threshold){
255
255
return response;
256
256
}
257
257
else {
258
- throw AppwriteException (" Error fetching time . Status code: " + std::to_string (statusCode) + " \n\n Response: " + response);
258
+ throw AppwriteException (" Error fetching webhook usage . Status code: " + std::to_string (statusCode) + " \n\n Response: " + response);
259
259
}
260
260
}
261
261
@@ -276,7 +276,91 @@ std::string Health::getQueueUsageDump(const std::string& threshold){
276
276
return response;
277
277
}
278
278
else {
279
- throw AppwriteException (" Error fetching time. Status code: " + std::to_string (statusCode) + " \n\n Response: " + response);
279
+ throw AppwriteException (" Error fetching usage-dump. Status code: " + std::to_string (statusCode) + " \n\n Response: " + response);
280
+ }
281
+ }
282
+
283
+ std::string Health::getQueueMails (const std::string& threshold){
284
+ std::string url = Config::API_BASE_URL + " /health/queue/mails" ;
285
+
286
+ std::string queryString = " threshold=" + Utils::urlEncode (threshold);
287
+ url += " ?" + queryString;
288
+
289
+ std::vector<std::string> headers = Config::getHeaders (projectId);
290
+ headers.push_back (" X-Appwrite-Key: " + apiKey);
291
+
292
+ std::string response;
293
+
294
+ int statusCode = Utils::getRequest (url, headers, response);
295
+
296
+ if (statusCode == HttpStatus::OK) {
297
+ return response;
298
+ }
299
+ else {
300
+ throw AppwriteException (" Error fetching mails. Status code: " + std::to_string (statusCode) + " \n\n Response: " + response);
301
+ }
302
+ }
303
+
304
+ std::string Health::getQueueMessaging (const std::string& threshold){
305
+ std::string url = Config::API_BASE_URL + " /health/queue/messaging" ;
306
+
307
+ std::string queryString = " threshold=" + Utils::urlEncode (threshold);
308
+ url += " ?" + queryString;
309
+
310
+ std::vector<std::string> headers = Config::getHeaders (projectId);
311
+ headers.push_back (" X-Appwrite-Key: " + apiKey);
312
+
313
+ std::string response;
314
+
315
+ int statusCode = Utils::getRequest (url, headers, response);
316
+
317
+ if (statusCode == HttpStatus::OK) {
318
+ return response;
319
+ }
320
+ else {
321
+ throw AppwriteException (" Error fetching messages from queues. Status code: " + std::to_string (statusCode) + " \n\n Response: " + response);
322
+ }
323
+ }
324
+
325
+ std::string Health::getQueueMigrations (const std::string& threshold){
326
+ std::string url = Config::API_BASE_URL + " /health/queue/migrations" ;
327
+
328
+ std::string queryString = " threshold=" + Utils::urlEncode (threshold);
329
+ url += " ?" + queryString;
330
+
331
+ std::vector<std::string> headers = Config::getHeaders (projectId);
332
+ headers.push_back (" X-Appwrite-Key: " + apiKey);
333
+
334
+ std::string response;
335
+
336
+ int statusCode = Utils::getRequest (url, headers, response);
337
+
338
+ if (statusCode == HttpStatus::OK) {
339
+ return response;
340
+ }
341
+ else {
342
+ throw AppwriteException (" Error fetching migration queues. Status code: " + std::to_string (statusCode) + " \n\n Response: " + response);
343
+ }
344
+ }
345
+
346
+ std::string Health::getQueueFunctions (const std::string& threshold){
347
+ std::string url = Config::API_BASE_URL + " /health/queue/functions" ;
348
+
349
+ std::string queryString = " threshold=" + Utils::urlEncode (threshold);
350
+ url += " ?" + queryString;
351
+
352
+ std::vector<std::string> headers = Config::getHeaders (projectId);
353
+ headers.push_back (" X-Appwrite-Key: " + apiKey);
354
+
355
+ std::string response;
356
+
357
+ int statusCode = Utils::getRequest (url, headers, response);
358
+
359
+ if (statusCode == HttpStatus::OK) {
360
+ return response;
361
+ }
362
+ else {
363
+ throw AppwriteException (" Error fetching function queues. Status code: " + std::to_string (statusCode) + " \n\n Response: " + response);
280
364
}
281
365
}
282
366
0 commit comments