refactor(server): jobs (#2023)

* refactor: job to domain

* chore: regenerate open api

* chore: tests

* fix: missing breaks

* fix: get asset with missing exif data

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Jason Rasmussen
2023-03-20 11:55:28 -04:00
committed by GitHub
parent db6b14361d
commit 386eef046d
68 changed files with 1355 additions and 907 deletions

View File

@@ -395,6 +395,78 @@
]
}
},
"/jobs": {
"get": {
"operationId": "getAllJobsStatus",
"description": "",
"parameters": [],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AllJobStatusResponseDto"
}
}
}
}
},
"tags": [
"Job"
],
"security": [
{
"bearer": []
},
{
"cookie": []
}
]
}
},
"/jobs/{jobId}": {
"put": {
"operationId": "sendJobCommand",
"description": "",
"parameters": [
{
"name": "jobId",
"required": true,
"in": "path",
"schema": {
"$ref": "#/components/schemas/JobName"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/JobCommandDto"
}
}
}
},
"responses": {
"200": {
"description": ""
}
},
"tags": [
"Job"
],
"security": [
{
"bearer": []
},
{
"cookie": []
}
]
}
},
"/oauth/mobile-redirect": {
"get": {
"operationId": "mobileRedirect",
@@ -3169,85 +3241,6 @@
}
]
}
},
"/jobs": {
"get": {
"operationId": "getAllJobsStatus",
"description": "",
"parameters": [],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AllJobStatusResponseDto"
}
}
}
}
},
"tags": [
"Job"
],
"security": [
{
"bearer": []
},
{
"cookie": []
}
]
}
},
"/jobs/{jobId}": {
"put": {
"operationId": "sendJobCommand",
"description": "",
"parameters": [
{
"name": "jobId",
"required": true,
"in": "path",
"schema": {
"$ref": "#/components/schemas/JobId"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/JobCommandDto"
}
}
}
},
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "number"
}
}
}
}
},
"tags": [
"Job"
],
"security": [
{
"bearer": []
},
{
"cookie": []
}
]
}
}
},
"info": {
@@ -3604,6 +3597,108 @@
"isAutoBackup"
]
},
"JobCountsDto": {
"type": "object",
"properties": {
"active": {
"type": "integer"
},
"completed": {
"type": "integer"
},
"failed": {
"type": "integer"
},
"delayed": {
"type": "integer"
},
"waiting": {
"type": "integer"
}
},
"required": [
"active",
"completed",
"failed",
"delayed",
"waiting"
]
},
"AllJobStatusResponseDto": {
"type": "object",
"properties": {
"thumbnail-generation-queue": {
"$ref": "#/components/schemas/JobCountsDto"
},
"metadata-extraction-queue": {
"$ref": "#/components/schemas/JobCountsDto"
},
"video-conversion-queue": {
"$ref": "#/components/schemas/JobCountsDto"
},
"object-tagging-queue": {
"$ref": "#/components/schemas/JobCountsDto"
},
"clip-encoding-queue": {
"$ref": "#/components/schemas/JobCountsDto"
},
"storage-template-migration-queue": {
"$ref": "#/components/schemas/JobCountsDto"
},
"background-task-queue": {
"$ref": "#/components/schemas/JobCountsDto"
},
"search-queue": {
"$ref": "#/components/schemas/JobCountsDto"
}
},
"required": [
"thumbnail-generation-queue",
"metadata-extraction-queue",
"video-conversion-queue",
"object-tagging-queue",
"clip-encoding-queue",
"storage-template-migration-queue",
"background-task-queue",
"search-queue"
]
},
"JobName": {
"type": "string",
"enum": [
"thumbnail-generation-queue",
"metadata-extraction-queue",
"video-conversion-queue",
"object-tagging-queue",
"clip-encoding-queue",
"background-task-queue",
"storage-template-migration-queue",
"search-queue"
]
},
"JobCommand": {
"type": "string",
"enum": [
"start",
"pause",
"empty"
]
},
"JobCommandDto": {
"type": "object",
"properties": {
"command": {
"$ref": "#/components/schemas/JobCommand"
},
"force": {
"type": "boolean"
}
},
"required": [
"command",
"force"
]
},
"OAuthConfigDto": {
"type": "object",
"properties": {
@@ -5193,92 +5288,6 @@
"usage",
"usageByUser"
]
},
"JobCounts": {
"type": "object",
"properties": {
"active": {
"type": "integer"
},
"completed": {
"type": "integer"
},
"failed": {
"type": "integer"
},
"delayed": {
"type": "integer"
},
"waiting": {
"type": "integer"
}
},
"required": [
"active",
"completed",
"failed",
"delayed",
"waiting"
]
},
"AllJobStatusResponseDto": {
"type": "object",
"properties": {
"thumbnail-generation": {
"$ref": "#/components/schemas/JobCounts"
},
"metadata-extraction": {
"$ref": "#/components/schemas/JobCounts"
},
"video-conversion": {
"$ref": "#/components/schemas/JobCounts"
},
"machine-learning": {
"$ref": "#/components/schemas/JobCounts"
},
"storage-template-migration": {
"$ref": "#/components/schemas/JobCounts"
}
},
"required": [
"thumbnail-generation",
"metadata-extraction",
"video-conversion",
"machine-learning",
"storage-template-migration"
]
},
"JobId": {
"type": "string",
"enum": [
"thumbnail-generation",
"metadata-extraction",
"video-conversion",
"machine-learning",
"storage-template-migration"
]
},
"JobCommand": {
"type": "string",
"enum": [
"start",
"stop"
]
},
"JobCommandDto": {
"type": "object",
"properties": {
"command": {
"$ref": "#/components/schemas/JobCommand"
},
"includeAllAssets": {
"type": "boolean"
}
},
"required": [
"command",
"includeAllAssets"
]
}
}
}