Documentation Index
Fetch the complete documentation index at: https://docs.prefect.io/llms.txt
Use this file to discover all available pages before exploring further.
prefect.server.models.deployments
Functions for interacting with deployment ORM objects.
Intended for internal use by the Prefect REST API.
Functions
create_deployment
session: a database sessiondeployment: a deployment model
- orm_models.Deployment: the newly-created or updated deployment
update_deployment
session: a database sessiondeployment_id: the ID of the deployment to modifydeployment: changes to a deployment model
- whether the deployment was updated
read_deployment
session: A database sessiondeployment_id: a deployment id
- orm_models.Deployment: the deployment
read_deployment_by_name
session: A database sessionname: a deployment nameflow_name: the name of the flow the deployment belongs to
- orm_models.Deployment: the deployment
read_deployments
session: A database sessionoffset: Query offsetlimit: Query limitflow_filter: only select deployments whose flows match these criteriaflow_run_filter: only select deployments whose flow runs match these criteriatask_run_filter: only select deployments whose task runs match these criteriadeployment_filter: only select deployment that match these filterswork_pool_filter: only select deployments whose work pools match these criteriawork_queue_filter: only select deployments whose work pool queues match these criteriasort: the sort criteria for selected deployments. Defaults tonameASC.
- list[orm_models.Deployment]: deployments
count_deployments
session: A database sessionflow_filter: only count deployments whose flows match these criteriaflow_run_filter: only count deployments whose flow runs match these criteriatask_run_filter: only count deployments whose task runs match these criteriadeployment_filter: only count deployment that match these filterswork_pool_filter: only count deployments that match these work pool filterswork_queue_filter: only count deployments that match these work pool queue filters
- the number of deployments matching filters
delete_deployment
session: A database sessiondeployment_id: a deployment id
- whether or not the deployment was deleted
delete_deployments
session: A database sessiondeployment_ids: a list of deployment ids to delete
- List[UUID]: the IDs of the deployments that were deleted
schedule_runs
session: a database sessiondeployment_id: the id of the deployment to schedulestart_time: the time from which to start scheduling runsend_time: runs will be scheduled until at most this timemin_time: runs will be scheduled until at least this far in the futuremin_runs: a minimum amount of runs to schedulemax_runs: a maximum amount of runs to schedule
- Runs will be generated starting on or after the
start_time - No more than
max_runsruns will be generated - No runs will be generated after
end_timeis reached - At least
min_runsruns will be generated - Runs will be generated until at least
start_time+min_timeis reached
- a list of flow run ids scheduled for the deployment
check_work_queues_for_deployment
- The deployment has ALL tags that the work queue has (i.e. the work queue’s tags must be a subset of the deployment’s tags).
- The work queue’s specified deployment IDs match the deployment’s ID, or the work queue does NOT have specified deployment IDs.
- The work queue’s specified flow runners match the deployment’s flow runner or the work queue does NOT have a specified flow runner.
- Our database currently allows either “null” and empty lists as null values in filters, so we need to catch both cases with “or”.
A.contains(B)should be interpreted as “True if A contains B”.
- List[orm_models.WorkQueue]: WorkQueues
create_deployment_schedules
session: A database sessiondeployment_id: a deployment idschedules: a list of deployment schedule create actions
read_deployment_schedules
session: A database sessiondeployment_id: a deployment id
- list[schemas.core.DeploymentSchedule]: the deployment’s schedules
update_deployment_schedule
session: A database sessiondeployment_schedule_id: a deployment schedule idschedule: a deployment schedule update action
delete_schedules_for_deployment
session: A database sessiondeployment_id: a deployment id
delete_deployment_schedule
session: A database sessiondeployment_schedule_id: a deployment schedule id
mark_deployments_ready
mark_deployments_not_ready
with_system_labels_for_deployment
with_system_labels_for_deployment_flow_run
session: Database sessiondeployment: The deployment the flow run is created fromuser_supplied_labels: Optional user-supplied labels to include
- Complete set of labels for the flow run