mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Remove Health service from SDK and OpenAPI specs (#12848)
* Remove Health service from SDK and OpenAPI specs Health endpoints remain available over HTTP for monitoring, but are no longer included in generated SDKs or OpenAPI specifications. Co-authored-by: Cursor <cursoragent@cursor.com> * Set health docs flag to false alongside sdk false Align health service metadata with other non-SDK services per review feedback. Co-authored-by: Cursor <cursoragent@cursor.com> * Remove GraphQL health tests after dropping health from schema Health endpoints are no longer exposed in the GraphQL schema after removing SDK labels, so delete the dedicated GraphQL health test suite. Co-authored-by: Cursor <cursoragent@cursor.com> * Exclude health from unauthenticated service-disable E2E checks Health endpoints require admin auth, so disabled-service checks that call /health without credentials return 401 instead of 403. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
86eacb6969
commit
9e83d5e1e9
28 files changed
+2
-724
No files matched your search
@@ -105,8 +105,8 @@ return [
|
||||
'subtitle' => 'The Health service allows you to both validate and monitor your Appwrite server\'s health.',
|
||||
'description' => '/docs/services/health.md',
|
||||
'controller' => '', // Uses modules
|
||||
'sdk' => true,
|
||||
'docs' => true,
|
||||
'sdk' => false,
|
||||
'docs' => false,
|
||||
'docsUrl' => 'https://appwrite.io/docs/server/health',
|
||||
'tests' => false,
|
||||
'optional' => true,
|
||||
|
||||
@@ -4,10 +4,6 @@ namespace Appwrite\Platform\Modules\Health\Http\Health\AntiVirus;
|
||||
|
||||
use Appwrite\ClamAV\Network;
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Platform\Action;
|
||||
@@ -31,20 +27,6 @@ class Get extends Action
|
||||
->desc('Get antivirus')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'health',
|
||||
name: 'getAntivirus',
|
||||
description: '/docs/references/health/get-storage-anti-virus.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_ANTIVIRUS,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->callback($this->action(...));
|
||||
}
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
namespace Appwrite\Platform\Modules\Health\Http\Health\Cache;
|
||||
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Cache\Cache;
|
||||
use Utopia\Database\Document;
|
||||
@@ -30,20 +26,6 @@ class Get extends Action
|
||||
->desc('Get cache')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'health',
|
||||
name: 'getCache',
|
||||
description: '/docs/references/health/get-cache.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_STATUS_LIST,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->inject('cache')
|
||||
->callback($this->action(...));
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
namespace Appwrite\Platform\Modules\Health\Http\Health\Certificate;
|
||||
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Domains\Validator\PublicDomain;
|
||||
@@ -34,20 +30,6 @@ class Get extends Action
|
||||
->desc('Get the SSL certificate for a domain')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'health',
|
||||
name: 'getCertificate',
|
||||
description: '/docs/references/health/get-certificate.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_CERTIFICATE,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->param('domain', null, new Multiple([new AnyOf([new URL(), new Domain()]), new PublicDomain()]), Multiple::TYPE_STRING, 'Domain name')
|
||||
->inject('response')
|
||||
->callback($this->action(...));
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
namespace Appwrite\Platform\Modules\Health\Http\Health\DB;
|
||||
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Config\Config;
|
||||
use Utopia\Database\Adapter\Pool as DatabasePool;
|
||||
@@ -33,20 +29,6 @@ class Get extends Action
|
||||
->desc('Get DB')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'health',
|
||||
name: 'getDB',
|
||||
description: '/docs/references/health/get-db.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_STATUS_LIST,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->inject('pools')
|
||||
->inject('authorization')
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
namespace Appwrite\Platform\Modules\Health\Http\Health\Geo;
|
||||
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Fetch\Client;
|
||||
@@ -31,20 +27,6 @@ class Get extends Action
|
||||
->desc('Get geo')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'health',
|
||||
name: 'getGeo',
|
||||
description: '/docs/references/health/get-geo.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_STATUS,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->callback($this->action(...));
|
||||
}
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
|
||||
namespace Appwrite\Platform\Modules\Health\Http\Health;
|
||||
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Platform\Action;
|
||||
@@ -28,20 +24,6 @@ class Get extends Action
|
||||
->desc('Get HTTP')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'health',
|
||||
name: 'get',
|
||||
description: '/docs/references/health/get.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_STATUS,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->callback($this->action(...));
|
||||
}
|
||||
|
||||
@@ -4,10 +4,6 @@ namespace Appwrite\Platform\Modules\Health\Http\Health\PubSub;
|
||||
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\PubSub\Adapter\Pool as PubSubPool;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Config\Config;
|
||||
use Utopia\Database\Document;
|
||||
@@ -32,20 +28,6 @@ class Get extends Action
|
||||
->desc('Get pubsub')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'health',
|
||||
name: 'getPubSub',
|
||||
description: '/docs/references/health/get-pubsub.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_STATUS_LIST,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->inject('pools')
|
||||
->callback($this->action(...));
|
||||
|
||||
@@ -4,10 +4,6 @@ namespace Appwrite\Platform\Modules\Health\Http\Health\Queue\Audits;
|
||||
|
||||
use Appwrite\Event\Publisher\Audit;
|
||||
use Appwrite\Platform\Modules\Health\Http\Health\Queue\Base;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Validator\Integer;
|
||||
@@ -27,20 +23,6 @@ class Get extends Base
|
||||
->desc('Get audits queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueAudits',
|
||||
description: '/docs/references/health/get-queue-audits.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_QUEUE,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('publisherForAudits')
|
||||
->inject('response')
|
||||
|
||||
@@ -4,10 +4,6 @@ namespace Appwrite\Platform\Modules\Health\Http\Health\Queue\Builds;
|
||||
|
||||
use Appwrite\Event\Publisher\Build as BuildPublisher;
|
||||
use Appwrite\Platform\Modules\Health\Http\Health\Queue\Base;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Validator\Integer;
|
||||
@@ -27,20 +23,6 @@ class Get extends Base
|
||||
->desc('Get builds queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueBuilds',
|
||||
description: '/docs/references/health/get-queue-builds.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_QUEUE,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('publisherForBuilds')
|
||||
->inject('response')
|
||||
|
||||
@@ -4,10 +4,6 @@ namespace Appwrite\Platform\Modules\Health\Http\Health\Queue\Certificates;
|
||||
|
||||
use Appwrite\Event\Publisher\Certificate;
|
||||
use Appwrite\Platform\Modules\Health\Http\Health\Queue\Base;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Validator\Integer;
|
||||
@@ -27,20 +23,6 @@ class Get extends Base
|
||||
->desc('Get certificates queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueCertificates',
|
||||
description: '/docs/references/health/get-queue-certificates.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_QUEUE,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('publisherForCertificates')
|
||||
->inject('response')
|
||||
|
||||
@@ -4,10 +4,6 @@ namespace Appwrite\Platform\Modules\Health\Http\Health\Queue\Databases;
|
||||
|
||||
use Appwrite\Event\Publisher\Database;
|
||||
use Appwrite\Platform\Modules\Health\Http\Health\Queue\Base;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Queue\Queue;
|
||||
@@ -29,20 +25,6 @@ class Get extends Base
|
||||
->desc('Get databases queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueDatabases',
|
||||
description: '/docs/references/health/get-queue-databases.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_QUEUE,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->param('name', 'database_db_main', new Text(256), 'Queue name for which to check the queue size', true)
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('publisherForDatabase')
|
||||
|
||||
@@ -4,10 +4,6 @@ namespace Appwrite\Platform\Modules\Health\Http\Health\Queue\Deletes;
|
||||
|
||||
use Appwrite\Event\Publisher\Delete;
|
||||
use Appwrite\Platform\Modules\Health\Http\Health\Queue\Base;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Validator\Integer;
|
||||
@@ -27,20 +23,6 @@ class Get extends Base
|
||||
->desc('Get deletes queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueDeletes',
|
||||
description: '/docs/references/health/get-queue-deletes.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_QUEUE,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('publisherForDeletes')
|
||||
->inject('response')
|
||||
|
||||
@@ -19,10 +19,6 @@ use Appwrite\Event\Publisher\Usage as UsagePublisher;
|
||||
use Appwrite\Event\Webhook;
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\Platform\Modules\Health\Http\Health\Queue\Base;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Platform\Enum;
|
||||
@@ -45,20 +41,6 @@ class Get extends Base
|
||||
->desc('Get number of failed queue jobs')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getFailedJobs',
|
||||
description: '/docs/references/health/get-failed-queue-jobs.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_QUEUE,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->param('name', '', new WhiteList([
|
||||
System::getEnv('_APP_DATABASE_QUEUE_NAME', Event::DATABASE_QUEUE_NAME),
|
||||
System::getEnv('_APP_DELETE_QUEUE_NAME', Event::DELETE_QUEUE_NAME),
|
||||
|
||||
@@ -4,10 +4,6 @@ namespace Appwrite\Platform\Modules\Health\Http\Health\Queue\Functions;
|
||||
|
||||
use Appwrite\Event\Publisher\Func as FunctionPublisher;
|
||||
use Appwrite\Platform\Modules\Health\Http\Health\Queue\Base;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Validator\Integer;
|
||||
@@ -27,20 +23,6 @@ class Get extends Base
|
||||
->desc('Get functions queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueFunctions',
|
||||
description: '/docs/references/health/get-queue-functions.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_QUEUE,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('publisherForFunctions')
|
||||
->inject('response')
|
||||
|
||||
@@ -4,10 +4,6 @@ namespace Appwrite\Platform\Modules\Health\Http\Health\Queue\Mails;
|
||||
|
||||
use Appwrite\Event\Publisher\Mail as MailPublisher;
|
||||
use Appwrite\Platform\Modules\Health\Http\Health\Queue\Base;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Validator\Integer;
|
||||
@@ -27,20 +23,6 @@ class Get extends Base
|
||||
->desc('Get mails queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueMails',
|
||||
description: '/docs/references/health/get-queue-mails.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_QUEUE,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('publisherForMails')
|
||||
->inject('response')
|
||||
|
||||
@@ -4,10 +4,6 @@ namespace Appwrite\Platform\Modules\Health\Http\Health\Queue\Messaging;
|
||||
|
||||
use Appwrite\Event\Publisher\Messaging as MessagingPublisher;
|
||||
use Appwrite\Platform\Modules\Health\Http\Health\Queue\Base;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Validator\Integer;
|
||||
@@ -27,20 +23,6 @@ class Get extends Base
|
||||
->desc('Get messaging queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueMessaging',
|
||||
description: '/docs/references/health/get-queue-messaging.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_QUEUE,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('publisherForMessaging')
|
||||
->inject('response')
|
||||
|
||||
@@ -4,10 +4,6 @@ namespace Appwrite\Platform\Modules\Health\Http\Health\Queue\Migrations;
|
||||
|
||||
use Appwrite\Event\Publisher\Migration as MigrationPublisher;
|
||||
use Appwrite\Platform\Modules\Health\Http\Health\Queue\Base;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Validator\Integer;
|
||||
@@ -27,20 +23,6 @@ class Get extends Base
|
||||
->desc('Get migrations queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueMigrations',
|
||||
description: '/docs/references/health/get-queue-migrations.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_QUEUE,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('publisherForMigrations')
|
||||
->inject('response')
|
||||
|
||||
@@ -4,10 +4,6 @@ namespace Appwrite\Platform\Modules\Health\Http\Health\Queue\Notifications;
|
||||
|
||||
use Appwrite\Event\Publisher\Notification as NotificationPublisher;
|
||||
use Appwrite\Platform\Modules\Health\Http\Health\Queue\Base;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Validator\Integer;
|
||||
@@ -27,20 +23,6 @@ class Get extends Base
|
||||
->desc('Get notifications queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueNotifications',
|
||||
description: '/docs/references/health/get-queue-notifications.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_QUEUE,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('publisherForNotifications')
|
||||
->inject('response')
|
||||
|
||||
@@ -4,10 +4,6 @@ namespace Appwrite\Platform\Modules\Health\Http\Health\Queue\StatsResources;
|
||||
|
||||
use Appwrite\Event\Publisher\StatsResources as StatsResourcesPublisher;
|
||||
use Appwrite\Platform\Modules\Health\Http\Health\Queue\Base;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Validator\Integer;
|
||||
@@ -27,20 +23,6 @@ class Get extends Base
|
||||
->desc('Get stats resources queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueStatsResources',
|
||||
description: '/docs/references/health/get-queue-stats-resources.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_QUEUE,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('publisherForStatsResources')
|
||||
->inject('response')
|
||||
|
||||
@@ -4,10 +4,6 @@ namespace Appwrite\Platform\Modules\Health\Http\Health\Queue\StatsUsage;
|
||||
|
||||
use Appwrite\Event\Publisher\Usage as UsagePublisher;
|
||||
use Appwrite\Platform\Modules\Health\Http\Health\Queue\Base;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Validator\Integer;
|
||||
@@ -27,20 +23,6 @@ class Get extends Base
|
||||
->desc('Get stats usage queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueUsage',
|
||||
description: '/docs/references/health/get-queue-stats-usage.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_QUEUE,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('publisherForUsage')
|
||||
->inject('response')
|
||||
|
||||
@@ -4,10 +4,6 @@ namespace Appwrite\Platform\Modules\Health\Http\Health\Queue\Webhooks;
|
||||
|
||||
use Appwrite\Event\Webhook;
|
||||
use Appwrite\Platform\Modules\Health\Http\Health\Queue\Base;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Validator\Integer;
|
||||
@@ -27,20 +23,6 @@ class Get extends Base
|
||||
->desc('Get webhooks queue')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'queue',
|
||||
name: 'getQueueWebhooks',
|
||||
description: '/docs/references/health/get-queue-webhooks.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_QUEUE,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true)
|
||||
->inject('queueForWebhooks')
|
||||
->inject('response')
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
|
||||
namespace Appwrite\Platform\Modules\Health\Http\Health\Storage;
|
||||
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Platform\Action;
|
||||
@@ -29,20 +25,6 @@ class Get extends Action
|
||||
->desc('Get storage')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'storage',
|
||||
name: 'getStorage',
|
||||
description: '/docs/references/health/get-storage.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_STATUS,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->inject('deviceForFiles')
|
||||
->inject('deviceForFunctions')
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
namespace Appwrite\Platform\Modules\Health\Http\Health\Storage\Local;
|
||||
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Platform\Action;
|
||||
@@ -30,20 +26,6 @@ class Get extends Action
|
||||
->desc('Get local storage')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'storage',
|
||||
name: 'getStorageLocal',
|
||||
description: '/docs/references/health/get-storage-local.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_STATUS,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->callback($this->action(...));
|
||||
}
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
namespace Appwrite\Platform\Modules\Health\Http\Health\Time;
|
||||
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
use Appwrite\SDK\Response as SDKResponse;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Platform\Action;
|
||||
@@ -29,20 +25,6 @@ class Get extends Action
|
||||
->desc('Get time')
|
||||
->groups(['api', 'health'])
|
||||
->label('scope', 'health.read')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'health',
|
||||
group: 'health',
|
||||
name: 'getTime',
|
||||
description: '/docs/references/health/get-time.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: Response::STATUS_CODE_OK,
|
||||
model: Response::MODEL_HEALTH_TIME,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
))
|
||||
->inject('response')
|
||||
->callback($this->action(...));
|
||||
}
|
||||
|
||||
@@ -258,17 +258,6 @@ trait Base
|
||||
public const string UPDATE_FILE = 'update_file';
|
||||
public const string DELETE_FILE = 'delete_file';
|
||||
|
||||
// Health
|
||||
public const string GET_HTTP_HEALTH = 'get_http_health';
|
||||
public const string GET_DB_HEALTH = 'get_db_health';
|
||||
public const string GET_CACHE_HEALTH = 'get_cache_health';
|
||||
public const string GET_TIME_HEALTH = 'get_time_health';
|
||||
public const string GET_WEBHOOKS_QUEUE_HEALTH = 'get_webhooks_queue_health';
|
||||
public const string GET_CERTIFICATES_QUEUE_HEALTH = 'get_certificates_queue_health';
|
||||
public const string GET_FUNCTION_QUEUE_HEALTH = 'get_functions_queue_health';
|
||||
public const string GET_LOCAL_STORAGE_HEALTH = 'get_local_storage_health';
|
||||
public const string GET_ANITVIRUS_HEALTH = 'get_antivirus_health';
|
||||
|
||||
// Localization
|
||||
public const string GET_LOCALE = 'get_locale';
|
||||
public const string LIST_COUNTRIES = 'list_countries';
|
||||
@@ -2409,73 +2398,6 @@ trait Base
|
||||
status
|
||||
}
|
||||
}';
|
||||
case self::GET_HTTP_HEALTH:
|
||||
return 'query getHttpHealth {
|
||||
healthGet {
|
||||
ping
|
||||
status
|
||||
}
|
||||
}';
|
||||
case self::GET_DB_HEALTH:
|
||||
return 'query getDbHealth {
|
||||
healthGetDB {
|
||||
statuses {
|
||||
ping
|
||||
status
|
||||
}
|
||||
total
|
||||
}
|
||||
}';
|
||||
case self::GET_CACHE_HEALTH:
|
||||
return 'query getCacheHealth {
|
||||
healthGetCache {
|
||||
statuses {
|
||||
ping
|
||||
status
|
||||
}
|
||||
total
|
||||
}
|
||||
}';
|
||||
case self::GET_TIME_HEALTH:
|
||||
return 'query getTimeHealth {
|
||||
healthGetTime {
|
||||
remoteTime
|
||||
localTime
|
||||
diff
|
||||
}
|
||||
}';
|
||||
case self::GET_WEBHOOKS_QUEUE_HEALTH:
|
||||
return 'query getWebhooksQueueHealth {
|
||||
healthGetQueueWebhooks {
|
||||
size
|
||||
}
|
||||
}';
|
||||
case self::GET_CERTIFICATES_QUEUE_HEALTH:
|
||||
return 'query getCertificatesQueueHealth {
|
||||
healthGetQueueCertificates {
|
||||
size
|
||||
}
|
||||
}';
|
||||
case self::GET_FUNCTION_QUEUE_HEALTH:
|
||||
return 'query getFunctionQueueHealth {
|
||||
healthGetQueueFunctions {
|
||||
size
|
||||
}
|
||||
}';
|
||||
case self::GET_LOCAL_STORAGE_HEALTH:
|
||||
return 'query getLocalStorageHealth {
|
||||
healthGetStorageLocal {
|
||||
ping
|
||||
status
|
||||
}
|
||||
}';
|
||||
case self::GET_ANITVIRUS_HEALTH:
|
||||
return 'query getAntivirusHealth {
|
||||
healthGetAntivirus {
|
||||
version
|
||||
status
|
||||
}
|
||||
}';
|
||||
case self::CREATE_MAILGUN_PROVIDER:
|
||||
return 'mutation createMailgunProvider($providerId: String!, $name: String!, $domain: String!, $apiKey: String!, $fromName: String!, $fromEmail: String!, $isEuRegion: Boolean!, $replyToName: String, $replyToEmail: String) {
|
||||
messagingCreateMailgunProvider(providerId: $providerId, name: $name, domain: $domain, apiKey: $apiKey, fromName: $fromName, fromEmail: $fromEmail, isEuRegion: $isEuRegion, replyToName: $replyToName, replyToEmail: $replyToEmail) {
|
||||
|
||||
@@ -1,210 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\E2E\Services\GraphQL;
|
||||
|
||||
use Tests\E2E\Client;
|
||||
use Tests\E2E\Scopes\ProjectCustom;
|
||||
use Tests\E2E\Scopes\Scope;
|
||||
use Tests\E2E\Scopes\SideServer;
|
||||
|
||||
final class HealthTest extends Scope
|
||||
{
|
||||
use ProjectCustom;
|
||||
use SideServer;
|
||||
use Base;
|
||||
|
||||
public function testGetHTTPHealth(): array
|
||||
{
|
||||
$projectId = $this->getProject()['$id'];
|
||||
$query = $this->getQuery(self::GET_HTTP_HEALTH);
|
||||
$graphQLPayload = [
|
||||
'query' => $query,
|
||||
];
|
||||
|
||||
$httpHealth = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()), $graphQLPayload);
|
||||
|
||||
$this->assertIsArray($httpHealth['body']['data']);
|
||||
$this->assertArrayNotHasKey('errors', $httpHealth['body']);
|
||||
$httpHealth = $httpHealth['body']['data']['healthGet'];
|
||||
$this->assertIsArray($httpHealth);
|
||||
|
||||
return $httpHealth;
|
||||
}
|
||||
|
||||
public function testGetDBHealth(): array
|
||||
{
|
||||
$projectId = $this->getProject()['$id'];
|
||||
$query = $this->getQuery(self::GET_DB_HEALTH);
|
||||
$graphQLPayload = [
|
||||
'query' => $query,
|
||||
];
|
||||
|
||||
$dbHealth = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()), $graphQLPayload);
|
||||
|
||||
$this->assertIsArray($dbHealth['body']['data']);
|
||||
$this->assertArrayNotHasKey('errors', $dbHealth['body']);
|
||||
$dbHealth = $dbHealth['body']['data']['healthGetDB'];
|
||||
$this->assertIsArray($dbHealth);
|
||||
$this->assertIsArray($dbHealth['statuses']);
|
||||
$this->assertGreaterThan(0, $dbHealth['total']);
|
||||
|
||||
return $dbHealth;
|
||||
}
|
||||
|
||||
public function testGetCacheHealth(): array
|
||||
{
|
||||
$projectId = $this->getProject()['$id'];
|
||||
$query = $this->getQuery(self::GET_CACHE_HEALTH);
|
||||
$graphQLPayload = [
|
||||
'query' => $query,
|
||||
];
|
||||
|
||||
$cacheHealth = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()), $graphQLPayload);
|
||||
|
||||
$this->assertIsArray($cacheHealth['body']['data']);
|
||||
$this->assertArrayNotHasKey('errors', $cacheHealth['body']);
|
||||
$cacheHealth = $cacheHealth['body']['data']['healthGetCache'];
|
||||
$this->assertIsArray($cacheHealth);
|
||||
$this->assertIsArray($cacheHealth['statuses']);
|
||||
$this->assertGreaterThan(0, $cacheHealth['total']);
|
||||
|
||||
return $cacheHealth;
|
||||
}
|
||||
|
||||
public function testGetTimeHealth(): array
|
||||
{
|
||||
$projectId = $this->getProject()['$id'];
|
||||
$query = $this->getQuery(self::GET_TIME_HEALTH);
|
||||
$graphQLPayload = [
|
||||
'query' => $query,
|
||||
];
|
||||
|
||||
$timeHealth = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()), $graphQLPayload);
|
||||
|
||||
$this->assertIsArray($timeHealth['body']['data']);
|
||||
$this->assertArrayNotHasKey('errors', $timeHealth['body']);
|
||||
$timeHealth = $timeHealth['body']['data']['healthGetTime'];
|
||||
$this->assertIsArray($timeHealth);
|
||||
|
||||
return $timeHealth;
|
||||
}
|
||||
|
||||
public function testGetWebhooksQueueHealth(): array
|
||||
{
|
||||
$projectId = $this->getProject()['$id'];
|
||||
$query = $this->getQuery(self::GET_WEBHOOKS_QUEUE_HEALTH);
|
||||
$graphQLPayload = [
|
||||
'query' => $query,
|
||||
];
|
||||
|
||||
$webhooksQueueHealth = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()), $graphQLPayload);
|
||||
|
||||
$this->assertIsArray($webhooksQueueHealth['body']['data']);
|
||||
$this->assertArrayNotHasKey('errors', $webhooksQueueHealth['body']);
|
||||
$webhooksQueueHealth = $webhooksQueueHealth['body']['data']['healthGetQueueWebhooks'];
|
||||
$this->assertIsArray($webhooksQueueHealth);
|
||||
|
||||
return $webhooksQueueHealth;
|
||||
}
|
||||
|
||||
public function testGetCertificatesQueueHealth(): array
|
||||
{
|
||||
$projectId = $this->getProject()['$id'];
|
||||
$query = $this->getQuery(self::GET_CERTIFICATES_QUEUE_HEALTH);
|
||||
$graphQLPayload = [
|
||||
'query' => $query,
|
||||
];
|
||||
|
||||
$certificatesQueueHealth = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()), $graphQLPayload);
|
||||
|
||||
$this->assertIsArray($certificatesQueueHealth['body']['data']);
|
||||
$this->assertArrayNotHasKey('errors', $certificatesQueueHealth['body']);
|
||||
$certificatesQueueHealth = $certificatesQueueHealth['body']['data']['healthGetQueueCertificates'];
|
||||
$this->assertIsArray($certificatesQueueHealth);
|
||||
|
||||
return $certificatesQueueHealth;
|
||||
}
|
||||
|
||||
public function testGetFunctionsQueueHealth(): array
|
||||
{
|
||||
$projectId = $this->getProject()['$id'];
|
||||
$query = $this->getQuery(self::GET_FUNCTION_QUEUE_HEALTH);
|
||||
$graphQLPayload = [
|
||||
'query' => $query,
|
||||
];
|
||||
|
||||
$functionsQueueHealth = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()), $graphQLPayload);
|
||||
|
||||
$this->assertIsArray($functionsQueueHealth['body']['data']);
|
||||
$this->assertArrayNotHasKey('errors', $functionsQueueHealth['body']);
|
||||
$functionsQueueHealth = $functionsQueueHealth['body']['data']['healthGetQueueFunctions'];
|
||||
$this->assertIsArray($functionsQueueHealth);
|
||||
|
||||
return $functionsQueueHealth;
|
||||
}
|
||||
|
||||
public function testGetLocalStorageHealth(): array
|
||||
{
|
||||
$projectId = $this->getProject()['$id'];
|
||||
$query = $this->getQuery(self::GET_LOCAL_STORAGE_HEALTH);
|
||||
$graphQLPayload = [
|
||||
'query' => $query,
|
||||
];
|
||||
|
||||
$localStorageHealth = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()), $graphQLPayload);
|
||||
|
||||
$this->assertIsArray($localStorageHealth['body']['data']);
|
||||
$this->assertArrayNotHasKey('errors', $localStorageHealth['body']);
|
||||
$localStorageHealth = $localStorageHealth['body']['data']['healthGetStorageLocal'];
|
||||
$this->assertIsArray($localStorageHealth);
|
||||
|
||||
return $localStorageHealth;
|
||||
}
|
||||
|
||||
public function testGetAntiVirusHealth(): array
|
||||
{
|
||||
$projectId = $this->getProject()['$id'];
|
||||
$query = $this->getQuery(self::GET_ANITVIRUS_HEALTH);
|
||||
$graphQLPayload = [
|
||||
'query' => $query,
|
||||
];
|
||||
|
||||
$antiVirusHealth = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()), $graphQLPayload);
|
||||
|
||||
$this->assertIsArray($antiVirusHealth['body']['data']);
|
||||
$this->assertArrayNotHasKey('errors', $antiVirusHealth['body']);
|
||||
$antiVirusHealth = $antiVirusHealth['body']['data']['healthGetAntivirus'];
|
||||
$this->assertIsArray($antiVirusHealth);
|
||||
|
||||
return $antiVirusHealth;
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,6 @@ trait ServicesBase
|
||||
'databases' => ['method' => Client::METHOD_GET, 'path' => '/databases'],
|
||||
'tablesdb' => ['method' => Client::METHOD_GET, 'path' => '/tablesdb'],
|
||||
'locale' => ['method' => Client::METHOD_GET, 'path' => '/locale'],
|
||||
'health' => ['method' => Client::METHOD_GET, 'path' => '/health'],
|
||||
'project' => ['method' => Client::METHOD_GET, 'path' => '/project/platforms'],
|
||||
'storage' => ['method' => Client::METHOD_GET, 'path' => '/storage/buckets'],
|
||||
'teams' => ['method' => Client::METHOD_GET, 'path' => '/teams'],
|
||||
@@ -177,7 +176,6 @@ trait ServicesBase
|
||||
'databases' => ['method' => Client::METHOD_GET, 'path' => '/databases'],
|
||||
'tablesdb' => ['method' => Client::METHOD_GET, 'path' => '/tablesdb'],
|
||||
'locale' => ['method' => Client::METHOD_GET, 'path' => '/locale'],
|
||||
'health' => ['method' => Client::METHOD_GET, 'path' => '/health'],
|
||||
'project' => ['method' => Client::METHOD_GET, 'path' => '/project/platforms'],
|
||||
'storage' => ['method' => Client::METHOD_GET, 'path' => '/storage/buckets'],
|
||||
'teams' => ['method' => Client::METHOD_GET, 'path' => '/teams'],
|
||||
|
||||
Reference in new issue
Block a user