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()
    path = '/health'

    params = {
    }
    
    headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: path,
        headers: headers,
        params: 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()
    path = '/health/anti-virus'

    params = {
    }
    
    headers = {
        "content-type": 'application/json',
    }

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

#get_cacheHealthStatus

Check the Appwrite in-memory cache server is 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()
    path = '/health/cache'

    params = {
    }
    
    headers = {
        "content-type": 'application/json',
    }

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

#get_dbHealthStatus

Check the Appwrite database server is 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()
    path = '/health/db'

    params = {
    }
    
    headers = {
        "content-type": 'application/json',
    }

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

#get_queue_certificatesHealthQueue

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

Returns:

  • (HealthQueue)


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

def get_queue_certificates()
    path = '/health/queue/certificates'

    params = {
    }
    
    headers = {
        "content-type": 'application/json',
    }

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

#get_queue_functionsHealthQueue

Returns:

  • (HealthQueue)


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

def get_queue_functions()
    path = '/health/queue/functions'

    params = {
    }
    
    headers = {
        "content-type": 'application/json',
    }

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

#get_queue_logsHealthQueue

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

Returns:

  • (HealthQueue)


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

def get_queue_logs()
    path = '/health/queue/logs'

    params = {
    }
    
    headers = {
        "content-type": 'application/json',
    }

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

#get_queue_webhooksHealthQueue

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

Returns:

  • (HealthQueue)


187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/appwrite/services/health.rb', line 187

def get_queue_webhooks()
    path = '/health/queue/webhooks'

    params = {
    }
    
    headers = {
        "content-type": 'application/json',
    }

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

#get_storage_localHealthStatus

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

Returns:

  • (HealthStatus)


211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/appwrite/services/health.rb', line 211

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

    params = {
    }
    
    headers = {
        "content-type": 'application/json',
    }

    @client.call(
        method: 'GET',
        path: path,
        headers: headers,
        params: 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)


241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File 'lib/appwrite/services/health.rb', line 241

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

    params = {
    }
    
    headers = {
        "content-type": 'application/json',
    }

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