Update a Deployment image 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 run a GraphQL mutation to update the image in your Deployment after manually pushing the image to a custom registry. This can be useful for automating code deploys using CI/CD.

At a minimum, your mutation has to include the following:

1mutation updateDeploymentImage {
2 updateDeploymentImage(
3 releaseName: "<deployment-release-name>", # for example "analytics-dev"
4 image: "<host>/<image-name>:<tag>", # for example docker.io/cmart123/ap-airflow:test4
5 runtimeVersion: "<runtime-version-number>" # for example "5.0.6"
6 )
7 {
8 id
9 }
10}

Alternatively, you can run this same mutation using cURL:

$curl 'https://houston.BASEDOMAIN/v1' \
> -H 'Content-Type: application/json' \
> -H 'Authorization: <your-token>' \
> --data-binary '{"query":"mutation updateDeploymentImage {updateDeploymentImage(releaseName: \"<deployment-release-name>\", image: \"<host>/<image-name>:<tag>\",runtimeVersion: \"<runtime-version-number>\"){id}}"}'

For the full custom registry setup, see Configure a custom registry for Deployment images.