2
0

Add GET /v2/Jobs/Standby

This commit is contained in:
Glax 2024-10-20 01:30:50 +02:00
parent a88b85e599
commit 26b2910000
3 changed files with 18 additions and 0 deletions

View File

@ -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),

View File

@ -26,6 +26,13 @@ public partial class Server
.Select(job => job.id));
}
private ValueTuple<HttpStatusCode, object?> GetV2JobsStandby(GroupCollection groups, Dictionary<string, string> requestParameters)
{
return new ValueTuple<HttpStatusCode, object?>(HttpStatusCode.OK, _parent.jobBoss.jobs
.Where(job => job.progressToken.state is ProgressToken.State.Standby)
.Select(job => job.id));
}
private ValueTuple<HttpStatusCode, object?> GetV2JobsMonitoring(GroupCollection groups, Dictionary<string, string> requestParameters)
{
return new ValueTuple<HttpStatusCode, object?>(HttpStatusCode.OK, _parent.jobBoss.jobs

View File

@ -333,6 +333,16 @@ Returns all Waiting Jobs as IDs.
List of JobIds.
</details>
### <sub>![GET](https://img.shields.io/badge/GET-0f0)</sub> `/v2/Jobs/Standby`
Returns all Standby Jobs as IDs.
<details>
<summary>Returns</summary>
List of JobIds.
</details>
### <sub>![GET](https://img.shields.io/badge/GET-0f0)</sub> `/v2/Jobs/Monitoring`
Returns all Monitoring Jobs as IDs.