Creates a new deployment from the provided schema. If a deployment with
the same name and flow_id already exists, the deployment is updated.If the deployment has an active schedule, flow runs will be scheduled.
When upserting, any scheduled runs from the existing deployment will be deleted.For more information, see https://docs.prefect.io/v3/concepts/deployments.
read_deployment_by_name(flow_name: str = Path(..., description='The name of the flow'), deployment_name: str = Path(..., description='The name of the deployment'), db: PrefectDBInterface = Depends(provide_database_interface)) -> schemas.responses.DeploymentResponse
Get a deployment using the name of the flow and the deployment.
bulk_delete_deployments(deployments: Optional[schemas.filters.DeploymentFilter] = Body(None, description='Filter criteria for deployments to delete'), limit: int = Body(BULK_OPERATION_LIMIT, ge=1, le=BULK_OPERATION_LIMIT, description=f'Maximum number of deployments to delete. Defaults to {BULK_OPERATION_LIMIT}.'), db: PrefectDBInterface = Depends(provide_database_interface)) -> DeploymentBulkDeleteResponse
Bulk delete deployments matching the specified filter criteria.Returns the IDs of deployments that were deleted.
schedule_deployment(deployment_id: UUID = Path(..., description='The deployment id', alias='id'), start_time: datetime.datetime = Body(None, description='The earliest date to schedule'), end_time: datetime.datetime = Body(None, description='The latest date to schedule'), min_time: float = Body(None, description='Runs will be scheduled until at least this long after the `start_time`', json_schema_extra={'format': 'time-delta'}), min_runs: int = Body(None, description='The minimum number of runs to schedule'), max_runs: int = Body(None, description='The maximum number of runs to schedule'), db: PrefectDBInterface = Depends(provide_database_interface)) -> None
Schedule runs for a deployment. For backfills, provide start/end times in the past.This function will generate the minimum number of runs that satisfy the min
and max times, and the min and max counts. Specifically, the following order
will be respected.
Runs will be generated starting on or after the start_time
No more than max_runs runs will be generated
No runs will be generated after end_time is reached
At least min_runs runs will be generated
Runs will be generated until at least start_time + min_time is reached
Create a flow run from a deployment.Any parameters not provided will be inferred from the deployment’s parameters.
If tags are not provided, the deployment’s tags will be used.If no state is provided, the flow run will be created in a SCHEDULED state.
Create multiple flow runs from a deployment.Any parameters not provided will be inferred from the deployment’s parameters.
If tags are not provided, the deployment’s tags will be used.If no state is provided, the flow runs will be created in a SCHEDULED state.
Get list of work-queues that are able to pick up the specified deployment.This endpoint is intended to be used by the UI to provide users warnings
about deployments that are unable to be executed because there are no work
queues that will pick up their runs, based on existing filter criteria. It
may be deprecated in the future because there is not a strict relationship
between work queues and deployments.