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:
objectConfiguration 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:
arq_mode (
ArqMode)arq_redis_settings (
RedisSettings)async_post_route (
UWSRoute)database_url (
str|Url)execution_duration (
timedelta)lifetime (
timedelta)parameters_type (
type[ParametersModel])signing_service_account (
str)worker (
str)database_password (
SecretStr|None, default:None)slack_webhook (
SecretStr|None, default:None)sync_timeout (
timedelta, default:datetime.timedelta(seconds=300))url_lifetime (
timedelta, default:datetime.timedelta(seconds=900))validate_destruction (
Callable[[datetime,UWSJob],datetime] |None, default:None)validate_execution_duration (
Callable[[timedelta,UWSJob],timedelta] |None, default:None)wait_timeout (
timedelta, default:datetime.timedelta(seconds=60))
Attributes Summary
Password for the database.
Slack incoming webhook for reporting errors.
Route configuration for creating a sync job via GET.
Route configuration for creating a sync job via POST.
Maximum lifetime of a sync request.
How long result URLs should be valid for.
Validate a new destruction time for a job.
Validate a new execution duration for a job.
Maximum time a client can wait for a job change.
Attributes Documentation
-
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
UWSJobParameterobjects representing the job parameters. IfNone, 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
UWSJobParameterobjects representing the job parameters. IfNone, no route to create a job via sync POST will be created.
-
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.