Upsert a Deployment with the APC API
The examples on this page show common ways to use the APC API — they’re not a complete API reference. For the full, interactive API documentation for your installation, including every available query, mutation, and type, go to https://houston.<your-base-domain>/v1, and click on the Docs tab. See Develop and test APC API queries for more on using the built-in GraphQL explorer.
You can use the upsertDeployment mutation to both create and update Deployments with all possible Deployment configurations. If you query upsertDeployment without a deploymentUuid, the APC API creates a new Deployment according to your specifications. If you specify an existing deploymentUuid, the APC API updates the Deployment with that ID. All queries to create a Deployment require specifying a workspaceUuid.
The following query creates a new Deployment in a custom namespace test-new-dep and configures a Deployment environment variable AIRFLOW__CORE__COLORED_LOG_FORMAT.
More upsertDeployment examples
The following examples show upsertDeployment used for a few other common, narrower use cases.
Deploy a pre-built image from CI/CD
This approach is useful when you need to integrate with systems that can’t use the Astro CLI directly.
The mutation accepts the following fields:
releaseName: The release name of your Deployment, following the patternspaceyword-spaceyword-4digits. For example,infrared-photon-7780.image: The full image path including registry, repository, and tag. The image must be accessible from your Astro Private Cloud data plane.runtimeVersion: The Astro Runtime version that the image is based on. For example,12.1.0.deployRevisionDescription: An optional description for the deploy revision, useful for tracking deploys in the APC UI.
For more information about deploying custom images with the APC API, see Configure a custom image registry.
Configure NFS Dag deployment
Use upsertDeployment to configure a Deployment’s Dag deployment mechanism as an NFS volume mount:
For the full NFS setup, see Deploy Dags with NFS.
Skip Airflow database provisioning
To use pre-existing or managed databases, set skipAirflowDatabaseProvisioning to true in the upsertDeployment mutation:
When using external databases, provide the connection string in your Deployment configuration. For complete setup steps with connection string examples, see Bring your own Airflow database.