mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge remote-tracking branch 'origin/sync-mongodb' into sync-mongodb
This commit is contained in:
@@ -534,7 +534,7 @@ class Event
|
||||
$parsed = self::parseEventPattern($pattern);
|
||||
// to switch the resource types from databases to the required prefix
|
||||
// eg; all databases events get fired with databases. prefix which mainly depicts legacy type
|
||||
// so a projection from databases to the actual prefix(documentsdb, vectordb,etc)
|
||||
// so a projection from databases to the actual prefix(documentsdb, vectorsdb,etc)
|
||||
if ((str_contains($pattern, 'databases.') && $database && $database->getAttribute('type') !== 'legacy')) {
|
||||
$parsed = self::getDatabaseTypeEvents($database, $parsed);
|
||||
}
|
||||
@@ -746,8 +746,8 @@ class Event
|
||||
];
|
||||
break;
|
||||
case 'documentsdb':
|
||||
case 'vectordb':
|
||||
// sending the type itself(eg: documentsdb, vectordb)
|
||||
case 'vectorsdb':
|
||||
// sending the type itself(eg: documentsdb, vectorsdb)
|
||||
$eventMap = [
|
||||
'databases' => $database->getAttribute('type')
|
||||
];
|
||||
|
||||
@@ -493,7 +493,7 @@ class Realtime extends MessagingAdapter
|
||||
case 'databases':
|
||||
case 'tablesdb':
|
||||
case 'documentsdb':
|
||||
case 'vectordb':
|
||||
case 'vectorsdb':
|
||||
$resource = $parts[4] ?? '';
|
||||
if (in_array($resource, ['columns', 'attributes', 'indexes'])) {
|
||||
$channels[] = 'console';
|
||||
@@ -627,7 +627,7 @@ class Realtime extends MessagingAdapter
|
||||
break;
|
||||
|
||||
case 'documentsdb':
|
||||
case 'vectordb':
|
||||
case 'vectorsdb':
|
||||
$channels[] = 'documents';
|
||||
$channels[] = "{$basePrefix}.{$databaseId}.collections.{$resourceId}.documents";
|
||||
$channels[] = "{$basePrefix}.{$databaseId}.collections.{$resourceId}.documents.{$payloadId}";
|
||||
|
||||
@@ -26,7 +26,7 @@ const COLLECTIONS = 'collection';
|
||||
const LEGACY = 'legacy';
|
||||
const TABLESDB = 'tablesdb';
|
||||
const DOCUMENTSDB = 'documentsdb';
|
||||
const VECTORDB = 'vectordb';
|
||||
const VECTORSDB = 'vectorsdb';
|
||||
|
||||
const MIN_VECTOR_DIMENSION = 1;
|
||||
const MAX_VECTOR_DIMENSION = 16000;
|
||||
|
||||
@@ -25,8 +25,8 @@ class Action extends AppwriteAction
|
||||
if (\str_contains($path, '/documentsdb')) {
|
||||
$this->context = DATABASE_TYPE_DOCUMENTSDB;
|
||||
}
|
||||
if (\str_contains($path, '/vectordb')) {
|
||||
$this->context = DATABASE_TYPE_VECTORDB;
|
||||
if (\str_contains($path, '/vectorsdb')) {
|
||||
$this->context = DATABASE_TYPE_VECTORSDB;
|
||||
}
|
||||
return parent::setHttpPath($path);
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@ abstract class Action extends UtopiaAction
|
||||
if (\str_contains($path, '/tablesdb')) {
|
||||
$this->context = TABLES;
|
||||
$this->databaseType = TABLESDB;
|
||||
} elseif (\str_contains($path, '/vectordb')) {
|
||||
$this->databaseType = VECTORDB;
|
||||
} elseif (\str_contains($path, '/vectorsdb')) {
|
||||
$this->databaseType = VECTORSDB;
|
||||
}
|
||||
return parent::setHttpPath($path);
|
||||
}
|
||||
|
||||
+2
-2
@@ -30,8 +30,8 @@ abstract class Action extends DatabasesAction
|
||||
$this->context = ROWS;
|
||||
} elseif (str_contains($path, '/documentsdb/')) {
|
||||
$this->databaseType = DATABASE_TYPE_DOCUMENTSDB;
|
||||
} elseif (str_contains($path, '/vectordb/')) {
|
||||
$this->databaseType = DATABASE_TYPE_VECTORDB;
|
||||
} elseif (str_contains($path, '/vectorsdb/')) {
|
||||
$this->databaseType = DATABASE_TYPE_VECTORSDB;
|
||||
}
|
||||
|
||||
$contextId = '$' . $this->getCollectionsEventsContext() . 'Id';
|
||||
|
||||
@@ -64,13 +64,13 @@ class Create extends Action
|
||||
$databaseSharedTables = \explode(',', System::getEnv('_APP_DATABASE_DOCUMENTSDB_SHARED_TABLES', ''));
|
||||
$databaseSharedTablesV1 = \explode(',', System::getEnv('_APP_DATABASE_DOCUMENTSDB_SHARED_TABLES_V1', ''));
|
||||
break;
|
||||
case VECTORDB:
|
||||
$databases = Config::getParam('pools-vectordb', []);
|
||||
$databaseKeys = System::getEnv('_APP_DATABASE_VECTORDB_KEYS', '');
|
||||
$databaseOverride = System::getEnv('_APP_DATABASE_VECTORDB_OVERRIDE');
|
||||
$dbScheme = System::getEnv('_APP_DB_HOST_VECTORDB', 'postgresql');
|
||||
$databaseSharedTables = \explode(',', System::getEnv('_APP_DATABASE_VECTORDB_SHARED_TABLES', ''));
|
||||
$databaseSharedTablesV1 = \explode(',', System::getEnv('_APP_DATABASE_VECTORDB_SHARED_TABLES_V1', ''));
|
||||
case VECTORSDB:
|
||||
$databases = Config::getParam('pools-vectorsdb', []);
|
||||
$databaseKeys = System::getEnv('_APP_DATABASE_VECTORSDB_KEYS', '');
|
||||
$databaseOverride = System::getEnv('_APP_DATABASE_VECTORSDB_OVERRIDE');
|
||||
$dbScheme = System::getEnv('_APP_DB_HOST_VECTORSDB', 'postgresql');
|
||||
$databaseSharedTables = \explode(',', System::getEnv('_APP_DATABASE_VECTORSDB_SHARED_TABLES', ''));
|
||||
$databaseSharedTablesV1 = \explode(',', System::getEnv('_APP_DATABASE_VECTORSDB_SHARED_TABLES_V1', ''));
|
||||
break;
|
||||
default:
|
||||
// legacy/tablesdb
|
||||
@@ -143,7 +143,7 @@ class Create extends Action
|
||||
protected function getDatabaseCollection()
|
||||
{
|
||||
return match ($this->getDatabaseType()) {
|
||||
'vectordb' => (Config::getParam('collections', [])['vectordb'] ?? [])['collections'] ?? [],
|
||||
'vectorsdb' => (Config::getParam('collections', [])['vectorsdb'] ?? [])['collections'] ?? [],
|
||||
default => (Config::getParam('collections', [])['databases'] ?? [])['collections'] ?? [],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -45,9 +45,9 @@ abstract class Action extends DatabasesAction
|
||||
$this->context = COLLECTIONS;
|
||||
$this->databaseType = DOCUMENTSDB;
|
||||
break;
|
||||
case str_contains($path, '/vectordb'):
|
||||
case str_contains($path, '/vectorsdb'):
|
||||
$this->context = COLLECTIONS;
|
||||
$this->databaseType = VECTORDB;
|
||||
$this->databaseType = VECTORSDB;
|
||||
break;
|
||||
}
|
||||
return parent::setHttpPath($path);
|
||||
|
||||
@@ -169,7 +169,7 @@ class Update extends Action
|
||||
$databaseDoc = null;
|
||||
switch ($this->getDatabaseType()) {
|
||||
case DATABASE_TYPE_DOCUMENTSDB:
|
||||
case DATABASE_TYPE_VECTORDB:
|
||||
case DATABASE_TYPE_VECTORSDB:
|
||||
$databaseDoc = $authorization->skip(fn () => $dbForProject->findOne('databases', [
|
||||
Query::equal('$sequence', [$firstOperation['databaseInternalId']])
|
||||
]));
|
||||
|
||||
@@ -32,7 +32,7 @@ class Get extends Action
|
||||
{
|
||||
$this->databaseType = match (true) {
|
||||
str_contains($path, '/documentsdb') => DATABASE_TYPE_DOCUMENTSDB,
|
||||
str_contains($path, '/vectordb') => DATABASE_TYPE_VECTORDB,
|
||||
str_contains($path, '/vectorsdb') => DATABASE_TYPE_VECTORSDB,
|
||||
default => DATABASE_TYPE_LEGACY,
|
||||
};
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class XList extends Action
|
||||
{
|
||||
$this->databaseType = match (true) {
|
||||
str_contains($path, '/documentsdb') => DATABASE_TYPE_DOCUMENTSDB,
|
||||
str_contains($path, '/vectordb') => DATABASE_TYPE_VECTORDB,
|
||||
str_contains($path, '/vectorsdb') => DATABASE_TYPE_VECTORSDB,
|
||||
default => DATABASE_TYPE_LEGACY,
|
||||
};
|
||||
|
||||
|
||||
+7
-7
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections;
|
||||
|
||||
use Appwrite\Event\Event;
|
||||
use Appwrite\Extend\Exception;
|
||||
@@ -32,19 +32,19 @@ class Create extends CollectionAction
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'createVectorDBCollection';
|
||||
return 'createVectorsDBCollection';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
{
|
||||
return UtopiaResponse::MODEL_VECTORDB_COLLECTION;
|
||||
return UtopiaResponse::MODEL_VECTORSDB_COLLECTION;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_POST)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections')
|
||||
->desc('Create collection')
|
||||
->groups(['api', 'database'])
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].create')
|
||||
@@ -53,10 +53,10 @@ class Create extends CollectionAction
|
||||
->label('audits.event', 'collection.create')
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: 'collections',
|
||||
name: 'createCollection',
|
||||
description: '/docs/references/vectordb/create-collection.md',
|
||||
description: '/docs/references/vectorsdb/create-collection.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
@@ -119,7 +119,7 @@ class Create extends CollectionAction
|
||||
|
||||
$attributes = [];
|
||||
$indexes = [];
|
||||
$collections = (Config::getParam('collections', [])['vectordb'] ?? [])['collections'] ?? [];
|
||||
$collections = (Config::getParam('collections', [])['vectorsdb'] ?? [])['collections'] ?? [];
|
||||
foreach ($collections['defaultAttributes'] as $attribute) {
|
||||
if ($attribute['$id'] === 'embeddings') {
|
||||
$attribute['size'] = $dimension;
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Delete as CollectionDelete;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,19 +15,19 @@ class Delete extends CollectionDelete
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'deleteVectorDBCollection';
|
||||
return 'deleteVectorsDBCollection';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
{
|
||||
return UtopiaResponse::MODEL_VECTORDB_COLLECTION;
|
||||
return UtopiaResponse::MODEL_VECTORSDB_COLLECTION;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId')
|
||||
->desc('Delete collection')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'collections.write')
|
||||
@@ -36,10 +36,10 @@ class Delete extends CollectionDelete
|
||||
->label('audits.event', 'collection.delete')
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: 'collections',
|
||||
name: 'deleteCollection',
|
||||
description: '/docs/references/vectordb/delete-collection.md',
|
||||
description: '/docs/references/vectorsdb/delete-collection.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Bulk;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Bulk;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Bulk\Delete as DocumentsDelete;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,7 +17,7 @@ class Delete extends DocumentsDelete
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'deleteVectorDBDocuments';
|
||||
return 'deleteVectorsDBDocuments';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -29,7 +29,7 @@ class Delete extends DocumentsDelete
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents')
|
||||
->desc('Delete documents')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'documents.write')
|
||||
@@ -40,10 +40,10 @@ class Delete extends DocumentsDelete
|
||||
->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT)
|
||||
->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: $this->getSdkGroup(),
|
||||
name: 'deleteDocuments',
|
||||
description: '/docs/references/vectordb/delete-documents.md',
|
||||
description: '/docs/references/vectorsdb/delete-documents.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Bulk;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Bulk;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Bulk\Update as DocumentsUpdate;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -18,7 +18,7 @@ class Update extends DocumentsUpdate
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'updateVectorDBDocuments';
|
||||
return 'updateVectorsDBDocuments';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -30,7 +30,7 @@ class Update extends DocumentsUpdate
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents')
|
||||
->desc('Update documents')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'documents.write')
|
||||
@@ -41,10 +41,10 @@ class Update extends DocumentsUpdate
|
||||
->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2)
|
||||
->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: $this->getSdkGroup(),
|
||||
name: 'updateDocuments',
|
||||
description: '/docs/references/vectordb/update-documents.md',
|
||||
description: '/docs/references/vectorsdb/update-documents.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Bulk;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Bulk;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Bulk\Upsert as DocumentsUpsert;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,7 +17,7 @@ class Upsert extends DocumentsUpsert
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'upsertVectorDBDocuments';
|
||||
return 'upsertVectorsDBDocuments';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -29,7 +29,7 @@ class Upsert extends DocumentsUpsert
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_PUT)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents')
|
||||
->desc('Upsert documents')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'documents.write')
|
||||
@@ -41,10 +41,10 @@ class Upsert extends DocumentsUpsert
|
||||
->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT)
|
||||
->label('sdk', [
|
||||
new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: $this->getSdkGroup(),
|
||||
name: 'upsertDocuments',
|
||||
description: '/docs/references/vectordb/upsert-documents.md',
|
||||
description: '/docs/references/vectorsdb/upsert-documents.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+7
-7
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Create as DocumentCreate;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -21,7 +21,7 @@ class Create extends DocumentCreate
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'createVectorDBDocument';
|
||||
return 'createVectorsDBDocument';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -38,7 +38,7 @@ class Create extends DocumentCreate
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_POST)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents')
|
||||
->desc('Create document')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'documents.write')
|
||||
@@ -50,11 +50,11 @@ class Create extends DocumentCreate
|
||||
->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT)
|
||||
->label('sdk', [
|
||||
new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: $this->getSdkGroup(),
|
||||
name: 'createDocument',
|
||||
desc: 'Create document',
|
||||
description: '/docs/references/vectordb/create-document.md',
|
||||
description: '/docs/references/vectorsdb/create-document.md',
|
||||
auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
@@ -72,11 +72,11 @@ class Create extends DocumentCreate
|
||||
]
|
||||
),
|
||||
new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: $this->getSdkGroup(),
|
||||
name: 'createDocuments',
|
||||
desc: 'Create documents',
|
||||
description: '/docs/references/vectordb/create-documents.md',
|
||||
description: '/docs/references/vectorsdb/create-documents.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Delete as DocumentDelete;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,7 +15,7 @@ class Delete extends DocumentDelete
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'deleteVectorDBDocument';
|
||||
return 'deleteVectorsDBDocument';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -33,7 +33,7 @@ class Delete extends DocumentDelete
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents/:documentId')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents/:documentId')
|
||||
->desc('Delete document')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'documents.write')
|
||||
@@ -45,10 +45,10 @@ class Delete extends DocumentDelete
|
||||
->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT)
|
||||
->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: $this->getSdkGroup(),
|
||||
name: 'deleteDocument',
|
||||
description: '/docs/references/vectordb/delete-document.md',
|
||||
description: '/docs/references/vectorsdb/delete-document.md',
|
||||
auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Get as DocumentGet;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,7 +17,7 @@ class Get extends DocumentGet
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'getVectorDBDocument';
|
||||
return 'getVectorsDBDocument';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -29,16 +29,16 @@ class Get extends DocumentGet
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents/:documentId')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents/:documentId')
|
||||
->desc('Get document')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'documents.read')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: $this->getSdkGroup(),
|
||||
name: 'getDocument',
|
||||
description: '/docs/references/vectordb/get-document.md',
|
||||
description: '/docs/references/vectorsdb/get-document.md',
|
||||
auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Logs;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Logs;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Logs\XList as DocumentLogXList;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,23 +17,23 @@ class XList extends DocumentLogXList
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'listVectorDBDocumentLogs';
|
||||
return 'listVectorsDBDocumentLogs';
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents/:documentId/logs')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents/:documentId/logs')
|
||||
->desc('List document logs')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'documents.read')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: 'logs',
|
||||
name: 'listDocumentLogs',
|
||||
description: '/docs/references/vectordb/get-document-logs.md',
|
||||
description: '/docs/references/vectorsdb/get-document-logs.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Update as DocumentUpdate;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -18,7 +18,7 @@ class Update extends DocumentUpdate
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'updateVectorDBDocument';
|
||||
return 'updateVectorsDBDocument';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -30,7 +30,7 @@ class Update extends DocumentUpdate
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents/:documentId')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents/:documentId')
|
||||
->desc('Update document')
|
||||
->groups(['api', 'database'])
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].update')
|
||||
@@ -42,10 +42,10 @@ class Update extends DocumentUpdate
|
||||
->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2)
|
||||
->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: $this->getSdkGroup(),
|
||||
name: 'updateDocument',
|
||||
description: '/docs/references/vectordb/update-document.md',
|
||||
description: '/docs/references/vectorsdb/update-document.md',
|
||||
auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Upsert as DocumentUpsert;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -19,7 +19,7 @@ class Upsert extends DocumentUpsert
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'upsertVectorDBDocument';
|
||||
return 'upsertVectorsDBDocument';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -31,7 +31,7 @@ class Upsert extends DocumentUpsert
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_PUT)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents/:documentId')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents/:documentId')
|
||||
->desc('Upsert a document')
|
||||
->groups(['api', 'database'])
|
||||
->label('event', 'databases.[databaseId].collections.[collectionId].documents.[documentId].upsert')
|
||||
@@ -44,10 +44,10 @@ class Upsert extends DocumentUpsert
|
||||
->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT)
|
||||
->label('sdk', [
|
||||
new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: $this->getSdkGroup(),
|
||||
name: 'upsertDocument',
|
||||
description: '/docs/references/vectordb/upsert-document.md',
|
||||
description: '/docs/references/vectorsdb/upsert-document.md',
|
||||
auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\XList as DocumentXList;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -19,7 +19,7 @@ class XList extends DocumentXList
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'listVectorDBDocuments';
|
||||
return 'listVectorsDBDocuments';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -31,16 +31,16 @@ class XList extends DocumentXList
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/documents')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/documents')
|
||||
->desc('List documents')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'documents.read')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: $this->getSdkGroup(),
|
||||
name: 'listDocuments',
|
||||
description: '/docs/references/vectordb/list-documents.md',
|
||||
description: '/docs/references/vectorsdb/list-documents.md',
|
||||
auth: [AuthType::ADMIN, AuthType::SESSION, AuthType::KEY, AuthType::JWT],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Get as CollectionGet;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,28 +15,28 @@ class Get extends CollectionGet
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'getVectorDBCollection';
|
||||
return 'getVectorsDBCollection';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
{
|
||||
return UtopiaResponse::MODEL_VECTORDB_COLLECTION;
|
||||
return UtopiaResponse::MODEL_VECTORSDB_COLLECTION;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId')
|
||||
->desc('Get collection')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'collections.read')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: 'collections',
|
||||
name: 'getCollection',
|
||||
description: '/docs/references/vectordb/get-collection.md',
|
||||
description: '/docs/references/vectorsdb/get-collection.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Indexes;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Indexes;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes\Create as IndexCreate;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -21,7 +21,7 @@ class Create extends IndexCreate
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'createVectorDBIndex';
|
||||
return 'createVectorsDBIndex';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -33,7 +33,7 @@ class Create extends IndexCreate
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_POST)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/indexes')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/indexes')
|
||||
->desc('Create index')
|
||||
->groups(['api', 'database'])
|
||||
->label('event', 'databases.[databaseId].tables.[tableId].indexes.[indexId].create')
|
||||
@@ -42,10 +42,10 @@ class Create extends IndexCreate
|
||||
->label('audits.event', 'index.create')
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.tableId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: $this->getSdkGroup(),
|
||||
name: 'createIndex',
|
||||
description: '/docs/references/vectordb/create-index.md',
|
||||
description: '/docs/references/vectorsdb/create-index.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Indexes;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Indexes;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes\Delete as IndexDelete;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -16,7 +16,7 @@ class Delete extends IndexDelete
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'deleteVectorDBIndex';
|
||||
return 'deleteVectorsDBIndex';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,7 +32,7 @@ class Delete extends IndexDelete
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/indexes/:key')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/indexes/:key')
|
||||
->desc('Delete index')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'collections.write')
|
||||
@@ -41,10 +41,10 @@ class Delete extends IndexDelete
|
||||
->label('audits.event', 'index.delete')
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: $this->getSdkGroup(),
|
||||
name: 'deleteIndex', // getName needs to be different from parent action to avoid conflict in path name
|
||||
description: '/docs/references/vectordb/delete-index.md',
|
||||
description: '/docs/references/vectorsdb/delete-index.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Indexes;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Indexes;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes\Get as IndexGet;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -16,7 +16,7 @@ class Get extends IndexGet
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'getVectorDBIndex';
|
||||
return 'getVectorsDBIndex';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -28,16 +28,16 @@ class Get extends IndexGet
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/indexes/:key')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/indexes/:key')
|
||||
->desc('Get index')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'collections.read')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: $this->getSdkGroup(),
|
||||
name: 'getIndex', // getName needs to be different from parent action to avoid conflict in path name
|
||||
description: '/docs/references/vectordb/get-index.md',
|
||||
description: '/docs/references/vectorsdb/get-index.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Indexes;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Indexes;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Indexes\XList as IndexXList;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,7 +17,7 @@ class XList extends IndexXList
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'listVectorDBIndexes';
|
||||
return 'listVectorsDBIndexes';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -29,16 +29,16 @@ class XList extends IndexXList
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/indexes')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/indexes')
|
||||
->desc('List indexes')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'collections.read')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: $this->getSdkGroup(),
|
||||
name: 'listIndexes', // getName needs to be different from parent action to avoid conflict in path name
|
||||
description: '/docs/references/vectordb/list-indexes.md',
|
||||
description: '/docs/references/vectorsdb/list-indexes.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Logs;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Logs;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Logs\XList as CollectionLogXList;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,23 +17,23 @@ class XList extends CollectionLogXList
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'listVectorDBCollectionLogs';
|
||||
return 'listVectorsDBCollectionLogs';
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/logs')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/logs')
|
||||
->desc('List collection logs')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'collections.read')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: $this->getSdkGroup(),
|
||||
name: 'listCollectionLogs',
|
||||
description: '/docs/references/vectordb/get-collection-logs.md',
|
||||
description: '/docs/references/vectorsdb/get-collection-logs.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+7
-7
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections;
|
||||
|
||||
use Appwrite\Event\Event;
|
||||
use Appwrite\Extend\Exception;
|
||||
@@ -24,19 +24,19 @@ class Update extends CollectionAction
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'updateVectorDBCollection';
|
||||
return 'updateVectorsDBCollection';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
{
|
||||
return UtopiaResponse::MODEL_VECTORDB_COLLECTION;
|
||||
return UtopiaResponse::MODEL_VECTORSDB_COLLECTION;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_PUT)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId')
|
||||
->desc('Update collection')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'collections.write')
|
||||
@@ -45,15 +45,15 @@ class Update extends CollectionAction
|
||||
->label('audits.event', 'collection.update')
|
||||
->label('audits.resource', 'database/{request.databaseId}/collection/{request.collectionId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: 'collections',
|
||||
name: 'updateCollection',
|
||||
description: '/docs/references/vectordb/update-collection.md',
|
||||
description: '/docs/references/vectorsdb/update-collection.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: SwooleResponse::STATUS_CODE_OK,
|
||||
model: UtopiaResponse::MODEL_VECTORDB_COLLECTION,
|
||||
model: UtopiaResponse::MODEL_VECTORSDB_COLLECTION,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Usage;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Usage;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Usage\Get as CollectionUsageGet;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -16,7 +16,7 @@ class Get extends CollectionUsageGet
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'getVectorDBCollectionUsage';
|
||||
return 'getVectorsDBCollectionUsage';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -26,23 +26,23 @@ class Get extends CollectionUsageGet
|
||||
|
||||
protected function getMetric(): string
|
||||
{
|
||||
return METRIC_DATABASE_ID_COLLECTION_ID_DOCUMENTS_VECTORDB;
|
||||
return METRIC_DATABASE_ID_COLLECTION_ID_DOCUMENTS_VECTORSDB;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections/:collectionId/usage')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections/:collectionId/usage')
|
||||
->desc('Get collection usage stats')
|
||||
->groups(['api', 'database', 'usage'])
|
||||
->label('scope', 'collections.read')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: null,
|
||||
name: 'getCollectionUsage',
|
||||
description: '/docs/references/vectordb/get-collection-usage.md',
|
||||
description: '/docs/references/vectorsdb/get-collection-usage.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\XList as CollectionXList;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -18,28 +18,28 @@ class XList extends CollectionXList
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'listVectorDBCollections';
|
||||
return 'listVectorsDBCollections';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
{
|
||||
return UtopiaResponse::MODEL_VECTORDB_COLLECTION_LIST;
|
||||
return UtopiaResponse::MODEL_VECTORSDB_COLLECTION_LIST;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/collections')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/collections')
|
||||
->desc('List collections')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'collections.read')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: 'collections',
|
||||
name: 'listCollections',
|
||||
description: '/docs/references/vectordb/list-collections.md',
|
||||
description: '/docs/references/vectorsdb/list-collections.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Create as DatabaseCreate;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,14 +17,14 @@ class Create extends DatabaseCreate
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'createVectorDBDatabase';
|
||||
return 'createVectorsDBDatabase';
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_POST)
|
||||
->setHttpPath('/v1/vectordb')
|
||||
->setHttpPath('/v1/vectorsdb')
|
||||
->desc('Create database')
|
||||
->groups(['api', 'database'])
|
||||
->label('event', 'databases.[databaseId].create')
|
||||
@@ -33,10 +33,10 @@ class Create extends DatabaseCreate
|
||||
->label('audits.event', 'database.create')
|
||||
->label('audits.resource', 'database/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
group: 'vectordb',
|
||||
namespace: 'vectorsDB',
|
||||
group: 'vectorsdb',
|
||||
name: 'create',
|
||||
description: '/docs/references/vectordb/create.md',
|
||||
description: '/docs/references/vectorsdb/create.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Delete as DatabaseDelete;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,14 +15,14 @@ class Delete extends DatabaseDelete
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'deleteVectorDBDatabase';
|
||||
return 'deleteVectorsDBDatabase';
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE)
|
||||
->setHttpPath('/v1/vectordb/:databaseId')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId')
|
||||
->desc('Delete database')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'databases.write')
|
||||
@@ -31,10 +31,10 @@ class Delete extends DatabaseDelete
|
||||
->label('audits.event', 'database.delete')
|
||||
->label('audits.resource', 'database/{request.databaseId}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
group: 'vectordb',
|
||||
namespace: 'vectorsDB',
|
||||
group: 'vectorsdb',
|
||||
name: 'delete',
|
||||
description: '/docs/references/vectordb/delete.md',
|
||||
description: '/docs/references/vectorsdb/delete.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Embeddings\Text;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Embeddings\Text;
|
||||
|
||||
use Appwrite\Event\StatsUsage;
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Collections\Documents\Action as CreateDocumentAction;
|
||||
@@ -42,23 +42,23 @@ class Create extends CreateDocumentAction
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_POST)
|
||||
->setHttpPath('/v1/vectordb/embeddings/text')
|
||||
->setHttpPath('/v1/vectorsdb/embeddings/text')
|
||||
->desc('Create Text Embeddings')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'documents.write')
|
||||
->label('resourceType', RESOURCE_TYPE_EMBEDDINGS_TEXT)
|
||||
->label('audits.event', 'embedding.create')
|
||||
->label('audits.resource', 'vectordb/embeddings/text')
|
||||
->label('audits.resource', 'vectorsdb/embeddings/text')
|
||||
->label('abuse-key', 'ip:{ip},method:{method},url:{url},userId:{userId}')
|
||||
->label('abuse-limit', APP_LIMIT_WRITE_RATE_DEFAULT * 2)
|
||||
->label('abuse-time', APP_LIMIT_WRITE_RATE_PERIOD_DEFAULT)
|
||||
->label('sdk', [
|
||||
new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: $this->getSdkGroup(),
|
||||
name: 'createTextEmbeddings',
|
||||
desc: 'Create Text Embedding',
|
||||
description: '/docs/references/vectordb/create-document.md',
|
||||
description: '/docs/references/vectorsdb/create-document.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY, AuthType::JWT],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Get as DatabaseGet;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,23 +15,23 @@ class Get extends DatabaseGet
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'getVectorDBDatabase';
|
||||
return 'getVectorsDBDatabase';
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/vectordb/:databaseId')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId')
|
||||
->desc('Get database')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'databases.read')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
group: 'vectordb',
|
||||
namespace: 'vectorsDB',
|
||||
group: 'vectorsdb',
|
||||
name: 'get',
|
||||
description: '/docs/references/vectordb/get.md',
|
||||
description: '/docs/references/vectorsdb/get.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Logs;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Logs;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Logs\XList as DatabaseLogs;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -18,24 +18,24 @@ class XList extends DatabaseLogs
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'listVectorDBLogs';
|
||||
return 'listVectorsDBLogs';
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/logs')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/logs')
|
||||
->desc('List database logs')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'databases.read')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', [
|
||||
new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: 'logs',
|
||||
name: 'listDatabaseLogs',
|
||||
description: '/docs/references/vectordb/get-logs.md',
|
||||
description: '/docs/references/vectorsdb/get-logs.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Transactions\Create as TransactionsCreate;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,7 +15,7 @@ class Create extends TransactionsCreate
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'createVectorDBTransaction';
|
||||
return 'createVectorsDBTransaction';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -27,16 +27,16 @@ class Create extends TransactionsCreate
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_POST)
|
||||
->setHttpPath('/v1/vectordb/transactions')
|
||||
->setHttpPath('/v1/vectorsdb/transactions')
|
||||
->desc('Create transaction')
|
||||
->groups(['api', 'database', 'transactions'])
|
||||
->label('scope', 'documents.write')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: 'transactions',
|
||||
name: 'createTransaction',
|
||||
description: '/docs/references/vectordb/create-transaction.md',
|
||||
description: '/docs/references/vectorsdb/create-transaction.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY, AuthType::SESSION, AuthType::JWT],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Transactions\Delete as TransactionsDelete;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,7 +15,7 @@ class Delete extends TransactionsDelete
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'deleteVectorDBTransaction';
|
||||
return 'deleteVectorsDBTransaction';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -27,16 +27,16 @@ class Delete extends TransactionsDelete
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_DELETE)
|
||||
->setHttpPath('/v1/vectordb/transactions/:transactionId')
|
||||
->setHttpPath('/v1/vectorsdb/transactions/:transactionId')
|
||||
->desc('Delete transaction')
|
||||
->groups(['api', 'database', 'transactions'])
|
||||
->label('scope', 'documents.write')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: 'transactions',
|
||||
name: 'deleteTransaction',
|
||||
description: '/docs/references/vectordb/delete-transaction.md',
|
||||
description: '/docs/references/vectorsdb/delete-transaction.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY, AuthType::SESSION, AuthType::JWT],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Transactions\Get as TransactionsGet;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,7 +15,7 @@ class Get extends TransactionsGet
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'getVectorDBTransaction';
|
||||
return 'getVectorsDBTransaction';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -27,16 +27,16 @@ class Get extends TransactionsGet
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/vectordb/transactions/:transactionId')
|
||||
->setHttpPath('/v1/vectorsdb/transactions/:transactionId')
|
||||
->desc('Get transaction')
|
||||
->groups(['api', 'database', 'transactions'])
|
||||
->label('scope', 'documents.read')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: 'transactions',
|
||||
name: 'getTransaction',
|
||||
description: '/docs/references/vectordb/get-transaction.md',
|
||||
description: '/docs/references/vectorsdb/get-transaction.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY, AuthType::SESSION, AuthType::JWT],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions\Operations;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions\Operations;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Transactions\Operations\Create as OperationsCreate;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,7 +17,7 @@ class Create extends OperationsCreate
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'createVectorDBOperations';
|
||||
return 'createVectorsDBOperations';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -29,16 +29,16 @@ class Create extends OperationsCreate
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_POST)
|
||||
->setHttpPath('/v1/vectordb/transactions/:transactionId/operations')
|
||||
->setHttpPath('/v1/vectorsdb/transactions/:transactionId/operations')
|
||||
->desc('Create operations')
|
||||
->groups(['api', 'database', 'transactions'])
|
||||
->label('scope', 'documents.write')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: 'transactions',
|
||||
name: 'createOperations',
|
||||
description: '/docs/references/vectordb/create-operations.md',
|
||||
description: '/docs/references/vectorsdb/create-operations.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY, AuthType::SESSION, AuthType::JWT],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Transactions\Update as TransactionsUpdate;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -16,7 +16,7 @@ class Update extends TransactionsUpdate
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'updateVectorDBTransaction';
|
||||
return 'updateVectorsDBTransaction';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -28,16 +28,16 @@ class Update extends TransactionsUpdate
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_PATCH)
|
||||
->setHttpPath('/v1/vectordb/transactions/:transactionId')
|
||||
->setHttpPath('/v1/vectorsdb/transactions/:transactionId')
|
||||
->desc('Update transaction')
|
||||
->groups(['api', 'database', 'transactions'])
|
||||
->label('scope', 'documents.write')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: 'transactions',
|
||||
name: 'updateTransaction',
|
||||
description: '/docs/references/vectordb/update-transaction.md',
|
||||
description: '/docs/references/vectorsdb/update-transaction.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY, AuthType::SESSION, AuthType::JWT],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Transactions\XList as TransactionsList;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,7 +15,7 @@ class XList extends TransactionsList
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'listVectorDBTransactions';
|
||||
return 'listVectorsDBTransactions';
|
||||
}
|
||||
|
||||
protected function getResponseModel(): string
|
||||
@@ -27,16 +27,16 @@ class XList extends TransactionsList
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/vectordb/transactions')
|
||||
->setHttpPath('/v1/vectorsdb/transactions')
|
||||
->desc('List transactions')
|
||||
->groups(['api', 'database', 'transactions'])
|
||||
->label('scope', 'documents.read')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: 'transactions',
|
||||
name: 'listTransactions',
|
||||
description: '/docs/references/vectordb/list-transactions.md',
|
||||
description: '/docs/references/vectorsdb/list-transactions.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY, AuthType::SESSION, AuthType::JWT],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Update as DatabaseUpdate;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,14 +17,14 @@ class Update extends DatabaseUpdate
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'updateVectorDBDatabase';
|
||||
return 'updateVectorsDBDatabase';
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_PUT)
|
||||
->setHttpPath('/v1/vectordb/:databaseId')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId')
|
||||
->desc('Update database')
|
||||
->groups(['api', 'database', 'schema'])
|
||||
->label('scope', 'databases.write')
|
||||
@@ -33,10 +33,10 @@ class Update extends DatabaseUpdate
|
||||
->label('audits.event', 'database.update')
|
||||
->label('audits.resource', 'database/{response.$id}')
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
group: 'vectordb',
|
||||
namespace: 'vectorsDB',
|
||||
group: 'vectorsdb',
|
||||
name: 'update',
|
||||
description: '/docs/references/vectordb/update.md',
|
||||
description: '/docs/references/vectorsdb/update.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
+8
-8
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Usage;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Usage;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Usage\Get as DatabaseUsageGet;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -16,34 +16,34 @@ class Get extends DatabaseUsageGet
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'getVectorDBUsage';
|
||||
return 'getVectorsDBUsage';
|
||||
}
|
||||
|
||||
public function getResponseModel(): string
|
||||
{
|
||||
return UtopiaResponse::MODEL_USAGE_VECTORDB;
|
||||
return UtopiaResponse::MODEL_USAGE_VECTORSDB;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/vectordb/:databaseId/usage')
|
||||
->desc('Get VectorDB usage stats')
|
||||
->setHttpPath('/v1/vectorsdb/:databaseId/usage')
|
||||
->desc('Get VectorsDB usage stats')
|
||||
->groups(['api', 'database', 'usage'])
|
||||
->label('scope', 'collections.read')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', [
|
||||
new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: null,
|
||||
name: 'getUsage',
|
||||
description: '/docs/references/vectordb/get-database-usage.md',
|
||||
description: '/docs/references/vectorsdb/get-database-usage.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: SwooleResponse::STATUS_CODE_OK,
|
||||
model: UtopiaResponse::MODEL_USAGE_VECTORDB,
|
||||
model: UtopiaResponse::MODEL_USAGE_VECTORSDB,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON,
|
||||
+8
-8
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB\Usage;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB\Usage;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\Usage\XList as DatabaseUsageXList;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -15,34 +15,34 @@ class XList extends DatabaseUsageXList
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'listVectorDBUsage';
|
||||
return 'listVectorsDBUsage';
|
||||
}
|
||||
|
||||
public function getResponseModel(): string
|
||||
{
|
||||
return UtopiaResponse::MODEL_USAGE_VECTORDBS;
|
||||
return UtopiaResponse::MODEL_USAGE_VECTORSDBS;
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/vectordb/usage')
|
||||
->desc('Get VectorDB usage stats')
|
||||
->setHttpPath('/v1/vectorsdb/usage')
|
||||
->desc('Get VectorsDB usage stats')
|
||||
->groups(['api', 'database', 'usage'])
|
||||
->label('scope', 'collections.read')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', [
|
||||
new Method(
|
||||
namespace: 'vectorDB',
|
||||
namespace: 'vectorsDB',
|
||||
group: null,
|
||||
name: 'listUsage',
|
||||
description: '/docs/references/vectordb/list-usage.md',
|
||||
description: '/docs/references/vectorsdb/list-usage.md',
|
||||
auth: [AuthType::ADMIN],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
code: SwooleResponse::STATUS_CODE_OK,
|
||||
model: UtopiaResponse::MODEL_USAGE_VECTORDBS,
|
||||
model: UtopiaResponse::MODEL_USAGE_VECTORSDBS,
|
||||
)
|
||||
],
|
||||
contentType: ContentType::JSON
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorDB;
|
||||
namespace Appwrite\Platform\Modules\Databases\Http\VectorsDB;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\Databases\XList as DatabaseXList;
|
||||
use Appwrite\SDK\AuthType;
|
||||
@@ -17,23 +17,23 @@ class XList extends DatabaseXList
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'listVectorDBDatabases';
|
||||
return 'listVectorsDBDatabases';
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->setHttpMethod(self::HTTP_REQUEST_METHOD_GET)
|
||||
->setHttpPath('/v1/vectordb')
|
||||
->setHttpPath('/v1/vectorsdb')
|
||||
->desc('List databases')
|
||||
->groups(['api', 'database'])
|
||||
->label('scope', 'databases.read')
|
||||
->label('resourceType', RESOURCE_TYPE_DATABASES)
|
||||
->label('sdk', new Method(
|
||||
namespace: 'vectorDB',
|
||||
group: 'vectordb',
|
||||
namespace: 'vectorsDB',
|
||||
group: 'vectorsdb',
|
||||
name: 'list',
|
||||
description: '/docs/references/vectordb/list.md',
|
||||
description: '/docs/references/vectorsdb/list.md',
|
||||
auth: [AuthType::ADMIN, AuthType::KEY],
|
||||
responses: [
|
||||
new SDKResponse(
|
||||
@@ -6,7 +6,7 @@ use Appwrite\Platform\Modules\Databases\Http\Init\Timeout;
|
||||
use Appwrite\Platform\Modules\Databases\Services\Registry\DocumentsDB as DocumentsDBRegistry;
|
||||
use Appwrite\Platform\Modules\Databases\Services\Registry\Legacy as LegacyRegistry;
|
||||
use Appwrite\Platform\Modules\Databases\Services\Registry\TablesDB as TablesDBDBRegistry;
|
||||
use Appwrite\Platform\Modules\Databases\Services\Registry\VectorDB as VectorDBRegistry;
|
||||
use Appwrite\Platform\Modules\Databases\Services\Registry\VectorsDB as VectorsDBRegistry;
|
||||
use Utopia\Platform\Service;
|
||||
|
||||
class Http extends Service
|
||||
@@ -21,7 +21,7 @@ class Http extends Service
|
||||
LegacyRegistry::class,
|
||||
TablesDBDBRegistry::class,
|
||||
DocumentsDBRegistry::class,
|
||||
VectorDBRegistry::class
|
||||
VectorsDBRegistry::class
|
||||
] as $registrar) {
|
||||
new $registrar($this);
|
||||
}
|
||||
|
||||
+35
-35
@@ -2,43 +2,43 @@
|
||||
|
||||
namespace Appwrite\Platform\Modules\Databases\Services\Registry;
|
||||
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Create as CreateCollection;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Delete as DeleteCollection;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Bulk\Delete as DeleteDocuments;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Bulk\Update as UpdateDocuments;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Bulk\Upsert as UpsertDocuments;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Create as CreateDocument;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Delete as DeleteDocument;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Get as GetDocument;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Update as UpdateDocument;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\Upsert as UpsertDocument;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Documents\XList as ListDocuments;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Get as GetCollection;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Indexes\Create as CreateIndex;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Indexes\Delete as DeleteIndex;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Indexes\Get as GetIndex;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Indexes\XList as ListIndexes;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Logs\XList as ListCollectionLogs;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Update as UpdateCollection;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\Usage\Get as GetCollectionUsage;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Collections\XList as ListCollections;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Create as CreateVectorDatabase;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Delete as DeleteVectorDatabase;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Embeddings\Text\Create as CreateTextEmbeddings;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Get as GetVectorDatabase;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions\Create as CreateTransaction;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions\Delete as DeleteTransaction;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions\Get as GetTransaction;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions\Operations\Create as CreateOperations;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions\Update as UpdateTransaction;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Transactions\XList as ListTransactions;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Update as UpdateVectorDatabase;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Usage\Get as GetVectorDatabaseUsage;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\Usage\XList as ListVectorDatabaseUsage;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorDB\XList as ListVectorDatabases;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Create as CreateCollection;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Delete as DeleteCollection;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Bulk\Delete as DeleteDocuments;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Bulk\Update as UpdateDocuments;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Bulk\Upsert as UpsertDocuments;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Create as CreateDocument;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Delete as DeleteDocument;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Get as GetDocument;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Update as UpdateDocument;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\Upsert as UpsertDocument;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Documents\XList as ListDocuments;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Get as GetCollection;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Indexes\Create as CreateIndex;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Indexes\Delete as DeleteIndex;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Indexes\Get as GetIndex;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Indexes\XList as ListIndexes;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Logs\XList as ListCollectionLogs;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Update as UpdateCollection;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\Usage\Get as GetCollectionUsage;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Collections\XList as ListCollections;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Create as CreateVectorDatabase;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Delete as DeleteVectorDatabase;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Embeddings\Text\Create as CreateTextEmbeddings;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Get as GetVectorDatabase;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions\Create as CreateTransaction;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions\Delete as DeleteTransaction;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions\Get as GetTransaction;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions\Operations\Create as CreateOperations;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions\Update as UpdateTransaction;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Transactions\XList as ListTransactions;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Update as UpdateVectorDatabase;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Usage\Get as GetVectorDatabaseUsage;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\Usage\XList as ListVectorDatabaseUsage;
|
||||
use Appwrite\Platform\Modules\Databases\Http\VectorsDB\XList as ListVectorDatabases;
|
||||
use Utopia\Platform\Service;
|
||||
|
||||
class VectorDB extends Base
|
||||
class VectorsDB extends Base
|
||||
{
|
||||
protected function register(Service $service): void
|
||||
{
|
||||
@@ -180,7 +180,8 @@ class Create extends Base
|
||||
|
||||
$version = $function->getAttribute('version', 'v2');
|
||||
$runtimes = Config::getParam($version === 'v2' ? 'runtimes-v2' : 'runtimes', []);
|
||||
$spec = Config::getParam('specifications')[$function->getAttribute('specification', APP_COMPUTE_SPECIFICATION_DEFAULT)];
|
||||
|
||||
$spec = Config::getParam('specifications')[$function->getAttribute('runtimeSpecification', APP_COMPUTE_SPECIFICATION_DEFAULT)];
|
||||
|
||||
$runtime = (isset($runtimes[$function->getAttribute('runtime', '')])) ? $runtimes[$function->getAttribute('runtime', '')] : null;
|
||||
|
||||
@@ -420,6 +421,11 @@ class Create extends Base
|
||||
try {
|
||||
$version = $function->getAttribute('version', 'v2');
|
||||
$command = $runtime['startCommand'];
|
||||
|
||||
if (!empty($deployment->getAttribute('startCommand', ''))) {
|
||||
$command = 'cd /usr/local/server/src/function/ && ' . $deployment->getAttribute('startCommand', '');
|
||||
}
|
||||
|
||||
$source = $deployment->getAttribute('buildPath', '');
|
||||
$extension = str_ends_with($source, '.tar') ? 'tar' : 'tar.gz';
|
||||
$command = $version === 'v2' ? '' : "cp /tmp/code.$extension /mnt/code/code.$extension && nohup helpers/start.sh \"$command\"";
|
||||
|
||||
@@ -93,16 +93,23 @@ class Create extends Base
|
||||
->param('providerBranch', '', new Text(128, 0), 'Production branch for the repo linked to the function.', true)
|
||||
->param('providerSilentMode', false, new Boolean(), 'Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.', true)
|
||||
->param('providerRootDirectory', '', new Text(128, 0), 'Path to function code in the linked repo.', true)
|
||||
->param('specification', fn (array $plan) => $this->getDefaultSpecification($plan), fn (array $plan) => new Specification(
|
||||
->param('buildSpecification', fn (array $plan) => $this->getDefaultSpecification($plan), fn (array $plan) => new Specification(
|
||||
$plan,
|
||||
Config::getParam('specifications', []),
|
||||
System::getEnv('_APP_COMPUTE_CPUS', 0),
|
||||
System::getEnv('_APP_COMPUTE_MEMORY', 0)
|
||||
), 'Runtime specification for the function and builds.', true, ['plan'])
|
||||
), 'Build specification for the function deployments.', true, ['plan'])
|
||||
->param('runtimeSpecification', fn (array $plan) => $this->getDefaultSpecification($plan), fn (array $plan) => new Specification(
|
||||
$plan,
|
||||
Config::getParam('specifications', []),
|
||||
System::getEnv('_APP_COMPUTE_CPUS', 0),
|
||||
System::getEnv('_APP_COMPUTE_MEMORY', 0)
|
||||
), 'Runtime specification for the function executions.', true, ['plan'])
|
||||
->param('templateRepository', '', new Text(128, 0), 'Repository name of the template.', true, deprecated: true)
|
||||
->param('templateOwner', '', new Text(128, 0), 'The name of the owner of the template.', true, deprecated: true)
|
||||
->param('templateRootDirectory', '', new Text(128, 0), 'Path to function code in the template repo.', true, deprecated: true)
|
||||
->param('templateVersion', '', new Text(128, 0), 'Version (tag) for the repo linked to the function template.', true, deprecated: true)
|
||||
->param('deploymentRetention', 0, new Range(0, APP_COMPUTE_DEPLOYMENT_MAX_RETENTION), 'Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.', true)
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
->inject('timelimit')
|
||||
@@ -138,11 +145,13 @@ class Create extends Base
|
||||
string $providerBranch,
|
||||
bool $providerSilentMode,
|
||||
string $providerRootDirectory,
|
||||
string $specification,
|
||||
string $buildSpecification,
|
||||
string $runtimeSpecification,
|
||||
string $templateRepository,
|
||||
string $templateOwner,
|
||||
string $templateRootDirectory,
|
||||
string $templateVersion,
|
||||
int $deploymentRetention,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
callable $timelimit,
|
||||
@@ -215,6 +224,7 @@ class Create extends Base
|
||||
'logging' => $logging,
|
||||
'name' => $name,
|
||||
'runtime' => $runtime,
|
||||
'deploymentRetention' => $deploymentRetention,
|
||||
'deploymentInternalId' => '',
|
||||
'deploymentId' => '',
|
||||
'events' => $events,
|
||||
@@ -225,7 +235,6 @@ class Create extends Base
|
||||
'entrypoint' => $entrypoint,
|
||||
'commands' => $commands,
|
||||
'scopes' => $scopes,
|
||||
'deploymentRetention' => 0,
|
||||
'startCommand' => '',
|
||||
'search' => implode(' ', [$functionId, $name, $runtime]),
|
||||
'version' => 'v5',
|
||||
@@ -237,9 +246,8 @@ class Create extends Base
|
||||
'providerBranch' => $providerBranch,
|
||||
'providerRootDirectory' => $providerRootDirectory,
|
||||
'providerSilentMode' => $providerSilentMode,
|
||||
'specification' => $specification,
|
||||
'buildSpecification' => $specification,
|
||||
'runtimeSpecification' => $specification,
|
||||
'buildSpecification' => $buildSpecification,
|
||||
'runtimeSpecification' => $runtimeSpecification,
|
||||
]));
|
||||
} catch (DuplicateException) {
|
||||
throw new Exception(Exception::FUNCTION_ALREADY_EXISTS);
|
||||
|
||||
@@ -87,12 +87,19 @@ class Update extends Base
|
||||
->param('providerBranch', '', new Text(128, 0), 'Production branch for the repo linked to the function', true)
|
||||
->param('providerSilentMode', false, new Boolean(), 'Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.', true)
|
||||
->param('providerRootDirectory', '', new Text(128, 0), 'Path to function code in the linked repo.', true)
|
||||
->param('specification', fn (array $plan) => $this->getDefaultSpecification($plan), fn (array $plan) => new Specification(
|
||||
->param('buildSpecification', fn (array $plan) => $this->getDefaultSpecification($plan), fn (array $plan) => new Specification(
|
||||
$plan,
|
||||
Config::getParam('specifications', []),
|
||||
System::getEnv('_APP_COMPUTE_CPUS', 0),
|
||||
System::getEnv('_APP_COMPUTE_MEMORY', 0)
|
||||
), 'Runtime specification for the function and builds.', true, ['plan'])
|
||||
), 'Build specification for the function deployments.', true, ['plan'])
|
||||
->param('runtimeSpecification', fn (array $plan) => $this->getDefaultSpecification($plan), fn (array $plan) => new Specification(
|
||||
$plan,
|
||||
Config::getParam('specifications', []),
|
||||
System::getEnv('_APP_COMPUTE_CPUS', 0),
|
||||
System::getEnv('_APP_COMPUTE_MEMORY', 0)
|
||||
), 'Runtime specification for the function executions.', true, ['plan'])
|
||||
->param('deploymentRetention', 0, new Range(0, APP_COMPUTE_DEPLOYMENT_MAX_RETENTION), 'Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.', true)
|
||||
->inject('request')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
@@ -124,7 +131,9 @@ class Update extends Base
|
||||
string $providerBranch,
|
||||
bool $providerSilentMode,
|
||||
string $providerRootDirectory,
|
||||
string $specification,
|
||||
string $buildSpecification,
|
||||
string $runtimeSpecification,
|
||||
int $deploymentRetention,
|
||||
Request $request,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
@@ -209,7 +218,7 @@ class Update extends Base
|
||||
'resourceId' => $function->getId(),
|
||||
'resourceInternalId' => $function->getSequence(),
|
||||
'resourceType' => 'function',
|
||||
'providerPullRequestIds' => []
|
||||
'providerPullRequestIds' => [],
|
||||
]));
|
||||
|
||||
$repositoryId = $repository->getId();
|
||||
@@ -229,13 +238,22 @@ class Update extends Base
|
||||
}
|
||||
|
||||
// Enforce Cold Start if spec limits change.
|
||||
if ($function->getAttribute('specification') !== $specification && !empty($function->getAttribute('deploymentId'))) {
|
||||
try {
|
||||
$executor->deleteRuntime($project->getId(), $function->getAttribute('deploymentId'));
|
||||
} catch (\Throwable $th) {
|
||||
// Don't throw if the deployment doesn't exist
|
||||
if ($th->getCode() !== 404) {
|
||||
throw $th;
|
||||
if (!empty($function->getAttribute('deploymentId'))) {
|
||||
$specsChanged = false;
|
||||
if ($function->getAttribute('runtimeSpecification', '') !== $runtimeSpecification) {
|
||||
$specsChanged = true;
|
||||
} elseif ($function->getAttribute('buildSpecification', '') !== $buildSpecification) {
|
||||
$specsChanged = true;
|
||||
}
|
||||
|
||||
if ($specsChanged) {
|
||||
try {
|
||||
$executor->deleteRuntime($project->getId(), $function->getAttribute('deploymentId'));
|
||||
} catch (\Throwable $th) {
|
||||
// Don't throw if the deployment doesn't exist
|
||||
if ($th->getCode() !== 404) {
|
||||
throw $th;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -253,8 +271,7 @@ class Update extends Base
|
||||
'entrypoint' => $entrypoint,
|
||||
'commands' => $commands,
|
||||
'scopes' => $scopes,
|
||||
'deploymentRetention' => 0,
|
||||
'startCommand' => '',
|
||||
'deploymentRetention' => $deploymentRetention,
|
||||
'installationId' => $installation->getId(),
|
||||
'installationInternalId' => $installation->getSequence(),
|
||||
'providerRepositoryId' => $providerRepositoryId,
|
||||
@@ -263,9 +280,8 @@ class Update extends Base
|
||||
'providerBranch' => $providerBranch,
|
||||
'providerRootDirectory' => $providerRootDirectory,
|
||||
'providerSilentMode' => $providerSilentMode,
|
||||
'specification' => $specification,
|
||||
'buildSpecification' => $specification,
|
||||
'runtimeSpecification' => $specification,
|
||||
'buildSpecification' => $buildSpecification,
|
||||
'runtimeSpecification' => $runtimeSpecification,
|
||||
'search' => implode(' ', [$functionId, $name, $runtime]),
|
||||
])));
|
||||
|
||||
|
||||
@@ -255,7 +255,7 @@ class Builds extends Action
|
||||
$version = $this->getVersion($resource);
|
||||
$runtime = $this->getRuntime($resource, $version);
|
||||
|
||||
$spec = Config::getParam('specifications')[$resource->getAttribute('specification', APP_COMPUTE_SPECIFICATION_DEFAULT)];
|
||||
$spec = Config::getParam('specifications')[$resource->getAttribute('buildSpecification', APP_COMPUTE_SPECIFICATION_DEFAULT)];
|
||||
|
||||
if ($resource->getCollection() === 'functions' && \is_null($runtime)) {
|
||||
throw new \Exception('Runtime "' . $resource->getAttribute('runtime', '') . '" is not supported');
|
||||
@@ -1229,7 +1229,7 @@ class Builds extends Action
|
||||
|
||||
protected function sendUsage(Document $resource, Document $deployment, Document $project, StatsUsage $queue): void
|
||||
{
|
||||
$spec = Config::getParam('specifications')[$resource->getAttribute('specification', APP_COMPUTE_SPECIFICATION_DEFAULT)];
|
||||
$spec = Config::getParam('specifications')[$resource->getAttribute('buildSpecification', APP_COMPUTE_SPECIFICATION_DEFAULT)];
|
||||
|
||||
switch ($deployment->getAttribute('status')) {
|
||||
case 'ready':
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace Appwrite\Platform\Modules\Health\Http\Health\Storage;
|
||||
|
||||
use Appwrite\Extend\Exception;
|
||||
use Appwrite\SDK\AuthType;
|
||||
use Appwrite\SDK\ContentType;
|
||||
use Appwrite\SDK\Method;
|
||||
@@ -58,33 +57,21 @@ class Get extends Action
|
||||
$checkStart = \microtime(true);
|
||||
|
||||
foreach ($devices as $device) {
|
||||
$uniqueFileName = \uniqid('health', true);
|
||||
$filePath = $device->getPath($uniqueFileName);
|
||||
$path = $device->getPath(\uniqid('health', true));
|
||||
|
||||
if (!$device->write($filePath, 'test', 'text/plain')) {
|
||||
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed writing test file to ' . $device->getRoot());
|
||||
}
|
||||
|
||||
$readError = null;
|
||||
try {
|
||||
if ($device->read($filePath) !== 'test') {
|
||||
$readError = new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed reading test file from ' . $device->getRoot());
|
||||
if (!$device->write($path, 'test', 'text/plain')) {
|
||||
throw new \Exception("Failed writing test file to {$device->getRoot()}");
|
||||
}
|
||||
|
||||
$content = $device->read($path);
|
||||
if ($content !== 'test') {
|
||||
throw new \Exception("Failed reading test file from {$device->getRoot()}: content mismatch");
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
$readError = $e;
|
||||
} finally {
|
||||
// Always attempt to clean up test file
|
||||
if (!$device->delete($filePath)) {
|
||||
if ($readError !== null) {
|
||||
// If read already failed, wrap delete error but preserve original
|
||||
\error_log('Failed deleting test file from ' . $device->getRoot() . ' during read error recovery');
|
||||
} else {
|
||||
throw new Exception(Exception::GENERAL_SERVER_ERROR, 'Failed deleting test file from ' . $device->getRoot());
|
||||
}
|
||||
}
|
||||
// Re-throw read error if it occurred
|
||||
if ($readError !== null) {
|
||||
throw $readError;
|
||||
try {
|
||||
$device->delete($path);
|
||||
} catch (\Throwable) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ class Create extends Base
|
||||
->param('timeout', 30, new Range(1, (int) System::getEnv('_APP_SITES_TIMEOUT', 30)), 'Maximum request time in seconds.', true)
|
||||
->param('installCommand', '', new Text(8192, 0), 'Install Command.', true)
|
||||
->param('buildCommand', '', new Text(8192, 0), 'Build Command.', true)
|
||||
->param('startCommand', '', new Text(8192, 0), 'Custom start command. Leave empty to use default.', true)
|
||||
->param('outputDirectory', '', new Text(8192, 0), 'Output Directory for site.', true)
|
||||
->param('buildRuntime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Runtime to use during build step.')
|
||||
->param('adapter', '', new WhiteList(['static', 'ssr']), 'Framework adapter defining rendering strategy. Allowed values are: static, ssr', true)
|
||||
@@ -77,12 +78,19 @@ class Create extends Base
|
||||
->param('providerBranch', '', new Text(128, 0), 'Production branch for the repo linked to the site.', true)
|
||||
->param('providerSilentMode', false, new Boolean(), 'Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.', true)
|
||||
->param('providerRootDirectory', '', new Text(128, 0), 'Path to site code in the linked repo.', true)
|
||||
->param('specification', fn (array $plan) => $this->getDefaultSpecification($plan), fn (array $plan) => new Specification(
|
||||
->param('buildSpecification', fn (array $plan) => $this->getDefaultSpecification($plan), fn (array $plan) => new Specification(
|
||||
$plan,
|
||||
Config::getParam('specifications', []),
|
||||
System::getEnv('_APP_COMPUTE_CPUS', 0),
|
||||
System::getEnv('_APP_COMPUTE_MEMORY', 0)
|
||||
), 'Framework specification for the site and builds.', true, ['plan'])
|
||||
), 'Build specification for the site deployments.', true, ['plan'])
|
||||
->param('runtimeSpecification', fn (array $plan) => $this->getDefaultSpecification($plan), fn (array $plan) => new Specification(
|
||||
$plan,
|
||||
Config::getParam('specifications', []),
|
||||
System::getEnv('_APP_COMPUTE_CPUS', 0),
|
||||
System::getEnv('_APP_COMPUTE_MEMORY', 0)
|
||||
), 'Runtime specification for the SSR executions.', true, ['plan'])
|
||||
->param('deploymentRetention', 0, new Range(0, APP_COMPUTE_DEPLOYMENT_MAX_RETENTION), 'Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.', true)
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
->inject('project')
|
||||
@@ -100,6 +108,7 @@ class Create extends Base
|
||||
int $timeout,
|
||||
string $installCommand,
|
||||
string $buildCommand,
|
||||
string $startCommand,
|
||||
string $outputDirectory,
|
||||
string $buildRuntime,
|
||||
string $adapter,
|
||||
@@ -109,7 +118,9 @@ class Create extends Base
|
||||
string $providerBranch,
|
||||
bool $providerSilentMode,
|
||||
string $providerRootDirectory,
|
||||
string $specification,
|
||||
string $buildSpecification,
|
||||
string $runtimeSpecification,
|
||||
int $deploymentRetention,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
Document $project,
|
||||
@@ -144,13 +155,13 @@ class Create extends Base
|
||||
'logging' => $logging,
|
||||
'name' => $name,
|
||||
'framework' => $framework,
|
||||
'deploymentRetention' => $deploymentRetention,
|
||||
'deploymentInternalId' => '',
|
||||
'deploymentId' => '',
|
||||
'timeout' => $timeout,
|
||||
'installCommand' => $installCommand,
|
||||
'buildCommand' => $buildCommand,
|
||||
'deploymentRetention' => 0,
|
||||
'startCommand' => '',
|
||||
'startCommand' => $startCommand,
|
||||
'outputDirectory' => $outputDirectory,
|
||||
'search' => implode(' ', [$siteId, $name, $framework]),
|
||||
'fallbackFile' => $fallbackFile,
|
||||
@@ -162,9 +173,8 @@ class Create extends Base
|
||||
'providerBranch' => $providerBranch,
|
||||
'providerRootDirectory' => $providerRootDirectory,
|
||||
'providerSilentMode' => $providerSilentMode,
|
||||
'specification' => $specification,
|
||||
'buildSpecification' => $specification,
|
||||
'runtimeSpecification' => $specification,
|
||||
'buildSpecification' => $buildSpecification,
|
||||
'runtimeSpecification' => $runtimeSpecification,
|
||||
'buildRuntime' => $buildRuntime,
|
||||
'adapter' => $adapter,
|
||||
]);
|
||||
|
||||
@@ -71,6 +71,7 @@ class Update extends Base
|
||||
->param('timeout', 30, new Range(1, (int) System::getEnv('_APP_SITES_TIMEOUT', 30)), 'Maximum request time in seconds.', true)
|
||||
->param('installCommand', '', new Text(8192, 0), 'Install Command.', true)
|
||||
->param('buildCommand', '', new Text(8192, 0), 'Build Command.', true)
|
||||
->param('startCommand', '', new Text(8192, 0), 'Custom start command. Leave empty to use default.', true)
|
||||
->param('outputDirectory', '', new Text(8192, 0), 'Output Directory for site.', true)
|
||||
->param('buildRuntime', '', new WhiteList(array_keys(Config::getParam('runtimes')), true), 'Runtime to use during build step.', true)
|
||||
->param('adapter', '', new WhiteList(['static', 'ssr']), 'Framework adapter defining rendering strategy. Allowed values are: static, ssr', true)
|
||||
@@ -80,12 +81,19 @@ class Update extends Base
|
||||
->param('providerBranch', '', new Text(128, 0), 'Production branch for the repo linked to the site.', true)
|
||||
->param('providerSilentMode', false, new Boolean(), 'Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.', true)
|
||||
->param('providerRootDirectory', '', new Text(128, 0), 'Path to site code in the linked repo.', true)
|
||||
->param('specification', fn (array $plan) => $this->getDefaultSpecification($plan), fn (array $plan) => new Specification(
|
||||
->param('buildSpecification', fn (array $plan) => $this->getDefaultSpecification($plan), fn (array $plan) => new Specification(
|
||||
$plan,
|
||||
Config::getParam('specifications', []),
|
||||
System::getEnv('_APP_COMPUTE_CPUS', 0),
|
||||
System::getEnv('_APP_COMPUTE_MEMORY', 0)
|
||||
), 'Framework specification for the site and builds.', true, ['plan'])
|
||||
), 'Build specification for the site deployments.', true, ['plan'])
|
||||
->param('runtimeSpecification', fn (array $plan) => $this->getDefaultSpecification($plan), fn (array $plan) => new Specification(
|
||||
$plan,
|
||||
Config::getParam('specifications', []),
|
||||
System::getEnv('_APP_COMPUTE_CPUS', 0),
|
||||
System::getEnv('_APP_COMPUTE_MEMORY', 0)
|
||||
), 'Runtime specification for the SSR executions.', true, ['plan'])
|
||||
->param('deploymentRetention', 0, new Range(0, APP_COMPUTE_DEPLOYMENT_MAX_RETENTION), 'Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.', true)
|
||||
->inject('request')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
@@ -107,6 +115,7 @@ class Update extends Base
|
||||
int $timeout,
|
||||
string $installCommand,
|
||||
string $buildCommand,
|
||||
string $startCommand,
|
||||
string $outputDirectory,
|
||||
string $buildRuntime,
|
||||
string $adapter,
|
||||
@@ -116,7 +125,9 @@ class Update extends Base
|
||||
string $providerBranch,
|
||||
bool $providerSilentMode,
|
||||
string $providerRootDirectory,
|
||||
string $specification,
|
||||
string $buildSpecification,
|
||||
string $runtimeSpecification,
|
||||
int $deploymentRetention,
|
||||
Request $request,
|
||||
Response $response,
|
||||
Database $dbForProject,
|
||||
@@ -216,6 +227,7 @@ class Update extends Base
|
||||
$site->getAttribute('name') !== $name ||
|
||||
$site->getAttribute('buildCommand') !== $buildCommand ||
|
||||
$site->getAttribute('installCommand') !== $installCommand ||
|
||||
$site->getAttribute('startCommand') !== $startCommand ||
|
||||
$site->getAttribute('outputDirectory') !== $outputDirectory ||
|
||||
$site->getAttribute('providerRootDirectory') !== $providerRootDirectory ||
|
||||
$site->getAttribute('framework') !== $framework
|
||||
@@ -223,14 +235,22 @@ class Update extends Base
|
||||
$live = false;
|
||||
}
|
||||
|
||||
// Enforce Cold Start if spec limits change.
|
||||
if ($site->getAttribute('specification') !== $specification && !empty($site->getAttribute('deploymentId'))) {
|
||||
try {
|
||||
$executor->deleteRuntime($project->getId(), $site->getAttribute('deploymentId'));
|
||||
} catch (\Throwable $th) {
|
||||
// Don't throw if the deployment doesn't exist
|
||||
if ($th->getCode() !== 404) {
|
||||
throw $th;
|
||||
if (!empty($site->getAttribute('deploymentId'))) {
|
||||
$specsChanged = false;
|
||||
if ($site->getAttribute('runtimeSpecification', '') !== $runtimeSpecification) {
|
||||
$specsChanged = true;
|
||||
} elseif ($site->getAttribute('buildSpecification', '') !== $buildSpecification) {
|
||||
$specsChanged = true;
|
||||
}
|
||||
|
||||
if ($specsChanged) {
|
||||
try {
|
||||
$executor->deleteRuntime($project->getId(), $site->getAttribute('deploymentId'));
|
||||
} catch (\Throwable $th) {
|
||||
// Don't throw if the deployment doesn't exist
|
||||
if ($th->getCode() !== 404) {
|
||||
throw $th;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -242,10 +262,10 @@ class Update extends Base
|
||||
'logging' => $logging,
|
||||
'live' => $live,
|
||||
'timeout' => $timeout,
|
||||
'deploymentRetention' => $deploymentRetention,
|
||||
'installCommand' => $installCommand,
|
||||
'buildCommand' => $buildCommand,
|
||||
'deploymentRetention' => 0,
|
||||
'startCommand' => '',
|
||||
'startCommand' => $startCommand,
|
||||
'outputDirectory' => $outputDirectory,
|
||||
'installationId' => $installation->getId(),
|
||||
'installationInternalId' => $installation->getSequence(),
|
||||
@@ -255,9 +275,8 @@ class Update extends Base
|
||||
'providerBranch' => $providerBranch,
|
||||
'providerRootDirectory' => $providerRootDirectory,
|
||||
'providerSilentMode' => $providerSilentMode,
|
||||
'specification' => $specification,
|
||||
'buildSpecification' => $specification,
|
||||
'runtimeSpecification' => $specification,
|
||||
'buildSpecification' => $buildSpecification,
|
||||
'runtimeSpecification' => $runtimeSpecification,
|
||||
'search' => implode(' ', [$siteId, $name, $framework]),
|
||||
'buildRuntime' => $buildRuntime,
|
||||
'adapter' => $adapter,
|
||||
|
||||
@@ -16,6 +16,7 @@ use Appwrite\Platform\Tasks\SDKs;
|
||||
use Appwrite\Platform\Tasks\Specs;
|
||||
use Appwrite\Platform\Tasks\SSL;
|
||||
use Appwrite\Platform\Tasks\StatsResources;
|
||||
use Appwrite\Platform\Tasks\TimeTravel;
|
||||
use Appwrite\Platform\Tasks\Upgrade;
|
||||
use Appwrite\Platform\Tasks\Vars;
|
||||
use Appwrite\Platform\Tasks\Version;
|
||||
@@ -44,6 +45,7 @@ class Tasks extends Service
|
||||
->addAction(Vars::getName(), new Vars())
|
||||
->addAction(Version::getName(), new Version())
|
||||
->addAction(StatsResources::getName(), new StatsResources())
|
||||
->addAction(TimeTravel::getName(), new TimeTravel())
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ use Utopia\Database\Document;
|
||||
use Utopia\Database\Query;
|
||||
use Utopia\Platform\Action;
|
||||
use Utopia\System\System;
|
||||
use Utopia\Validator\WhiteList;
|
||||
|
||||
class Maintenance extends Action
|
||||
{
|
||||
@@ -25,6 +26,7 @@ class Maintenance extends Action
|
||||
{
|
||||
$this
|
||||
->desc('Schedules maintenance tasks and publishes them to our queues')
|
||||
->param('type', 'loop', new WhiteList(['loop', 'trigger']), 'How to run task. "loop" is meant for container entrypoint, and "trigger" for manual execution.')
|
||||
->inject('dbForPlatform')
|
||||
->inject('console')
|
||||
->inject('queueForCertificates')
|
||||
@@ -32,7 +34,7 @@ class Maintenance extends Action
|
||||
->callback($this->action(...));
|
||||
}
|
||||
|
||||
public function action(Database $dbForPlatform, Document $console, Certificate $queueForCertificates, Delete $queueForDeletes): void
|
||||
public function action(string $type, Database $dbForPlatform, Document $console, Certificate $queueForCertificates, Delete $queueForDeletes): void
|
||||
{
|
||||
Console::title('Maintenance V1');
|
||||
Console::success(APP_NAME . ' maintenance process v1 has started');
|
||||
@@ -57,9 +59,7 @@ class Maintenance extends Action
|
||||
$delay = $next->getTimestamp() - $now->getTimestamp();
|
||||
}
|
||||
|
||||
Console::info('Setting loop start time to ' . $next->format("Y-m-d H:i:s.v") . '. Delaying for ' . $delay . ' seconds.');
|
||||
|
||||
Console::loop(function () use ($interval, $cacheRetention, $schedulesDeletionRetention, $usageStatsRetentionHourly, $dbForPlatform, $console, $queueForDeletes, $queueForCertificates) {
|
||||
$action = function () use ($interval, $cacheRetention, $schedulesDeletionRetention, $usageStatsRetentionHourly, $dbForPlatform, $console, $queueForDeletes, $queueForCertificates) {
|
||||
$time = DatabaseDateTime::now();
|
||||
|
||||
Console::info("[{$time}] Notifying workers with maintenance tasks every {$interval} seconds");
|
||||
@@ -96,7 +96,17 @@ class Maintenance extends Action
|
||||
$this->notifyDeleteCache($cacheRetention, $queueForDeletes);
|
||||
$this->notifyDeleteSchedules($schedulesDeletionRetention, $queueForDeletes);
|
||||
$this->notifyDeleteCSVExports($queueForDeletes);
|
||||
}, $interval, $delay);
|
||||
};
|
||||
|
||||
if ($type === 'loop') {
|
||||
Console::info('Setting loop start time to ' . $next->format("Y-m-d H:i:s.v") . '. Delaying for ' . $delay . ' seconds.');
|
||||
|
||||
Console::loop(function () use ($action) {
|
||||
$action();
|
||||
}, $interval, $delay);
|
||||
} elseif ($type === 'trigger') {
|
||||
$action();
|
||||
}
|
||||
}
|
||||
|
||||
private function notifyDeleteConnections(Delete $queueForDeletes): void
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Platform\Tasks;
|
||||
|
||||
use Utopia\Console;
|
||||
use Utopia\Database\Database;
|
||||
use Utopia\Database\Document;
|
||||
use Utopia\Database\Validator\Datetime as DatetimeValidator;
|
||||
use Utopia\Database\Validator\UID;
|
||||
use Utopia\Platform\Action;
|
||||
use Utopia\System\System;
|
||||
use Utopia\Validator\WhiteList;
|
||||
|
||||
class TimeTravel extends Action
|
||||
{
|
||||
public static function getName(): string
|
||||
{
|
||||
return 'time-travel';
|
||||
}
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->desc('Create a time-travel to change $createdAt')
|
||||
->param('projectId', '', new UID(), 'Project ID.')
|
||||
->param('resourceType', '', new WhiteList(['deployment']), 'Type of resource.')
|
||||
->param('resourceId', '', new UID(), 'ID of resource.')
|
||||
->param('createdAt', '', new DatetimeValidator(), 'New value for $createdAt')
|
||||
->inject('getProjectDB')
|
||||
->inject('dbForPlatform')
|
||||
->callback($this->action(...));
|
||||
}
|
||||
|
||||
public function action(string $projectId, string $resourceType, string $resourceId, string $createdAt, callable $getProjectDB, Database $dbForPlatform): void
|
||||
{
|
||||
$isDevelopment = System::getEnv('_APP_ENV', 'development') === 'development';
|
||||
|
||||
if (!$isDevelopment) {
|
||||
Console::error('This task is only available in development mode.');
|
||||
return;
|
||||
}
|
||||
|
||||
$project = $dbForPlatform->getDocument('projects', $projectId);
|
||||
|
||||
if ($project->isEmpty()) {
|
||||
Console::error('Project not found.');
|
||||
return;
|
||||
}
|
||||
|
||||
$collection = match ($resourceType) {
|
||||
'deployment' => 'deployments',
|
||||
default => throw new \Exception('Resource type not implemented')
|
||||
};
|
||||
|
||||
/** @var Database $dbForProject */
|
||||
$dbForProject = $getProjectDB($project);
|
||||
|
||||
$resource = $dbForProject->getDocument($collection, $resourceId);
|
||||
if ($resource->isEmpty()) {
|
||||
Console::error('Resource not found.');
|
||||
return;
|
||||
}
|
||||
|
||||
$update = new Document([
|
||||
'$createdAt' => $createdAt,
|
||||
]);
|
||||
|
||||
$dbForProject->withPreserveDates(fn () => $dbForProject->updateDocument($collection, $resourceId, $update));
|
||||
|
||||
Console::success('Time-travel successful. Updated $createdAt for ' . $resourceType . ' ' . $resourceId . ' to ' . $createdAt);
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ namespace Appwrite\Platform\Workers;
|
||||
use Appwrite\Certificates\Adapter as CertificatesAdapter;
|
||||
use Appwrite\Deletes\Identities;
|
||||
use Appwrite\Deletes\Targets;
|
||||
use Appwrite\Event\Delete as DeleteEvent;
|
||||
use Appwrite\Extend\Exception;
|
||||
use Executor\Executor;
|
||||
use Throwable;
|
||||
@@ -66,6 +67,7 @@ class Deletes extends Action
|
||||
->inject('executionsRetentionCount')
|
||||
->inject('auditRetention')
|
||||
->inject('log')
|
||||
->inject('queueForDeletes')
|
||||
->inject('getAudit')
|
||||
->callback($this->action(...));
|
||||
}
|
||||
@@ -92,6 +94,7 @@ class Deletes extends Action
|
||||
int $executionsRetentionCount,
|
||||
string $auditRetention,
|
||||
Log $log,
|
||||
DeleteEvent $queueForDeletes,
|
||||
callable $getAudit,
|
||||
): void {
|
||||
$payload = $message->getPayload() ?? [];
|
||||
@@ -212,6 +215,7 @@ class Deletes extends Action
|
||||
$this->deleteUsageStats($project, $getProjectDB, $getLogsDB, $hourlyUsageRetentionDatetime);
|
||||
$this->deleteExpiredSessions($project, $getProjectDB);
|
||||
$this->deleteExpiredTransactions($project, $getProjectDB);
|
||||
$this->deleteOldDeployments($queueForDeletes, $project, $getProjectDB);
|
||||
break;
|
||||
default:
|
||||
throw new \Exception('No delete operation for type: ' . \strval($type));
|
||||
@@ -373,6 +377,61 @@ class Deletes extends Action
|
||||
Targets::delete($getProjectDB($project), Query::equal('sessionInternalId', [$session->getSequence()]));
|
||||
}
|
||||
|
||||
private function deleteOldDeployments(DeleteEvent $queueForDeletes, Document $project, callable $getProjectDB): void
|
||||
{
|
||||
/** @var Database $dbForProject */
|
||||
$dbForProject = $getProjectDB($project);
|
||||
|
||||
$removalCallback = function (Document $resource) use ($dbForProject, $queueForDeletes, $project) {
|
||||
$retention = $resource->getAttribute('deploymentRetention', 0);
|
||||
|
||||
// 0 means unlimited - never delete
|
||||
if ($retention === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$activeDeploymentId = $resource->getAttribute('deploymentId', '');
|
||||
|
||||
$queries = [
|
||||
Query::createdBefore(DateTime::addSeconds(new \DateTime(), -1 * $retention * 24 * 60 * 60)),
|
||||
Query::equal('resourceInternalId', [$resource->getSequence()]),
|
||||
Query::equal('resourceType', [$resource->getCollection()]),
|
||||
Query::orderDesc('$createdAt'),
|
||||
];
|
||||
|
||||
if (!empty($activeDeploymentId)) {
|
||||
$queries[] = Query::notEqual('$id', $activeDeploymentId);
|
||||
}
|
||||
|
||||
$this->deleteByGroup(
|
||||
'deployments',
|
||||
$queries,
|
||||
$dbForProject,
|
||||
function (Document $deployment) use ($queueForDeletes, $project) {
|
||||
$queueForDeletes
|
||||
->setType(DELETE_TYPE_DOCUMENT)
|
||||
->setDocument($deployment)
|
||||
->setProject($project)
|
||||
->trigger();
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
$this->listByGroup(
|
||||
'functions',
|
||||
[],
|
||||
$dbForProject,
|
||||
$removalCallback
|
||||
);
|
||||
|
||||
$this->listByGroup(
|
||||
'sites',
|
||||
[],
|
||||
$dbForProject,
|
||||
$removalCallback
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Document $project
|
||||
* @param callable $getProjectDB
|
||||
@@ -609,7 +668,7 @@ class Deletes extends Action
|
||||
'database' => $document->getAttribute('database')
|
||||
]),
|
||||
...$dbForProject->find('databases', [
|
||||
Query::equal('type', [DATABASE_TYPE_DOCUMENTSDB, DATABASE_TYPE_VECTORDB]),
|
||||
Query::equal('type', [DATABASE_TYPE_DOCUMENTSDB, DATABASE_TYPE_VECTORSDB]),
|
||||
Query::limit(5000),
|
||||
]),
|
||||
];
|
||||
|
||||
@@ -357,7 +357,7 @@ class Functions extends Action
|
||||
$user ??= new Document();
|
||||
$functionId = $function->getId();
|
||||
$deploymentId = $function->getAttribute('deploymentId', '');
|
||||
$spec = Config::getParam('specifications')[$function->getAttribute('specification', APP_COMPUTE_SPECIFICATION_DEFAULT)];
|
||||
$spec = Config::getParam('specifications')[$function->getAttribute('runtimeSpecification', APP_COMPUTE_SPECIFICATION_DEFAULT)];
|
||||
|
||||
$log->addTag('deploymentId', $deploymentId);
|
||||
|
||||
@@ -511,6 +511,11 @@ class Functions extends Action
|
||||
try {
|
||||
$version = $function->getAttribute('version', 'v2');
|
||||
$command = $runtime['startCommand'];
|
||||
|
||||
if (!empty($deployment->getAttribute('startCommand', ''))) {
|
||||
$command = 'cd /usr/local/server/src/function/ && ' . $deployment->getAttribute('startCommand', '');
|
||||
}
|
||||
|
||||
$source = $deployment->getAttribute('buildPath', '');
|
||||
$extension = str_ends_with($source, '.tar') ? 'tar' : 'tar.gz';
|
||||
$command = $version === 'v2' ? '' : "cp /tmp/code.$extension /mnt/code/code.$extension && nohup helpers/start.sh \"$command\"";
|
||||
|
||||
@@ -323,8 +323,8 @@ class Migrations extends Action
|
||||
METRIC_DATABASES_OPERATIONS_WRITES,
|
||||
METRIC_DATABASES_OPERATIONS_READS_DOCUMENTSDB,
|
||||
METRIC_DATABASES_OPERATIONS_WRITES_DOCUMENTSDB,
|
||||
METRIC_DATABASES_OPERATIONS_READS_VECTORDB,
|
||||
METRIC_DATABASES_OPERATIONS_WRITES_VECTORDB,
|
||||
METRIC_DATABASES_OPERATIONS_READS_VECTORSDB,
|
||||
METRIC_DATABASES_OPERATIONS_WRITES_VECTORSDB,
|
||||
METRIC_NETWORK_REQUESTS,
|
||||
METRIC_NETWORK_INBOUND,
|
||||
METRIC_NETWORK_OUTBOUND,
|
||||
|
||||
@@ -112,7 +112,7 @@ class StatsResources extends Action
|
||||
|
||||
$databases = $dbForProject->count('databases', [Query::equal('type', [DATABASE_TYPE_LEGACY, DATABASE_TYPE_TABLESDB])]);
|
||||
$documentsdb = $dbForProject->count('databases', [Query::equal('type', [DATABASE_TYPE_DOCUMENTSDB])]);
|
||||
$vectordb = $dbForProject->count('databases', [Query::equal('type', [DATABASE_TYPE_VECTORDB])]);
|
||||
$vectorsdb = $dbForProject->count('databases', [Query::equal('type', [DATABASE_TYPE_VECTORSDB])]);
|
||||
$buckets = $dbForProject->count('buckets');
|
||||
$users = $dbForProject->count('users');
|
||||
|
||||
@@ -148,7 +148,7 @@ class StatsResources extends Action
|
||||
$metrics = [
|
||||
METRIC_DATABASES => $databases,
|
||||
METRIC_DATABASES_DOCUMENTSDB => $documentsdb,
|
||||
METRIC_DATABASES_VECTORDB => $vectordb,
|
||||
METRIC_DATABASES_VECTORSDB => $vectorsdb,
|
||||
METRIC_BUCKETS => $buckets,
|
||||
METRIC_USERS => $users,
|
||||
METRIC_FUNCTIONS => $functions,
|
||||
@@ -273,7 +273,7 @@ class StatsResources extends Action
|
||||
$totalDocumentsDocumentsdb = 0;
|
||||
$totalDatabaseStorageDocumentsdb = 0;
|
||||
|
||||
// vectordb
|
||||
// vectorsdb
|
||||
$totalCollectionsVectordb = 0;
|
||||
$totalDocumentsVectordb = 0;
|
||||
$totalDatabaseStorageVectordb = 0;
|
||||
@@ -299,7 +299,7 @@ class StatsResources extends Action
|
||||
$totalDocumentsDocumentsdb += $documents;
|
||||
$totalCollectionsDocumentsdb += $collections;
|
||||
break;
|
||||
case DATABASE_TYPE_VECTORDB:
|
||||
case DATABASE_TYPE_VECTORSDB:
|
||||
$totalDatabaseStorageVectordb += $storage;
|
||||
$totalDocumentsVectordb += $documents;
|
||||
$totalCollectionsVectordb += $collections;
|
||||
@@ -319,9 +319,9 @@ class StatsResources extends Action
|
||||
$this->createStatsDocuments($region, METRIC_DOCUMENTS_DOCUMENTSDB, $totalDocumentsDocumentsdb);
|
||||
$this->createStatsDocuments($region, METRIC_DATABASES_STORAGE_DOCUMENTSDB, $totalDatabaseStorageDocumentsdb);
|
||||
|
||||
$this->createStatsDocuments($region, METRIC_COLLECTIONS_VECTORDB, $totalCollectionsVectordb);
|
||||
$this->createStatsDocuments($region, METRIC_DOCUMENTS_VECTORDB, $totalDocumentsVectordb);
|
||||
$this->createStatsDocuments($region, METRIC_DATABASES_STORAGE_VECTORDB, $totalDatabaseStorageVectordb);
|
||||
$this->createStatsDocuments($region, METRIC_COLLECTIONS_VECTORSDB, $totalCollectionsVectordb);
|
||||
$this->createStatsDocuments($region, METRIC_DOCUMENTS_VECTORSDB, $totalDocumentsVectordb);
|
||||
$this->createStatsDocuments($region, METRIC_DATABASES_STORAGE_VECTORSDB, $totalDatabaseStorageVectordb);
|
||||
}
|
||||
protected function countForCollections(Database $dbForProject, Database $dbForDatabases, Document $database, string $region): array
|
||||
{
|
||||
|
||||
@@ -48,7 +48,7 @@ class StatsUsage extends Action
|
||||
protected array $skipBaseMetrics = [
|
||||
METRIC_DATABASES => true,
|
||||
METRIC_DATABASES_DOCUMENTSDB => true,
|
||||
METRIC_DATABASES_VECTORDB => true,
|
||||
METRIC_DATABASES_VECTORSDB => true,
|
||||
METRIC_BUCKETS => true,
|
||||
METRIC_USERS => true,
|
||||
METRIC_FUNCTIONS => true,
|
||||
@@ -70,11 +70,11 @@ class StatsUsage extends Action
|
||||
METRIC_DOCUMENTS => true,
|
||||
METRIC_COLLECTIONS_DOCUMENTSDB => true,
|
||||
METRIC_DOCUMENTS_DOCUMENTSDB => true,
|
||||
METRIC_COLLECTIONS_VECTORDB => true,
|
||||
METRIC_DOCUMENTS_VECTORDB => true,
|
||||
METRIC_COLLECTIONS_VECTORSDB => true,
|
||||
METRIC_DOCUMENTS_VECTORSDB => true,
|
||||
METRIC_DATABASES_STORAGE => true,
|
||||
METRIC_DATABASES_STORAGE_DOCUMENTSDB => true,
|
||||
METRIC_DATABASES_STORAGE_VECTORDB => true,
|
||||
METRIC_DATABASES_STORAGE_VECTORSDB => true,
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -367,7 +367,7 @@ abstract class Format
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'vectorDB':
|
||||
case 'vectorsDB':
|
||||
switch ($method) {
|
||||
case 'getUsage':
|
||||
case 'listUsage':
|
||||
@@ -380,7 +380,7 @@ abstract class Format
|
||||
case 'createIndex':
|
||||
switch ($param) {
|
||||
case 'type':
|
||||
return 'VectorDBIndexType';
|
||||
return 'VectorsDBIndexType';
|
||||
case 'orders':
|
||||
return 'OrderBy';
|
||||
}
|
||||
@@ -669,7 +669,7 @@ abstract class Format
|
||||
break;
|
||||
case 'databases':
|
||||
case 'documentsDB':
|
||||
case 'vectorDB':
|
||||
case 'vectorsDB':
|
||||
switch ($method) {
|
||||
case 'getUsage':
|
||||
case 'listUsage':
|
||||
|
||||
@@ -6,7 +6,7 @@ use Appwrite\Utopia\Request\Filter;
|
||||
|
||||
class V21 extends Filter
|
||||
{
|
||||
// Convert 1.8.0 params to 1.8.1
|
||||
// Convert 1.8.0 params to 1.9.0
|
||||
public function parse(array $content, string $model): array
|
||||
{
|
||||
switch ($model) {
|
||||
@@ -14,6 +14,12 @@ class V21 extends Filter
|
||||
case 'sites.createTemplateDeployment':
|
||||
$content = $this->convertVersionToTypeAndReference($content);
|
||||
break;
|
||||
case 'functions.create':
|
||||
case 'sites.create':
|
||||
case 'functions.update':
|
||||
case 'sites.update':
|
||||
$content = $this->convertSpecs($content);
|
||||
break;
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
@@ -31,4 +37,15 @@ class V21 extends Filter
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
||||
protected function convertSpecs(array $content): array
|
||||
{
|
||||
if (!empty($content['specification'])) {
|
||||
$content['buildSpecification'] = $content['specification'];
|
||||
$content['runtimeSpecification'] = $content['specification'];
|
||||
unset($content['specification']);
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@ class Response extends SwooleResponse
|
||||
public const MODEL_USAGE_DATABASE = 'usageDatabase';
|
||||
public const MODEL_USAGE_DOCUMENTSDBS = 'usageDocumentsDBs';
|
||||
public const MODEL_USAGE_DOCUMENTSDB = 'usageDocumentsDB';
|
||||
public const MODEL_USAGE_VECTORDBS = 'usageVectorDBs';
|
||||
public const MODEL_USAGE_VECTORDB = 'usageVectorDB';
|
||||
public const MODEL_USAGE_VECTORSDBS = 'usageVectorsDBs';
|
||||
public const MODEL_USAGE_VECTORSDB = 'usageVectorsDB';
|
||||
public const MODEL_USAGE_TABLE = 'usageTable';
|
||||
public const MODEL_USAGE_COLLECTION = 'usageCollection';
|
||||
public const MODEL_USAGE_USERS = 'usageUsers';
|
||||
@@ -52,8 +52,8 @@ class Response extends SwooleResponse
|
||||
public const MODEL_DATABASE_LIST = 'databaseList';
|
||||
public const MODEL_COLLECTION = 'collection';
|
||||
public const MODEL_COLLECTION_LIST = 'collectionList';
|
||||
public const MODEL_VECTORDB_COLLECTION = 'vectordbCollection';
|
||||
public const MODEL_VECTORDB_COLLECTION_LIST = 'vectordbCollectionList';
|
||||
public const MODEL_VECTORSDB_COLLECTION = 'vectorsdbCollection';
|
||||
public const MODEL_VECTORSDB_COLLECTION_LIST = 'vectorsdbCollectionList';
|
||||
public const MODEL_EMBEDDING = 'embedding';
|
||||
public const MODEL_EMBEDDING_LIST = 'embeddingList';
|
||||
public const MODEL_TABLE = 'table';
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Utopia\Response\Filters;
|
||||
|
||||
use Appwrite\Utopia\Response;
|
||||
use Appwrite\Utopia\Response\Filter;
|
||||
|
||||
// Convert 1.9 Data format to 1.8 format
|
||||
class V21 extends Filter
|
||||
{
|
||||
public function parse(array $content, string $model): array
|
||||
{
|
||||
$parsedResponse = $content;
|
||||
|
||||
return match ($model) {
|
||||
Response::MODEL_SITE => $this->parseSite($content),
|
||||
Response::MODEL_SITE_LIST => $this->handleList(
|
||||
$content,
|
||||
"sites",
|
||||
fn ($item) => $this->parseSite($item),
|
||||
),
|
||||
Response::MODEL_FUNCTION => $this->parseFunction($content),
|
||||
Response::MODEL_FUNCTION_LIST => $this->handleList(
|
||||
$content,
|
||||
"functions",
|
||||
fn ($item) => $this->parseFunction($item),
|
||||
),
|
||||
default => $parsedResponse,
|
||||
};
|
||||
}
|
||||
|
||||
protected function parseSite(array $content): array
|
||||
{
|
||||
$content = $this->parseSpecs($content);
|
||||
return $content;
|
||||
}
|
||||
|
||||
protected function parseFunction(array $content): array
|
||||
{
|
||||
$content = $this->parseSpecs($content);
|
||||
return $content;
|
||||
}
|
||||
|
||||
protected function parseSpecs(array $content): array
|
||||
{
|
||||
$content['specification'] = $content['buildSpecification'] ?? $content['specification'] ?? null;
|
||||
unset($content['buildSpecification']);
|
||||
unset($content['runtimeSpecification']);
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
@@ -65,6 +65,12 @@ class Func extends Model
|
||||
'default' => '',
|
||||
'example' => 'python-3.8',
|
||||
])
|
||||
->addRule('deploymentRetention', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'How many days to keep the non-active deployments before they will be automatically deleted.',
|
||||
'default' => 0,
|
||||
'example' => 7,
|
||||
])
|
||||
->addRule('deploymentId', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Function\'s active deployment ID.',
|
||||
@@ -176,9 +182,15 @@ class Func extends Model
|
||||
'default' => false,
|
||||
'example' => false,
|
||||
])
|
||||
->addRule('specification', [
|
||||
->addRule('buildSpecification', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Machine specification for builds and executions.',
|
||||
'description' => 'Machine specification for deployment builds.',
|
||||
'default' => APP_COMPUTE_SPECIFICATION_DEFAULT,
|
||||
'example' => APP_COMPUTE_SPECIFICATION_DEFAULT,
|
||||
])
|
||||
->addRule('runtimeSpecification', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Machine specification for executions.',
|
||||
'default' => APP_COMPUTE_SPECIFICATION_DEFAULT,
|
||||
'example' => APP_COMPUTE_SPECIFICATION_DEFAULT,
|
||||
])
|
||||
|
||||
@@ -58,6 +58,12 @@ class Site extends Model
|
||||
'default' => '',
|
||||
'example' => 'react',
|
||||
])
|
||||
->addRule('deploymentRetention', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'How many days to keep the non-active deployments before they will be automatically deleted.',
|
||||
'default' => 0,
|
||||
'example' => 7,
|
||||
])
|
||||
->addRule('deploymentId', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Site\'s active deployment ID.',
|
||||
@@ -125,6 +131,12 @@ class Site extends Model
|
||||
'default' => '',
|
||||
'example' => 'npm run build',
|
||||
])
|
||||
->addRule('startCommand', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Custom command to use when starting site runtime.',
|
||||
'default' => '',
|
||||
'example' => 'node custom-server.mjs',
|
||||
])
|
||||
->addRule('outputDirectory', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'The directory where the site build output is located.',
|
||||
@@ -161,9 +173,15 @@ class Site extends Model
|
||||
'default' => false,
|
||||
'example' => false,
|
||||
])
|
||||
->addRule('specification', [
|
||||
->addRule('buildSpecification', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Machine specification for builds and executions.',
|
||||
'description' => 'Machine specification for deployment builds.',
|
||||
'default' => APP_COMPUTE_SPECIFICATION_DEFAULT,
|
||||
'example' => APP_COMPUTE_SPECIFICATION_DEFAULT,
|
||||
])
|
||||
->addRule('runtimeSpecification', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Machine specification for SSR executions.',
|
||||
'default' => APP_COMPUTE_SPECIFICATION_DEFAULT,
|
||||
'example' => APP_COMPUTE_SPECIFICATION_DEFAULT,
|
||||
])
|
||||
|
||||
@@ -267,81 +267,81 @@ class UsageProject extends Model
|
||||
'default' => 0,
|
||||
'example' => 0,
|
||||
])
|
||||
// VectorDB aggregates
|
||||
->addRule('vectordbDatabasesTotal', [
|
||||
// VectorsDB aggregates
|
||||
->addRule('vectorsdbDatabasesTotal', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Total aggregated number of VectorDB databases.',
|
||||
'description' => 'Total aggregated number of VectorsDB databases.',
|
||||
'default' => 0,
|
||||
'example' => 0,
|
||||
])
|
||||
->addRule('vectordbCollectionsTotal', [
|
||||
->addRule('vectorsdbCollectionsTotal', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Total aggregated number of VectorDB collections.',
|
||||
'description' => 'Total aggregated number of VectorsDB collections.',
|
||||
'default' => 0,
|
||||
'example' => 0,
|
||||
])
|
||||
->addRule('vectordbDocumentsTotal', [
|
||||
->addRule('vectorsdbDocumentsTotal', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Total aggregated number of VectorDB documents.',
|
||||
'description' => 'Total aggregated number of VectorsDB documents.',
|
||||
'default' => 0,
|
||||
'example' => 0,
|
||||
])
|
||||
->addRule('vectordbDatabasesStorageTotal', [
|
||||
->addRule('vectorsdbDatabasesStorageTotal', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Total aggregated VectorDB storage (bytes).',
|
||||
'description' => 'Total aggregated VectorsDB storage (bytes).',
|
||||
'default' => 0,
|
||||
'example' => 0,
|
||||
])
|
||||
->addRule('vectordbDatabasesReadsTotal', [
|
||||
->addRule('vectorsdbDatabasesReadsTotal', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Total aggregated number of VectorDB reads.',
|
||||
'description' => 'Total aggregated number of VectorsDB reads.',
|
||||
'default' => 0,
|
||||
'example' => 0,
|
||||
])
|
||||
->addRule('vectordbDatabasesWritesTotal', [
|
||||
->addRule('vectorsdbDatabasesWritesTotal', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Total aggregated number of VectorDB writes.',
|
||||
'description' => 'Total aggregated number of VectorsDB writes.',
|
||||
'default' => 0,
|
||||
'example' => 0,
|
||||
])
|
||||
->addRule('vectordbDatabases', [
|
||||
->addRule('vectorsdbDatabases', [
|
||||
'type' => Response::MODEL_METRIC,
|
||||
'description' => 'Aggregated VectorDB databases per period.',
|
||||
'description' => 'Aggregated VectorsDB databases per period.',
|
||||
'default' => [],
|
||||
'example' => [],
|
||||
'array' => true
|
||||
])
|
||||
->addRule('vectordbCollections', [
|
||||
->addRule('vectorsdbCollections', [
|
||||
'type' => Response::MODEL_METRIC,
|
||||
'description' => 'Aggregated VectorDB collections per period.',
|
||||
'description' => 'Aggregated VectorsDB collections per period.',
|
||||
'default' => [],
|
||||
'example' => [],
|
||||
'array' => true
|
||||
])
|
||||
->addRule('vectordbDocuments', [
|
||||
->addRule('vectorsdbDocuments', [
|
||||
'type' => Response::MODEL_METRIC,
|
||||
'description' => 'Aggregated VectorDB documents per period.',
|
||||
'description' => 'Aggregated VectorsDB documents per period.',
|
||||
'default' => [],
|
||||
'example' => [],
|
||||
'array' => true
|
||||
])
|
||||
->addRule('vectordbDatabasesStorage', [
|
||||
->addRule('vectorsdbDatabasesStorage', [
|
||||
'type' => Response::MODEL_METRIC,
|
||||
'description' => 'Aggregated VectorDB storage per period.',
|
||||
'description' => 'Aggregated VectorsDB storage per period.',
|
||||
'default' => [],
|
||||
'example' => [],
|
||||
'array' => true
|
||||
])
|
||||
->addRule('vectordbDatabasesReads', [
|
||||
->addRule('vectorsdbDatabasesReads', [
|
||||
'type' => Response::MODEL_METRIC,
|
||||
'description' => 'Aggregated VectorDB reads per period.',
|
||||
'description' => 'Aggregated VectorsDB reads per period.',
|
||||
'default' => [],
|
||||
'example' => [],
|
||||
'array' => true
|
||||
])
|
||||
->addRule('vectordbDatabasesWrites', [
|
||||
->addRule('vectorsdbDatabasesWrites', [
|
||||
'type' => Response::MODEL_METRIC,
|
||||
'description' => 'Aggregated VectorDB writes per period.',
|
||||
'description' => 'Aggregated VectorsDB writes per period.',
|
||||
'default' => [],
|
||||
'example' => [],
|
||||
'array' => true
|
||||
|
||||
+3
-3
@@ -5,7 +5,7 @@ namespace Appwrite\Utopia\Response\Model;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Appwrite\Utopia\Response\Model;
|
||||
|
||||
class UsageVectorDB extends Model
|
||||
class UsageVectorsDB extends Model
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
@@ -86,11 +86,11 @@ class UsageVectorDB extends Model
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
return 'UsageVectorDB';
|
||||
return 'UsageVectorsDB';
|
||||
}
|
||||
|
||||
public function getType(): string
|
||||
{
|
||||
return Response::MODEL_USAGE_VECTORDB;
|
||||
return Response::MODEL_USAGE_VECTORSDB;
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -5,7 +5,7 @@ namespace Appwrite\Utopia\Response\Model;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Appwrite\Utopia\Response\Model;
|
||||
|
||||
class UsageVectorDBs extends Model
|
||||
class UsageVectorsDBs extends Model
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
@@ -18,7 +18,7 @@ class UsageVectorDBs extends Model
|
||||
])
|
||||
->addRule('databasesTotal', [
|
||||
'type' => self::TYPE_INTEGER,
|
||||
'description' => 'Total aggregated number of VectorDB databases.',
|
||||
'description' => 'Total aggregated number of VectorsDB databases.',
|
||||
'default' => 0,
|
||||
'example' => 0,
|
||||
])
|
||||
@@ -99,11 +99,11 @@ class UsageVectorDBs extends Model
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
return 'UsageVectorDBs';
|
||||
return 'UsageVectorsDBs';
|
||||
}
|
||||
|
||||
public function getType(): string
|
||||
{
|
||||
return Response::MODEL_USAGE_VECTORDBS;
|
||||
return Response::MODEL_USAGE_VECTORSDBS;
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -4,7 +4,7 @@ namespace Appwrite\Utopia\Response\Model;
|
||||
|
||||
use Appwrite\Utopia\Response;
|
||||
|
||||
class VectorDBCollection extends Collection
|
||||
class VectorsDBCollection extends Collection
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
@@ -31,11 +31,11 @@ class VectorDBCollection extends Collection
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
return 'VectorDB Collection';
|
||||
return 'VectorsDB Collection';
|
||||
}
|
||||
|
||||
public function getType(): string
|
||||
{
|
||||
return Response::MODEL_VECTORDB_COLLECTION;
|
||||
return Response::MODEL_VECTORSDB_COLLECTION;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user