UWSConfig¶
- class safir.uws.UWSConfig(arq_mode, arq_redis_settings, async_post_route, execution_duration, job_summary_type, lifetime, parameters_type, signing_service_account, wobbly_url, worker, 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:
arq_mode (
ArqMode
)arq_redis_settings (
RedisSettings
)async_post_route (
UWSRoute
)execution_duration (
timedelta
)job_summary_type (
type
[JobSummary
])lifetime (
timedelta
)parameters_type (
type
[ParametersModel
])signing_service_account (
str
)wobbly_url (
str
|HttpUrl
)worker (
str
)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
,Job
],datetime
] |None
, default:None
)validate_execution_duration (
Callable
[[timedelta
|None
,Job
],timedelta
|None
] |None
, default:None
)wait_timeout (
timedelta
, default:datetime.timedelta(seconds=60)
)
Attributes Summary
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 the Pydantic model of 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 the Pydantic model of the job parameters. If
None
, 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
,Job
],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
|None
,Job
],timedelta
|None
] |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.