From 26b291000080f7846eae2524a2276e108e559267 Mon Sep 17 00:00:00 2001 From: Glax Date: Sun, 20 Oct 2024 01:30:50 +0200 Subject: [PATCH] Add GET /v2/Jobs/Standby --- Tranga/Server/Server.cs | 1 + Tranga/Server/v2Jobs.cs | 7 +++++++ docs/API_Calls_v2.md | 10 ++++++++++ 3 files changed, 18 insertions(+) diff --git a/Tranga/Server/Server.cs b/Tranga/Server/Server.cs index 818a6c9..acc5644 100644 --- a/Tranga/Server/Server.cs +++ b/Tranga/Server/Server.cs @@ -39,6 +39,7 @@ public partial class Server : GlobalBase, IDisposable new ("GET", @"/v2/Jobs/Running", GetV2JobsRunning), new ("GET", @"/v2/Jobs/Waiting", GetV2JobsWaiting), new ("GET", @"/v2/Jobs/Monitoring", GetV2JobsMonitoring), + new ("GET", @"/v2/Jobs/Standby", GetV2JobsStandby), new ("GET", @"/v2/Job/Types", GetV2JobTypes), new ("POST", @"/v2/Job/Create/([a-zA-Z]+)", PostV2JobCreateType), new ("GET", @"/v2/Job", GetV2Job), diff --git a/Tranga/Server/v2Jobs.cs b/Tranga/Server/v2Jobs.cs index 1146612..a0eb9b4 100644 --- a/Tranga/Server/v2Jobs.cs +++ b/Tranga/Server/v2Jobs.cs @@ -26,6 +26,13 @@ public partial class Server .Select(job => job.id)); } + private ValueTuple GetV2JobsStandby(GroupCollection groups, Dictionary requestParameters) + { + return new ValueTuple(HttpStatusCode.OK, _parent.jobBoss.jobs + .Where(job => job.progressToken.state is ProgressToken.State.Standby) + .Select(job => job.id)); + } + private ValueTuple GetV2JobsMonitoring(GroupCollection groups, Dictionary requestParameters) { return new ValueTuple(HttpStatusCode.OK, _parent.jobBoss.jobs diff --git a/docs/API_Calls_v2.md b/docs/API_Calls_v2.md index e5048e2..bdd3cde 100644 --- a/docs/API_Calls_v2.md +++ b/docs/API_Calls_v2.md @@ -333,6 +333,16 @@ Returns all Waiting Jobs as IDs. List of JobIds. +### ![GET](https://img.shields.io/badge/GET-0f0) `/v2/Jobs/Standby` + +Returns all Standby Jobs as IDs. + +
+ Returns + +List of JobIds. +
+ ### ![GET](https://img.shields.io/badge/GET-0f0) `/v2/Jobs/Monitoring` Returns all Monitoring Jobs as IDs.