Skip to content

API & SDK

API

zPodFactory exposes it's own API through FastAPI which leverages the open standards for APIs:

It can be accessed on your zPodFactory instance at the following address:

  • http://zpodfactory.domain.lab:8000/openjson.json

If you want to access the Swagger/docs UI, you can access it at the following address:

  • http://zpodfactory.domain.lab:8000/docs

That said, the API is not usually meant to be used directly, but rather through the SDK that is generated from the OpenAPI JSON schema.

SDK and CLI updates will be pushed to PyPi, but if you wanted to set up a developer environment and generate the SDK, you can always generate it yourself using the following just command.

just is basically a next-gen Makefile like command line tool, that allows to define tasks in a justfile and run them from the command line (as shown in the sample below screenshot)

img

Generate updated Python SDK bindings from the running zPodFactory Project.

just zcli zpodsdk-update

We currently support a few just commands for this project and simplify some actions/tasks:

 just
Commands:
    alembic *args               # Run alembic command in zpodapi container
    alembic-downgrade rev="-1"  # Downgrade database schema -1
    alembic-revision message='update' # Generate alembic revision
    alembic-upgrade rev="head"  # Upgrade database schema to head
    zcli *args                  # Run zcli command
    zpod-release version        # Create a release version
    zpod-update version         # Update to a release version
    zpodapi-coverage            # Generate coverage docs
    zpodapi-exec *args="bash"   # Connect to zpodapi container and run command
    zpodapi-generate-openapi    # Generate openapi json
    zpodapi-pytest *args        # Run pytest in zpodapi
    zpodcore-start $COLUMNS=rich_cols # Start Docker Environment
    zpodcore-start-background $COLUMNS=rich_cols # Start Docker Environment in background
    zpodcore-stop               # Stop Docker Environment
    zpodengine-cmd *args        # Manually Run Command
    zpodengine-deploy-all       # Deploy all Flows
    zpodengine-prefect *args    # Manually Run Prefect Command
    zpodengine-run *args="bash" # Run command using zpodengine container
    zpodsdk-update              # Update zpodsdk

SDK

SDK is available on pypi:

❯ pip install zpodsdk

CLI

CLI is available on pypi:

❯ pip install zpodcli