prefect_aws.microvm.payload
Parsing and validation of the /run lifecycle hook request.
Functions
parse_run_hook_request
/run lifecycle hook request.
Args:
body: The raw request body, a JSON object withmicrovmIdandrunHookPayload, whererunHookPayloadis a JSON-encoded string.
- The MicroVM ID and the validated payload.
InvalidRunHookPayload: If the body or payload is malformed, larger thanMAX_RUN_HOOK_PAYLOAD_BYTES, or has an unsupported major version.
Classes
InvalidRunHookPayload
Raised when a /run request cannot start a flow run.
RunHookPayload
The flow run to execute, as sent in the runHookPayload of a /run hook.
Attributes:
v: The major version of the payload format.flow_run_id: The ID of the flow run to execute.env: Environment variables to set before the flow run starts.entrypoint: A flow entrypoint such asflows/etl.py\:etl. When set, the flow is loaded from this entrypoint instead of from the deployment.working_dir: The directory to run the flow from whenentrypointis set.
RunHookRequest
The body of a /run lifecycle hook request.
Attributes:
microvm_id: The ID of the MicroVM that received the request.payload: The parsedrunHookPayload.