Table of Contents

Class DashboardAgentOptions

Namespace
Quartz
Assembly
Quartz.Dashboard.Agent.dll

How a scheduler dials out to a dashboard, and what it lets the dashboard do once it has.

public sealed class DashboardAgentOptions
Inheritance
DashboardAgentOptions
Inherited Members

Remarks

The agent is a plugin: UseDashboardAgent installs it on one scheduler, and that scheduler opens one outbound connection to Endpoint — the dashboard's agent hub — and keeps it open for as long as it runs. The dashboard then lists the scheduler as Agent, under the key {Target}/{scheduler name}, and drives it through that connection: every page, every action, the execution history and the live events.

The connection crosses a trust boundary by design, and the narrowings here are the only ones that hold against a dashboard that has been taken over: ReadOnly, IsOperationAllowed, MaxAccess and IsJobTypeAllowed are the agent's own decisions, made in the worker's process, and nothing the dashboard sends can widen them. The dashboard's own ReadOnly hides its buttons; it does not bind an agent.

Properties

AccessTokenProvider

Where the bearer token comes from when it is the host's own credential rather than a shared secret: a managed identity, an OIDC client-credentials flow. Asked before every connection, so a token that expires is renewed.

public Func<CancellationToken, ValueTask<string?>>? AccessTokenProvider { get; set; }

Property Value

Func<CancellationToken, ValueTask<string>>

ConfigureConnection

Configures the connection the agent dials out on: a proxy, a client certificate, which transports to try, or the handler a test routes it through.

public Action<HttpConnectionOptions>? ConfigureConnection { get; set; }

Property Value

Action<HttpConnectionOptions>

Endpoint

The dashboard's agent hub: the dashboard's path followed by /agents, for example https://ops.example.com/quartz/agents. Required.

public Uri? Endpoint { get; set; }

Property Value

Uri

HeartbeatInterval

How often the agent tells the dashboard it is alive. Fifteen seconds by default; the dashboard may ask for another interval when it accepts the registration, and the agent adopts it.

public TimeSpan HeartbeatInterval { get; set; }

Property Value

TimeSpan

IsJobTypeAllowed

Which job types a request through this agent may name. null — the default — refuses every one: an agent crosses a trust boundary, and with Quartz.Jobs on the probing path a dashboard that may name any IJob may run any executable on this machine.

public Func<string, bool>? IsJobTypeAllowed { get; set; }

Property Value

Func<string, bool>

Remarks

Only the operations that store a job by type name are refused — add-job, schedule-job with a job, and schedule-jobs. Triggering, pausing, rescheduling and deleting a job the scheduler already holds work with the predicate unset. The refusal is 403 with problem details naming this option as the remedy.

The predicate is given the job type name as it was written, and nothing resolves it first — the name is data until the scheduler loads it. Match on the string, and remember that one type has more than one spelling: Acme.Jobs.Nightly, Acme.Jobs and the same name carrying Version, Culture and PublicKeyToken are both it. A StartsWith on the namespace covers every spelling at once. The HTTP API's QuartzHttpApiOptions.IsJobTypeAllowed is the same predicate with the opposite default, because that surface is on the application's own network.

IsOperationAllowed

Which operations the agent accepts, by route name — Shutdown, PauseJob, ScheduleJob, the names the HTTP API publishes as its operation ids. null — the default — accepts every one. A refused operation is 403.

public Func<string, bool>? IsOperationAllowed { get; set; }

Property Value

Func<string, bool>

MaxAccess

The most the agent lets the dashboard do: Administer by default, which accepts everything the other narrowings allow. A request that needs more is 403. Added in 4.8.

public SchedulerAccess MaxAccess { get; set; }

Property Value

SchedulerAccess

Remarks

The levels are the operator roles' — View for reads, Operate for pausing, resuming, triggering, interrupting and the like, Administer for adding, deleting, rescheduling and shutting down — and the HTTP API's documentation lists which operation needs which. Triggering a job with job data needs Administer. Operate is a dashboard that may keep the worker running and may not change what it holds.

Checked after IsOperationAllowed and before ReadOnly, in the worker's process. The registration tells the dashboard, which hides the controls this refuses: a visitor's rights on this scheduler are the lower of their dashboard role and this.

MaxConcurrentOperations

How many of the dashboard's requests run at once. Four by default. The rest queue.

public int MaxConcurrentOperations { get; set; }

Property Value

int

MaxPageSize

The most items one paged request may return: 1000 by default, and 0 for no limit, as QuartzHttpApiOptions.MaxPageSize bounds the HTTP API.

public int MaxPageSize { get; set; }

Property Value

int

ReadOnly

Whether the agent refuses every operation that changes something. false by default. A refused operation is 403 to the dashboard, which shows the refusal.

public bool ReadOnly { get; set; }

Property Value

bool

Target

The name this process registers under, which is the first half of its scheduler's key on the dashboard. Defaults to MachineName. Cannot contain / or +.

public string? Target { get; set; }

Property Value

string

Remarks

Two processes cannot share a target: the second to connect is refused until the first is gone, and an agent that reconnects under the same target and the same scheduler instance id takes its own entry over. Give each process a target of its own where the machine name is not one — containers that restart under new names, or several workers on one machine.

Token

The bearer token the dashboard accepts — its AcceptAgents(a => a.Tokens.Primary = …), or the secondary one while a rotation is under way. Required unless AccessTokenProvider is set.

public string? Token { get; set; }

Property Value

string

Remarks

Sent as an Authorization: Bearer header on every connection, never in a URL.