Adds DTOs for users summary, audit, sequence stats and delete plan, archive and server settings, dashboard, logs, render job parameters and render results, plus client calls for job pause/resume/priority, node failure and chunked render-result upload (sharing the frame upload chunk loop). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
61 lines
2.6 KiB
C#
61 lines
2.6 KiB
C#
namespace Titano.Protocol;
|
||
|
||
public sealed record JobDto(
|
||
Guid Id,
|
||
string Kind,
|
||
IReadOnlyList<Guid> TargetIds,
|
||
string? TargetLabel,
|
||
string State,
|
||
string Priority,
|
||
long ProgressDone,
|
||
long ProgressTotal,
|
||
double? ItemsPerSecond,
|
||
double? EtaSeconds,
|
||
string? LogTail,
|
||
string? NodeId,
|
||
int Attempts,
|
||
string? Error,
|
||
DateTimeOffset Created,
|
||
DateTimeOffset? Started,
|
||
DateTimeOffset? Finished);
|
||
|
||
/// <summary><c>POST /api/v1/jobs</c>: kind = render, deep-analyse, proxies, thumbs, verify, scan, rebuild, maintenance…</summary>
|
||
public sealed record CreateJobRequest(string Kind, IReadOnlyList<Guid> Target, string? ParametersJson);
|
||
|
||
/// <summary><c>POST /api/v1/nodes/register</c>: a client offers its GPU encoders (BRIEF §14.7).</summary>
|
||
public sealed record RegisterNodeRequest(string ClientName, IReadOnlyList<NodeEncoder> Encoders, int MaxWidth, int MaxHeight);
|
||
|
||
public sealed record NodeEncoder(string Codec, string Name, bool Hardware, bool TenBit);
|
||
|
||
public sealed record RenderNodeDto(Guid Id, string ClientName, string Username, IReadOnlyList<NodeEncoder> Encoders, DateTimeOffset LastHeartbeat, string State);
|
||
|
||
/// <summary><c>POST /api/v1/nodes/{id}/claim</c>: the job and everything needed to run it, or 204 when none matches.</summary>
|
||
public sealed record ClaimedJob(JobDto Job, Guid SequenceId, string SettingsJson, string PresetJson, bool UseProxies, IReadOnlyList<ManifestFrame> Frames);
|
||
|
||
/// <summary><c>POST /api/v1/nodes/{id}/jobs/{jobId}/progress</c>.</summary>
|
||
public sealed record NodeProgress(long Done, long Total, double? ItemsPerSecond, string? LogLine);
|
||
|
||
/// <summary><c>POST /api/v1/jobs/{id}/priority</c>: background, normal or user.</summary>
|
||
public sealed record JobPriorityRequest(string Priority);
|
||
|
||
/// <summary>
|
||
/// <c>parametersJson</c> of a render job: what to encode. Render nodes claim the job when they have an encoder for
|
||
/// <see cref="Codec"/> at <see cref="Width"/> × <see cref="Height"/> (BRIEF §14.7).
|
||
/// </summary>
|
||
public sealed record RenderJobParameters(string PresetName, string PresetJson, string Codec, int Width, int Height, bool UseProxies, string? SettingsJson);
|
||
|
||
/// <summary><c>POST /api/v1/nodes/{id}/jobs/{jobId}/result</c>: the finished output a node is about to upload in chunks.</summary>
|
||
public sealed record RenderResultRequest(
|
||
string FileName,
|
||
long Size,
|
||
string Sha256,
|
||
string PresetName,
|
||
string? Codec,
|
||
int Width,
|
||
int Height,
|
||
double Fps,
|
||
double DurationSeconds);
|
||
|
||
/// <summary><c>POST /api/v1/nodes/{id}/jobs/{jobId}/failed</c>: the node could not render the job.</summary>
|
||
public sealed record NodeJobFailure(string Error);
|