Upsert a Deployment with the Houston API

Upsert a Deployment with configurations

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 Houston API creates a new Deployment according to your specifications. If you specify an existing deploymentUuid, the Houston API updates the Deployment with that ID. All queries to create a Deployment require specifying a workspaceUuid.

When you make upsert updates to your Airflow Deployments, you must explicitly specify all existing environment variables, otherwise, the upsert overwrites them.

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.

1mutation upsertDeployment(
2 $workspaceUuid: Uuid,
3 $deploymentUuid: Uuid,
4 $label: String,
5 $description: String,
6 $releaseName: String,
7 $namespace: String,
8 $environmentVariables: [InputEnvironmentVariable],
9 $image: String,
10 $dockerconfigjson: JSON,
11 $version: String,
12 $airflowVersion: String,
13 $runtimeVersion: String,
14 $executor: ExecutorType,
15 $workers: Workers,
16 $webserver: Webserver,
17 $scheduler: Scheduler,
18 $triggerer: Triggerer,
19 $dagProcessor: DagProcessor,
20 $dagDeployment: DagDeployment,
21 $properties: JSON,
22 $cloudRole: String
23) {
24 upsertDeployment(
25 workspaceUuid: $workspaceUuid,
26 deploymentUuid: $deploymentUuid,
27 label: $label,
28 description: $description,
29 releaseName: $releaseName,
30 namespace: $namespace,
31 environmentVariables: $environmentVariables,
32 image: $image,
33 dockerconfigjson: $dockerconfigjson,
34 version: $version,
35 airflowVersion: $airflowVersion,
36 runtimeVersion: $runtimeVersion,
37 executor: $executor,
38 workers: $workers,
39 webserver: $webserver,
40 scheduler: $scheduler,
41 triggerer: $triggerer,
42 dagProcessor: $dagProcessor,
43 dagDeployment: $dagDeployment,
44 properties: $properties,
45 cloudRole: $cloudRole
46) {
47 id
48 config
49 urls {
50 type
51 url
52 __typename
53 }
54 properties
55 description
56 label
57 releaseName
58 namespace
59 status
60 type
61 version
62 workspace {
63 id
64 label
65 __typename
66 }
67 airflowVersion
68 runtimeVersion
69 upsertedEnvironmentVariables {
70 key
71 value
72 isSecret
73 __typename
74 }
75 dagDeployment {
76 type
77 nfsLocation
78 repositoryUrl
79 branchName
80 syncInterval
81 syncTimeout
82 ephemeralStorage
83 dagDirectoryLocation
84 rev
85 sshKey
86 knownHosts
87 __typename
88 }
89 createdAt
90 updatedAt
91 __typename
92 }
93}
94{
95 "workspaceUuid": "cldemxl9502454yxe6vjlxy23",
96 "environmentVariables": [
97 {
98 "key": "AIRFLOW__CORE__COLORED_LOG_FORMAT",
99 "value": "test",
100 "isSecret": false
101 }
102 ],
103 "releaseName": "",
104 "namespace": "test-new-dep",
105 "executor": "CeleryExecutor",
106 "workers": {},
107 "webserver": {},
108 "scheduler": {
109 "replicas": 1
110 },
111 "dagProcessor": {},
112 "label": "test-new-dep",
113 "description": "",
114 "runtimeVersion": "7.2.0",
115 "properties": {
116 "extra_au": 0
117 },
118 "dagDeployment": {
119 "type": "image",
120 "nfsLocation": "",
121 "repositoryUrl": "",
122 "branchName": "",
123 "syncInterval": 1,
124 "syncTimeout": 120,
125 "ephemeralStorage": 2,
126 "dagDirectoryLocation": "",
127 "rev": "",
128 "sshKey": "",
129 "knownHosts": ""
130 }
131}