Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions examples/health/getAntivirus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";

Appwrite appwrite(projectId);
Health& health = appwrite.getHealth();

health.setup(apiKey, projectId);

Appwrite appwrite(projectId, apiKey);

try {
std::string response = health.getAntivirus();
std::string response = appwrite.getHealth().getAntivirus();
std::cout << "Health Check Done! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
Expand Down
8 changes: 2 additions & 6 deletions examples/health/getCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";

Appwrite appwrite(projectId);
Health& health = appwrite.getHealth();
Appwrite appwrite(projectId, apiKey);

health.setup(apiKey, projectId);

try {
std::string response = health.getCache();
std::string response = appwrite.getHealth().getCache();
std::cout << "Health Check Done! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
Expand Down
8 changes: 2 additions & 6 deletions examples/health/getDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";

Appwrite appwrite(projectId);
Health& health = appwrite.getHealth();
Appwrite appwrite(projectId, apiKey);

health.setup(apiKey, projectId);

try {
std::string response = health.getDB();
std::string response = appwrite.getHealth().getDB();
std::cout << "Health Check Done! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
Expand Down
8 changes: 2 additions & 6 deletions examples/health/getHealth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";

Appwrite appwrite(projectId);
Health& health = appwrite.getHealth();
Appwrite appwrite(projectId, apiKey);

health.setup(apiKey, projectId);

try {
std::string response = health.getHealth();
std::string response = appwrite.getHealth().getHealthStatus();
std::cout << "Health Check Done! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
Expand Down
8 changes: 2 additions & 6 deletions examples/health/getPubSub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";

Appwrite appwrite(projectId);
Health& health = appwrite.getHealth();
Appwrite appwrite(projectId, apiKey);

health.setup(apiKey, projectId);

try {
std::string response = health.getPubSub();
std::string response = appwrite.getHealth().getPubSub();
std::cout << "Health Check Done! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
Expand Down
8 changes: 2 additions & 6 deletions examples/health/getQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";

Appwrite appwrite(projectId);
Health& health = appwrite.getHealth();
Appwrite appwrite(projectId, apiKey);

health.setup(apiKey, projectId);

try {
std::string response = health.getQueue();
std::string response = appwrite.getHealth().getQueue();
std::cout << "Health Check Done! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
Expand Down
8 changes: 2 additions & 6 deletions examples/health/getStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";

Appwrite appwrite(projectId);
Health& health = appwrite.getHealth();
Appwrite appwrite(projectId, apiKey);

health.setup(apiKey, projectId);

try {
std::string response = health.getStorage();
std::string response = appwrite.getHealth().getStorage();
std::cout << "Health Check Done! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
Expand Down
8 changes: 2 additions & 6 deletions examples/health/getStorageLocal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";

Appwrite appwrite(projectId);
Health& health = appwrite.getHealth();
Appwrite appwrite(projectId, apiKey);

health.setup(apiKey, projectId);

try {
std::string response = health.getStorageLocal();
std::string response = appwrite.getHealth().getStorageLocal();
std::cout << "Health Check Done! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
Expand Down
9 changes: 2 additions & 7 deletions examples/health/getTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@

int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";

Appwrite appwrite(projectId);
Health& health = appwrite.getHealth();

health.setup(apiKey, projectId);


try {
std::string response = health.getTime();
std::string response = appwrite.getHealth().getTime();
std::cout << "Health Check Done! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
Expand Down
10 changes: 3 additions & 7 deletions examples/health/params/getCertificate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@

int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";
std::string domain = "pooranjoyb.tech";

Appwrite appwrite(projectId);
Health& health = appwrite.getHealth();

health.setup(apiKey, projectId);
std::string apiKey = "";
Appwrite appwrite(projectId, apiKey);

try {
std::string response = health.getCertificate(domain);
std::string response = appwrite.getHealth().getCertificate(domain);
std::cout << "Health Check Done! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
Expand Down
10 changes: 3 additions & 7 deletions examples/health/params/getQueueBuilds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@

int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";
std::string threshold = "5";

Appwrite appwrite(projectId);
Health& health = appwrite.getHealth();
std::string apiKey = "";
Appwrite appwrite(projectId, apiKey);

health.setup(apiKey, projectId);

try {
std::string response = health.getQueueBuilds(threshold);
std::string response = appwrite.getHealth().getQueueBuilds(threshold);
std::cout << "Health Check Done! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
Expand Down
10 changes: 3 additions & 7 deletions examples/health/params/getQueueCertificates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@

int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";
std::string threshold = "5";

Appwrite appwrite(projectId);
Health& health = appwrite.getHealth();
std::string apiKey = "";
Appwrite appwrite(projectId, apiKey);

health.setup(apiKey, projectId);

try {
std::string response = health.getQueueCertificates(threshold);
std::string response = appwrite.getHealth().getQueueCertificates(threshold);
std::cout << "Health Check Done! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
Expand Down
10 changes: 3 additions & 7 deletions examples/health/params/getQueueFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@

int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";
std::string threshold = "5";

Appwrite appwrite(projectId);
Health& health = appwrite.getHealth();
std::string apiKey = "";
Appwrite appwrite(projectId, apiKey);

health.setup(apiKey, projectId);

try {
std::string response = health.getQueueFunctions(threshold);
std::string response = appwrite.getHealth().getQueueFunctions(threshold);
std::cout << "Health Check Done! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
Expand Down
10 changes: 3 additions & 7 deletions examples/health/params/getQueueMails.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@

int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";
std::string threshold = "5";

Appwrite appwrite(projectId);
Health& health = appwrite.getHealth();
std::string apiKey = "";
Appwrite appwrite(projectId, apiKey);

health.setup(apiKey, projectId);

try {
std::string response = health.getQueueMails(threshold);
std::string response = appwrite.getHealth().getQueueMails(threshold);
std::cout << "Health Check Done! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
Expand Down
10 changes: 3 additions & 7 deletions examples/health/params/getQueueMessaging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@

int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";
std::string threshold = "5";

Appwrite appwrite(projectId);
Health& health = appwrite.getHealth();
std::string apiKey = "";
Appwrite appwrite(projectId, apiKey);

health.setup(apiKey, projectId);

try {
std::string response = health.getQueueMessaging(threshold);
std::string response = appwrite.getHealth().getQueueMessaging(threshold);
std::cout << "Health Check Done! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
Expand Down
10 changes: 3 additions & 7 deletions examples/health/params/getQueueMigrations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@

int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";
std::string threshold = "5";

Appwrite appwrite(projectId);
Health& health = appwrite.getHealth();

health.setup(apiKey, projectId);
std::string apiKey = "";
Appwrite appwrite(projectId, apiKey);

try {
std::string response = health.getQueueMigrations(threshold);
std::string response = appwrite.getHealth().getQueueMigrations(threshold);
std::cout << "Health Check Done! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
Expand Down
10 changes: 3 additions & 7 deletions examples/health/params/getQueueUsageDump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@

int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";
std::string threshold = "5";

Appwrite appwrite(projectId);
Health& health = appwrite.getHealth();
std::string apiKey = "";
Appwrite appwrite(projectId, apiKey);

health.setup(apiKey, projectId);

try {
std::string response = health.getQueueUsageDump(threshold);
std::string response = appwrite.getHealth().getQueueUsageDump(threshold);
std::cout << "Health Check Done! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
Expand Down
10 changes: 3 additions & 7 deletions examples/health/params/getQueueUsageWebhooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@

int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";
std::string threshold = "5";

Appwrite appwrite(projectId);
Health& health = appwrite.getHealth();
std::string apiKey = "";
Appwrite appwrite(projectId, apiKey);

health.setup(apiKey, projectId);

try {
std::string response = health.getQueueUsageWebhooks(threshold);
std::string response = appwrite.getHealth().getQueueUsageWebhooks(threshold);
std::cout << "Health Check Done! \nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Exception: " << ex.what() << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion include/classes/Health.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Health {
Health(const std::string& projectId, const std::string& apiKey);

// core
std::string getHealth();
std::string getHealthStatus();
std::string getAntivirus();
std::string getCache();
std::string getDB();
Expand Down
2 changes: 1 addition & 1 deletion src/services/Health.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Health::Health(const std::string& projectId, const std::string& apiKey)
: projectId(projectId), apiKey(apiKey) {}

std::string Health::getHealth(){
std::string Health::getHealthStatus(){

std::string url = Config::API_BASE_URL + "/health";

Expand Down
Binary file modified tests/health/getDB
Binary file not shown.
Binary file modified tests/health/getHealth
Binary file not shown.
Binary file modified tests/health/getPubSub
Binary file not shown.