mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge branch 'feat-functions-refactor' of github.com:appwrite/appwrite into feat-add-builds-worker
This commit is contained in:
@@ -64,7 +64,7 @@ App::post('/v1/functions')
|
||||
'status' => 'disabled',
|
||||
'name' => $name,
|
||||
'runtime' => $runtime,
|
||||
'tag' => '',
|
||||
'deployment' => '',
|
||||
'vars' => $vars,
|
||||
'events' => $events,
|
||||
'schedule' => $schedule,
|
||||
@@ -314,8 +314,8 @@ App::put('/v1/functions/:functionId')
|
||||
}
|
||||
|
||||
$original = $function->getAttribute('schedule', '');
|
||||
$cron = (!empty($function->getAttribute('tag', null)) && !empty($schedule)) ? new CronExpression($schedule) : null;
|
||||
$next = (!empty($function->getAttribute('tag', null)) && !empty($schedule)) ? $cron->getNextRunDate()->format('U') : 0;
|
||||
$cron = (!empty($function->getAttribute('deployment', null)) && !empty($schedule)) ? new CronExpression($schedule) : null;
|
||||
$next = (!empty($function->getAttribute('deployment', null)) && !empty($schedule)) ? $cron->getNextRunDate()->format('U') : 0;
|
||||
|
||||
$function = $dbForProject->updateDocument('functions', $function->getId(), new Document(array_merge($function->getArrayCopy(), [
|
||||
'execute' => $execute,
|
||||
@@ -343,38 +343,38 @@ App::put('/v1/functions/:functionId')
|
||||
$response->dynamic($function, Response::MODEL_FUNCTION);
|
||||
});
|
||||
|
||||
App::patch('/v1/functions/:functionId/tag')
|
||||
App::patch('/v1/functions/:functionId/deployment')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Update Function Tag')
|
||||
->desc('Update Function Deployment')
|
||||
->label('scope', 'functions.write')
|
||||
->label('event', 'functions.tags.update')
|
||||
->label('event', 'functions.deployments.update')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'updateTag')
|
||||
->label('sdk.description', '/docs/references/functions/update-function-tag.md')
|
||||
->label('sdk.method', 'updateDeployment')
|
||||
->label('sdk.description', '/docs/references/functions/update-function-deployment.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_FUNCTION)
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('tag', '', new UID(), 'Tag ID.')
|
||||
->param('deployment', '', new UID(), 'Deployment ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
->inject('project')
|
||||
->action(function ($functionId, $tag, $response, $dbForProject, $project) {
|
||||
->action(function ($functionId, $deployment, $response, $dbForProject, $project) {
|
||||
/** @var Appwrite\Utopia\Response $response */
|
||||
/** @var Utopia\Database\Database $dbForProject */
|
||||
/** @var Utopia\Database\Document $project */
|
||||
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
$tag = $dbForProject->getDocument('tags', $tag);
|
||||
$build = $dbForProject->getDocument('builds', $tag->getAttribute('buildId', ''));
|
||||
$deployment = $dbForProject->getDocument('deployments', $deployment);
|
||||
$build = $dbForProject->getDocument('builds', $deployment->getAttribute('buildId'));
|
||||
|
||||
if ($function->isEmpty()) {
|
||||
throw new Exception('Function not found', 404);
|
||||
}
|
||||
|
||||
if ($tag->isEmpty()) {
|
||||
throw new Exception('Tag not found', 404);
|
||||
if ($deployment->isEmpty()) {
|
||||
throw new Exception('Deployment not found', 404);
|
||||
}
|
||||
|
||||
if ($build->isEmpty()) {
|
||||
@@ -386,11 +386,11 @@ App::patch('/v1/functions/:functionId/tag')
|
||||
}
|
||||
|
||||
$schedule = $function->getAttribute('schedule', '');
|
||||
$cron = (empty($function->getAttribute('tag')) && !empty($schedule)) ? new CronExpression($schedule) : null;
|
||||
$next = (empty($function->getAttribute('tag')) && !empty($schedule)) ? $cron->getNextRunDate()->format('U') : 0;
|
||||
$cron = (empty($function->getAttribute('deployment')) && !empty($schedule)) ? new CronExpression($schedule) : null;
|
||||
$next = (empty($function->getAttribute('deployment')) && !empty($schedule)) ? $cron->getNextRunDate()->format('U') : 0;
|
||||
|
||||
$function = $dbForProject->updateDocument('functions', $function->getId(), new Document(array_merge($function->getArrayCopy(), [
|
||||
'tag' => $tag->getId(),
|
||||
'deployment' => $deployment->getId(),
|
||||
'scheduleNext' => (int)$next,
|
||||
])));
|
||||
|
||||
@@ -431,7 +431,7 @@ App::delete('/v1/functions/:functionId')
|
||||
|
||||
$function = $dbForProject->getDocument('functions', $functionId);
|
||||
|
||||
// Request executor to delete tag containers
|
||||
// Request executor to delete deployment containers
|
||||
$ch = \curl_init();
|
||||
\curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
|
||||
\curl_setopt($ch, CURLOPT_URL, "http://appwrite-executor/v1/functions/$functionId");
|
||||
@@ -476,20 +476,20 @@ App::delete('/v1/functions/:functionId')
|
||||
$response->noContent();
|
||||
});
|
||||
|
||||
App::post('/v1/functions/:functionId/tags')
|
||||
App::post('/v1/functions/:functionId/deployments')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Create Tag')
|
||||
->desc('Create Deployment')
|
||||
->label('scope', 'functions.write')
|
||||
->label('event', 'functions.tags.create')
|
||||
->label('event', 'functions.deployments.create')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'createTag')
|
||||
->label('sdk.description', '/docs/references/functions/create-tag.md')
|
||||
->label('sdk.method', 'createDeployment')
|
||||
->label('sdk.description', '/docs/references/functions/create-deployment.md')
|
||||
->label('sdk.packaging', true)
|
||||
->label('sdk.request.type', 'multipart/form-data')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_TAG)
|
||||
->label('sdk.response.model', Response::MODEL_DEPLOYMENT)
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('entrypoint', '', new Text('1028'), 'Entrypoint File.')
|
||||
->param('code', [], new File(), 'Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.', false)
|
||||
@@ -550,23 +550,21 @@ App::post('/v1/functions/:functionId/tags')
|
||||
}
|
||||
|
||||
if ((bool) $deploy) {
|
||||
// Remove deploy for all other tags.
|
||||
$tags = $dbForProject->find('tags', [
|
||||
// Remove deploy for all other deployments.
|
||||
$deployments = $dbForProject->find('deployments', [
|
||||
new Query('deploy', Query::TYPE_EQUAL, [true]),
|
||||
new Query('functionId', Query::TYPE_EQUAL, [$functionId])
|
||||
]);
|
||||
|
||||
foreach ($tags as $tag) {
|
||||
$tag->setAttribute('deploy', false);
|
||||
$dbForProject->updateDocument('tags', $tag->getId(), $tag);
|
||||
foreach ($deployments as $deployment) {
|
||||
$deployment->setAttribute('deploy', false);
|
||||
$dbForProject->updateDocument('deployments', $deployment->getId(), $deployment);
|
||||
}
|
||||
}
|
||||
|
||||
$tagId = $dbForProject->getId();
|
||||
|
||||
// TODO : What should be the read and write permissons of a tag?
|
||||
$tag = $dbForProject->createDocument('tags', new Document([
|
||||
'$id' => $tagId,
|
||||
$deploymentId = $dbForProject->getId();
|
||||
$deployment = $dbForProject->createDocument('deployments', new Document([
|
||||
'$id' => $deploymentId,
|
||||
'$read' => ['role:all'],
|
||||
'$write' => ['role:all'],
|
||||
'functionId' => $function->getId(),
|
||||
@@ -574,45 +572,46 @@ App::post('/v1/functions/:functionId/tags')
|
||||
'entrypoint' => $entrypoint,
|
||||
'path' => $path,
|
||||
'size' => $size,
|
||||
'search' => implode(' ', [$tagId, $entrypoint]),
|
||||
'search' => implode(' ', [$deploymentId, $entrypoint]),
|
||||
'status' => 'processing',
|
||||
'buildStdout' => '',
|
||||
'buildStderr' => '',
|
||||
'deploy' => ($deploy === 'true'),
|
||||
]));
|
||||
|
||||
$usage
|
||||
->setParam('storage', $tag->getAttribute('size', 0))
|
||||
;
|
||||
|
||||
// Enqueue a message to start the build
|
||||
Resque::enqueue('v1-builds', 'BuildsV1', [
|
||||
'projectId' => $project->getId(),
|
||||
'functionId' => $function->getId(),
|
||||
'tagId' => $tagId,
|
||||
'deploymentId' => $deploymentId,
|
||||
'type' => BUILD_TYPE_TAG
|
||||
]);
|
||||
|
||||
$usage
|
||||
->setParam('storage', $deployment->getAttribute('size', 0))
|
||||
;
|
||||
|
||||
|
||||
$response->setStatusCode(Response::STATUS_CODE_CREATED);
|
||||
$response->dynamic($tag, Response::MODEL_TAG);
|
||||
$response->dynamic($deployment, Response::MODEL_DEPLOYMENT);
|
||||
});
|
||||
|
||||
App::get('/v1/functions/:functionId/tags')
|
||||
App::get('/v1/functions/:functionId/deployments')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('List Tags')
|
||||
->desc('List Deployments')
|
||||
->label('scope', 'functions.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'listTags')
|
||||
->label('sdk.description', '/docs/references/functions/list-tags.md')
|
||||
->label('sdk.method', 'listDeployments')
|
||||
->label('sdk.description', '/docs/references/functions/list-deployments.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_TAG_LIST)
|
||||
->label('sdk.response.model', Response::MODEL_DEPLOYMENT_LIST)
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)
|
||||
->param('limit', 25, new Range(0, 100), 'Maximum number of tags to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
|
||||
->param('limit', 25, new Range(0, 100), 'Maximum number of deployments to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
|
||||
->param('offset', 0, new Range(0, APP_LIMIT_COUNT), 'Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)', true)
|
||||
->param('cursor', '', new UID(), 'ID of the tag used as the starting point for the query, excluding the tag itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)', true)
|
||||
->param('cursor', '', new UID(), 'ID of the deployment used as the starting point for the query, excluding the deployment itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)', true)
|
||||
->param('cursorDirection', Database::CURSOR_AFTER, new WhiteList([Database::CURSOR_AFTER, Database::CURSOR_BEFORE]), 'Direction of the cursor.', true)
|
||||
->param('orderType', 'ASC', new WhiteList(['ASC', 'DESC'], true), 'Order result by ASC or DESC order.', true)
|
||||
->inject('response')
|
||||
@@ -628,10 +627,10 @@ App::get('/v1/functions/:functionId/tags')
|
||||
}
|
||||
|
||||
if (!empty($cursor)) {
|
||||
$cursorTag = $dbForProject->getDocument('tags', $cursor);
|
||||
$cursorDeployment = $dbForProject->getDocument('deployments', $cursor);
|
||||
|
||||
if ($cursorTag->isEmpty()) {
|
||||
throw new Exception("Tag '{$cursor}' for the 'cursor' value not found.", 400);
|
||||
if ($cursorDeployment->isEmpty()) {
|
||||
throw new Exception("Deployment '{$cursor}' for the 'cursor' value not found.", 400);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -643,40 +642,40 @@ App::get('/v1/functions/:functionId/tags')
|
||||
|
||||
$queries[] = new Query('functionId', Query::TYPE_EQUAL, [$function->getId()]);
|
||||
|
||||
$results = $dbForProject->find('tags', $queries, $limit, $offset, [], [$orderType], $cursorTag ?? null, $cursorDirection);
|
||||
$sum = $dbForProject->count('tags', $queries, APP_LIMIT_COUNT);
|
||||
$results = $dbForProject->find('deployments', $queries, $limit, $offset, [], [$orderType], $cursorDeployment ?? null, $cursorDirection);
|
||||
$sum = $dbForProject->count('deployments', $queries, APP_LIMIT_COUNT);
|
||||
|
||||
// Get Current Build Data
|
||||
foreach ($results as &$tag) {
|
||||
$build = $dbForProject->getDocument('builds', $tag->getAttribute('buildId', ''));
|
||||
foreach ($results as &$deployment) {
|
||||
$build = $dbForProject->getDocument('builds', $deployment->getAttribute('buildId', ''));
|
||||
|
||||
$tag['status'] = $build->getAttribute('status', 'processing');
|
||||
$tag['buildStdout'] = $build->getAttribute('stdout', '');
|
||||
$tag['buildStderr'] = $build->getAttribute('stderr', '');
|
||||
$deployment['status'] = $build->getAttribute('status', 'processing');
|
||||
$deployment['buildStdout'] = $build->getAttribute('stdout', '');
|
||||
$deployment['buildStderr'] = $build->getAttribute('stderr', '');
|
||||
}
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'tags' => $results,
|
||||
'deployments' => $results,
|
||||
'sum' => $sum,
|
||||
]), Response::MODEL_TAG_LIST);
|
||||
]), Response::MODEL_DEPLOYMENT_LIST);
|
||||
});
|
||||
|
||||
App::get('/v1/functions/:functionId/tags/:tagId')
|
||||
App::get('/v1/functions/:functionId/deployments/:deploymentId')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Get Tag')
|
||||
->desc('Get Deployment')
|
||||
->label('scope', 'functions.read')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'getTag')
|
||||
->label('sdk.description', '/docs/references/functions/get-tag.md')
|
||||
->label('sdk.method', 'getDeployment')
|
||||
->label('sdk.description', '/docs/references/functions/get-deployment.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_TAG)
|
||||
->label('sdk.response.model', Response::MODEL_DEPLOYMENT_LIST)
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('tagId', '', new UID(), 'Tag ID.')
|
||||
->param('deploymentId', '', new UID(), 'Deployment ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
->action(function ($functionId, $tagId, $response, $dbForProject) {
|
||||
->action(function ($functionId, $deploymentId, $response, $dbForProject) {
|
||||
/** @var Appwrite\Utopia\Response $response */
|
||||
/** @var Utopia\Database\Database $dbForProject */
|
||||
|
||||
@@ -686,37 +685,37 @@ App::get('/v1/functions/:functionId/tags/:tagId')
|
||||
throw new Exception('Function not found', 404);
|
||||
}
|
||||
|
||||
$tag = $dbForProject->getDocument('tags', $tagId);
|
||||
$deployment = $dbForProject->getDocument('deployments', $deploymentId);
|
||||
|
||||
if ($tag->getAttribute('functionId') !== $function->getId()) {
|
||||
throw new Exception('Tag not found', 404);
|
||||
if ($deployment->getAttribute('functionId') !== $function->getId()) {
|
||||
throw new Exception('Deployment not found', 404);
|
||||
}
|
||||
|
||||
if ($tag->isEmpty()) {
|
||||
throw new Exception('Tag not found', 404);
|
||||
if ($deployment->isEmpty()) {
|
||||
throw new Exception('Deployment not found', 404);
|
||||
}
|
||||
|
||||
$response->dynamic($tag, Response::MODEL_TAG);
|
||||
$response->dynamic($deployment, Response::MODEL_DEPLOYMENT);
|
||||
});
|
||||
|
||||
App::delete('/v1/functions/:functionId/tags/:tagId')
|
||||
App::delete('/v1/functions/:functionId/deployments/:deploymentId')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Delete Tag')
|
||||
->desc('Delete Deployment')
|
||||
->label('scope', 'functions.write')
|
||||
->label('event', 'functions.tags.delete')
|
||||
->label('event', 'functions.deployments.delete')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_KEY])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'deleteTag')
|
||||
->label('sdk.description', '/docs/references/functions/delete-tag.md')
|
||||
->label('sdk.method', 'deleteDeployment')
|
||||
->label('sdk.description', '/docs/references/functions/delete-deployment.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->param('functionId', '', new UID(), 'Function ID.')
|
||||
->param('tagId', '', new UID(), 'Tag ID.')
|
||||
->param('deploymentId', '', new UID(), 'Deployment ID.')
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
->inject('usage')
|
||||
->inject('project')
|
||||
->action(function ($functionId, $tagId, $response, $dbForProject, $usage, $project) {
|
||||
->action(function ($functionId, $deploymentId, $response, $dbForProject, $usage, $project) {
|
||||
/** @var Appwrite\Utopia\Response $response */
|
||||
/** @var Utopia\Database\Database $dbForProject */
|
||||
/** @var Appwrite\Event\Event $usage */
|
||||
@@ -728,20 +727,20 @@ App::delete('/v1/functions/:functionId/tags/:tagId')
|
||||
throw new Exception('Function not found', 404);
|
||||
}
|
||||
|
||||
$tag = $dbForProject->getDocument('tags', $tagId);
|
||||
$deployment = $dbForProject->getDocument('deployments', $deploymentId);
|
||||
|
||||
if ($tag->getAttribute('functionId') !== $function->getId()) {
|
||||
throw new Exception('Tag not found', 404);
|
||||
if ($deployment->getAttribute('functionId') !== $function->getId()) {
|
||||
throw new Exception('Deployment not found', 404);
|
||||
}
|
||||
|
||||
if ($tag->isEmpty()) {
|
||||
throw new Exception('Tag not found', 404);
|
||||
if ($deployment->isEmpty()) {
|
||||
throw new Exception('deployment not found', 404);
|
||||
}
|
||||
|
||||
// Request executor to delete tag containers
|
||||
// Request executor to delete deployment containers
|
||||
$ch = \curl_init();
|
||||
\curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
|
||||
\curl_setopt($ch, CURLOPT_URL, "http://appwrite-executor/v1/tags/$tagId");
|
||||
\curl_setopt($ch, CURLOPT_URL, "http://appwrite-executor/v1/deployments/$deploymentId");
|
||||
\curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
\curl_setopt($ch, CURLOPT_TIMEOUT, 900);
|
||||
\curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||
@@ -769,20 +768,20 @@ App::delete('/v1/functions/:functionId/tags/:tagId')
|
||||
|
||||
$device = Storage::getDevice('functions');
|
||||
|
||||
if ($device->delete($tag->getAttribute('path', ''))) {
|
||||
if (!$dbForProject->deleteDocument('tags', $tag->getId())) {
|
||||
throw new Exception('Failed to remove tag from DB', 500);
|
||||
if ($device->delete($deployment->getAttribute('path', ''))) {
|
||||
if (!$dbForProject->deleteDocument('deployments', $deployment->getId())) {
|
||||
throw new Exception('Failed to remove deployment from DB', 500);
|
||||
}
|
||||
}
|
||||
|
||||
if($function->getAttribute('tag') === $tag->getId()) { // Reset function tag
|
||||
if($function->getAttribute('deployment') === $deployment->getId()) { // Reset function deployment
|
||||
$function = $dbForProject->updateDocument('functions', $function->getId(), new Document(array_merge($function->getArrayCopy(), [
|
||||
'tag' => '',
|
||||
'deployment' => '',
|
||||
])));
|
||||
}
|
||||
|
||||
$usage
|
||||
->setParam('storage', $tag->getAttribute('size', 0) * -1)
|
||||
->setParam('storage', $deployment->getAttribute('size', 0) * -1)
|
||||
;
|
||||
|
||||
$response->noContent();
|
||||
@@ -821,14 +820,14 @@ App::post('/v1/functions/:functionId/executions')
|
||||
throw new Exception('Function not found', 404);
|
||||
}
|
||||
|
||||
$tag = Authorization::skip(fn() => $dbForProject->getDocument('tags', $function->getAttribute('tag')));
|
||||
$deployment = Authorization::skip(fn() => $dbForProject->getDocument('deployments', $function->getAttribute('deployment')));
|
||||
|
||||
if ($tag->getAttribute('functionId') !== $function->getId()) {
|
||||
throw new Exception('Tag not found. Deploy tag before trying to execute a function', 404);
|
||||
if ($deployment->getAttribute('functionId') !== $function->getId()) {
|
||||
throw new Exception('Deployment not found. Deploy deployment before trying to execute a function', 404);
|
||||
}
|
||||
|
||||
if ($tag->isEmpty()) {
|
||||
throw new Exception('Tag not found. Deploy tag before trying to execute a function', 404);
|
||||
if ($deployment->isEmpty()) {
|
||||
throw new Exception('Deployment not found. Deploy deployment before trying to execute a function', 404);
|
||||
}
|
||||
|
||||
$validator = new Authorization('execute');
|
||||
@@ -845,7 +844,7 @@ App::post('/v1/functions/:functionId/executions')
|
||||
'$write' => ['role:all'],
|
||||
'dateCreated' => time(),
|
||||
'functionId' => $function->getId(),
|
||||
'tagId' => $tag->getId(),
|
||||
'deploymentId' => $deployment->getId(),
|
||||
'trigger' => 'http', // http / schedule / event
|
||||
'status' => 'waiting', // waiting / processing / completed / failed
|
||||
'statusCode' => 0,
|
||||
@@ -1095,7 +1094,7 @@ App::post('/v1/builds/:buildId')
|
||||
->groups(['api', 'functions'])
|
||||
->desc('Retry Build')
|
||||
->label('scope', 'functions.write')
|
||||
->label('event', 'functions.tags.update')
|
||||
->label('event', 'functions.deployments.update')
|
||||
->label('sdk.auth', [APP_AUTH_TYPE_SESSION, APP_AUTH_TYPE_KEY, APP_AUTH_TYPE_JWT])
|
||||
->label('sdk.namespace', 'functions')
|
||||
->label('sdk.method', 'retryBuild')
|
||||
|
||||
Reference in New Issue
Block a user