Class: Appwrite::Health

Inherits:
Service show all
Defined in:
lib/appwrite/services/health.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Health

Returns a new instance of Health.



6
7
8
# File 'lib/appwrite/services/health.rb', line 6

def initialize(client)
    @client = client
end

Instance Method Details

#getHealthStatus

Check the Appwrite HTTP server is up and responsive.

Returns:

  • (HealthStatus)


14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/appwrite/services/health.rb', line 14

def get()
    api_path = '/health'

    api_params = {
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::HealthStatus
    )
end

#get_antivirusHealthAntivirus

Check the Appwrite Antivirus server is up and connection is successful.

Returns:

  • (HealthAntivirus)


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/appwrite/services/health.rb', line 38

def get_antivirus()
    api_path = '/health/anti-virus'

    api_params = {
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::HealthAntivirus
    )
end

#get_cacheHealthStatus

Check the Appwrite in-memory cache servers are up and connection is successful.

Returns:

  • (HealthStatus)


63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/appwrite/services/health.rb', line 63

def get_cache()
    api_path = '/health/cache'

    api_params = {
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::HealthStatus
    )
end

#get_dbHealthStatus

Check the Appwrite database servers are up and connection is successful.

Returns:

  • (HealthStatus)


87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/appwrite/services/health.rb', line 87

def get_db()
    api_path = '/health/db'

    api_params = {
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::HealthStatus
    )
end

#get_pub_subHealthStatus

Check the Appwrite pub-sub servers are up and connection is successful.

Returns:

  • (HealthStatus)


111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/appwrite/services/health.rb', line 111

def get_pub_sub()
    api_path = '/health/pubsub'

    api_params = {
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::HealthStatus
    )
end

#get_queueHealthStatus

Check the Appwrite queue messaging servers are up and connection is successful.

Returns:

  • (HealthStatus)


136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/appwrite/services/health.rb', line 136

def get_queue()
    api_path = '/health/queue'

    api_params = {
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::HealthStatus
    )
end

#get_queue_builds(threshold: nil) ⇒ HealthQueue

Get the number of builds that are waiting to be processed in the Appwrite internal queue server.

Parameters:

  • threshold (Integer) (defaults to: nil)

    Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.

Returns:

  • (HealthQueue)


162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/appwrite/services/health.rb', line 162

def get_queue_builds(threshold: nil)
    api_path = '/health/queue/builds'

    api_params = {
        threshold: threshold,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::HealthQueue
    )
end

#get_queue_certificates(threshold: nil) ⇒ HealthQueue

Get the number of certificates that are waiting to be issued against [Letsencrypt](letsencrypt.org/) in the Appwrite internal queue server.

Parameters:

  • threshold (Integer) (defaults to: nil)

    Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.

Returns:

  • (HealthQueue)


190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/appwrite/services/health.rb', line 190

def get_queue_certificates(threshold: nil)
    api_path = '/health/queue/certificates'

    api_params = {
        threshold: threshold,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::HealthQueue
    )
end

#get_queue_databases(name: nil, threshold: nil) ⇒ HealthQueue

Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.

Parameters:

  • name (String) (defaults to: nil)

    Queue name for which to check the queue size

  • threshold (Integer) (defaults to: nil)

    Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.

Returns:

  • (HealthQueue)


218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/appwrite/services/health.rb', line 218

def get_queue_databases(name: nil, threshold: nil)
    api_path = '/health/queue/databases'

    api_params = {
        name: name,
        threshold: threshold,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::HealthQueue
    )
end

#get_queue_deletes(threshold: nil) ⇒ HealthQueue

Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.

Parameters:

  • threshold (Integer) (defaults to: nil)

    Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.

Returns:

  • (HealthQueue)


246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/appwrite/services/health.rb', line 246

def get_queue_deletes(threshold: nil)
    api_path = '/health/queue/deletes'

    api_params = {
        threshold: threshold,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::HealthQueue
    )
end

#get_queue_functions(threshold: nil) ⇒ HealthQueue

Parameters:

  • threshold (Integer) (defaults to: nil)

    Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.

Returns:

  • (HealthQueue)


272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'lib/appwrite/services/health.rb', line 272

def get_queue_functions(threshold: nil)
    api_path = '/health/queue/functions'

    api_params = {
        threshold: threshold,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::HealthQueue
    )
end

#get_queue_logs(threshold: nil) ⇒ HealthQueue

Get the number of logs that are waiting to be processed in the Appwrite internal queue server.

Parameters:

  • threshold (Integer) (defaults to: nil)

    Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.

Returns:

  • (HealthQueue)


299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/appwrite/services/health.rb', line 299

def get_queue_logs(threshold: nil)
    api_path = '/health/queue/logs'

    api_params = {
        threshold: threshold,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::HealthQueue
    )
end

#get_queue_mails(threshold: nil) ⇒ HealthQueue

Get the number of mails that are waiting to be processed in the Appwrite internal queue server.

Parameters:

  • threshold (Integer) (defaults to: nil)

    Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.

Returns:

  • (HealthQueue)


326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
# File 'lib/appwrite/services/health.rb', line 326

def get_queue_mails(threshold: nil)
    api_path = '/health/queue/mails'

    api_params = {
        threshold: threshold,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::HealthQueue
    )
end

#get_queue_messaging(threshold: nil) ⇒ HealthQueue

Get the number of messages that are waiting to be processed in the Appwrite internal queue server.

Parameters:

  • threshold (Integer) (defaults to: nil)

    Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.

Returns:

  • (HealthQueue)


353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
# File 'lib/appwrite/services/health.rb', line 353

def get_queue_messaging(threshold: nil)
    api_path = '/health/queue/messaging'

    api_params = {
        threshold: threshold,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::HealthQueue
    )
end

#get_queue_migrations(threshold: nil) ⇒ HealthQueue

Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.

Parameters:

  • threshold (Integer) (defaults to: nil)

    Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.

Returns:

  • (HealthQueue)


380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/appwrite/services/health.rb', line 380

def get_queue_migrations(threshold: nil)
    api_path = '/health/queue/migrations'

    api_params = {
        threshold: threshold,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::HealthQueue
    )
end

#get_queue_webhooks(threshold: nil) ⇒ HealthQueue

Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.

Parameters:

  • threshold (Integer) (defaults to: nil)

    Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.

Returns:

  • (HealthQueue)


407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
# File 'lib/appwrite/services/health.rb', line 407

def get_queue_webhooks(threshold: nil)
    api_path = '/health/queue/webhooks'

    api_params = {
        threshold: threshold,
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::HealthQueue
    )
end

#get_storage_localHealthStatus

Check the Appwrite local storage device is up and connection is successful.

Returns:

  • (HealthStatus)


432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
# File 'lib/appwrite/services/health.rb', line 432

def get_storage_local()
    api_path = '/health/storage/local'

    api_params = {
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::HealthStatus
    )
end

#get_timeHealthTime

Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.

Returns:

  • (HealthTime)


462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
# File 'lib/appwrite/services/health.rb', line 462

def get_time()
    api_path = '/health/time'

    api_params = {
    }
    
    api_headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
        response_type: Models::HealthTime
    )
end