UWSConfig

class safir.uws.UWSConfig(arq_mode, arq_redis_settings, async_post_route, database_url, execution_duration, lifetime, parameters_type, signing_service_account, worker, database_password=None, slack_webhook=None, sync_get_route=None, sync_post_route=None, sync_timeout=datetime.timedelta(seconds=300), url_lifetime=datetime.timedelta(seconds=900), validate_destruction=None, validate_execution_duration=None, wait_timeout=datetime.timedelta(seconds=60))

Bases: object

Configuration for the UWS service.

The UWS service may be embedded in a variety of VO applications. This class encapsulates the configuration of the UWS component that may vary by service or specific installation.

Parameters:

Attributes Summary

database_password

Password for the database.

slack_webhook

Slack incoming webhook for reporting errors.

sync_get_route

Route configuration for creating a sync job via GET.

sync_post_route

Route configuration for creating a sync job via POST.

sync_timeout

Maximum lifetime of a sync request.

url_lifetime

How long result URLs should be valid for.

validate_destruction

Validate a new destruction time for a job.

validate_execution_duration

Validate a new execution duration for a job.

wait_timeout

Maximum time a client can wait for a job change.

Attributes Documentation

database_password: SecretStr | None = None

Password for the database.

slack_webhook: SecretStr | None = None

Slack incoming webhook for reporting errors.

sync_get_route: UWSRoute | None = None

Route configuration for creating a sync job via GET.

The FastAPI dependency included in this object should expect GET parameters and return a list of UWSJobParameter objects representing the job parameters. If None, no route to create a job via sync GET will be created.

sync_post_route: UWSRoute | None = None

Route configuration for creating a sync job via POST.

The FastAPI dependency included in this object should expect POST parameters and return a list of UWSJobParameter objects representing the job parameters. If None, no route to create a job via sync POST will be created.

sync_timeout: timedelta = datetime.timedelta(seconds=300)

Maximum lifetime of a sync request.

url_lifetime: timedelta = datetime.timedelta(seconds=900)

How long result URLs should be valid for.

validate_destruction: Callable[[datetime, UWSJob], datetime] | None = None

Validate a new destruction time for a job.

If provided, called with the requested destruction time and the current job record and should return the new destruction time. Otherwise, any destruction time before the configured maximum lifetime will be allowed.

validate_execution_duration: Callable[[timedelta, UWSJob], timedelta] | None = None

Validate a new execution duration for a job.

If provided, called with the requested execution duration and the current job record and should return the new execution duration time. Otherwise, the execution duration may not be changed.

wait_timeout: timedelta = datetime.timedelta(seconds=60)

Maximum time a client can wait for a job change.