Health

SERVER

The Health service is designed to allow you to both validate and monitor that your Appwrite instance and all of its internal components are up and responsive.

Base URL
https://cloud.appwrite.io/v1

Get HTTP

Check the Appwrite HTTP server is up and responsive.

Endpoint
GET /health
Swift
import Appwrite

func main() async throws {
    let client = Client()
      .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
      .setProject("5df5acd0d48c2") // Your project ID
      .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    let health = Health(client)
    let healthStatus = try await health.get()

    print(String(describing: healthStatus)
}

Get Antivirus

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

Endpoint
GET /health/anti-virus
Swift
import Appwrite

func main() async throws {
    let client = Client()
      .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
      .setProject("5df5acd0d48c2") // Your project ID
      .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    let health = Health(client)
    let healthAntivirus = try await health.getAntivirus()

    print(String(describing: healthAntivirus)
}

Get Cache

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

Endpoint
GET /health/cache
Swift
import Appwrite

func main() async throws {
    let client = Client()
      .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
      .setProject("5df5acd0d48c2") // Your project ID
      .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    let health = Health(client)
    let healthStatus = try await health.getCache()

    print(String(describing: healthStatus)
}

Get DB

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

Endpoint
GET /health/db
Swift
import Appwrite

func main() async throws {
    let client = Client()
      .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
      .setProject("5df5acd0d48c2") // Your project ID
      .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    let health = Health(client)
    let healthStatus = try await health.getDB()

    print(String(describing: healthStatus)
}

Get Certificates Queue

Get the number of certificates that are waiting to be issued against Letsencrypt in the Appwrite internal queue server.

Endpoint
GET /health/queue/certificates
Swift
import Appwrite

func main() async throws {
    let client = Client()
      .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
      .setProject("5df5acd0d48c2") // Your project ID
      .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    let health = Health(client)
    let healthQueue = try await health.getQueueCertificates()

    print(String(describing: healthQueue)
}

Get Functions Queue

Endpoint
GET /health/queue/functions
Swift
import Appwrite

func main() async throws {
    let client = Client()
      .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
      .setProject("5df5acd0d48c2") // Your project ID
      .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    let health = Health(client)
    let healthQueue = try await health.getQueueFunctions()

    print(String(describing: healthQueue)
}

Get Logs Queue

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

Endpoint
GET /health/queue/logs
Swift
import Appwrite

func main() async throws {
    let client = Client()
      .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
      .setProject("5df5acd0d48c2") // Your project ID
      .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    let health = Health(client)
    let healthQueue = try await health.getQueueLogs()

    print(String(describing: healthQueue)
}

Get Webhooks Queue

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

Endpoint
GET /health/queue/webhooks
Swift
import Appwrite

func main() async throws {
    let client = Client()
      .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
      .setProject("5df5acd0d48c2") // Your project ID
      .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    let health = Health(client)
    let healthQueue = try await health.getQueueWebhooks()

    print(String(describing: healthQueue)
}

Get Local Storage

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

Endpoint
GET /health/storage/local
Swift
import Appwrite

func main() async throws {
    let client = Client()
      .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
      .setProject("5df5acd0d48c2") // Your project ID
      .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    let health = Health(client)
    let healthStatus = try await health.getStorageLocal()

    print(String(describing: healthStatus)
}

Get Time

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 (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.

Endpoint
GET /health/time
Swift
import Appwrite

func main() async throws {
    let client = Client()
      .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
      .setProject("5df5acd0d48c2") // Your project ID
      .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
    let health = Health(client)
    let healthTime = try await health.getTime()

    print(String(describing: healthTime)
}