How to call Prefect Python APIs within Prefect Ori...
# prefect-community
x
How to call Prefect Python APIs within Prefect Orion? Also, how to call Prefect Orion Python APIs from a Java application? Do we have any tutorial or doc for both cases?
z
Are you talking about using the “flow development” APIs like
@flow
and
@task
or the orchestration API via HTTP?
x
Orchestration APIs via HTTP
Especially I would like to deploy ABC.py which has flows, subflows and tasks, via Python Orion REST API. I don't see flow_location attribute in the Orion API doc. I am not sure how to pass the ABC.py and deploy the workflow.
If I only send the name, how do API know which python file to use and deploy?
z
The
DeploymentSpec
expands a
flow_location
into the
flow_data
document e.g.
{"encoding": "file", "blob": b"/path/to/ABC.py"}
The python API contains conveniences to construct the objects the orchestration API requires