Skip to content

Commit f8b4b9a

Browse files
tdarolyTaher Darolywala
andauthored
add event trigger for Container Jobs 2023-04-01-preview (#23724)
* add event trigger for Container Jobs 2023-04-01-preview * prettier and avocado fix --------- Co-authored-by: Taher Darolywala <[email protected]>
1 parent 8a49d04 commit f8b4b9a

File tree

2 files changed

+240
-0
lines changed

2 files changed

+240
-0
lines changed

specification/app/resource-manager/Microsoft.App/preview/2023-04-01-preview/Jobs.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@
199199
"x-ms-examples": {
200200
"Create or Update Container Apps Job": {
201201
"$ref": "./examples/Job_CreateorUpdate.json"
202+
},
203+
"Create or Update Container Apps Job With Event Driver Trigger": {
204+
"$ref": "./examples/Job_CreateorUpdate_EventTrigger.json"
202205
}
203206
},
204207
"x-ms-long-running-operation": true,
@@ -706,6 +709,21 @@
706709
}
707710
}
708711
},
712+
"eventTriggerConfig": {
713+
"type": "object",
714+
"description": "Manual trigger configuration for a single execution job. Properties replicaCompletionCount and parallelism would be set to 1 by default",
715+
"properties": {
716+
"replicaCompletionCount": {
717+
"$ref": "#/definitions/ReplicaCompletionCount"
718+
},
719+
"parallelism": {
720+
"$ref": "#/definitions/Parallelism"
721+
},
722+
"scale": {
723+
"$ref": "./CommonDefinitions.json#/definitions/Scale"
724+
}
725+
}
726+
},
709727
"registries": {
710728
"description": "Collection of private container registry credentials used by a Container apps job",
711729
"type": "array",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345",
4+
"resourceGroupName": "rg",
5+
"jobName": "testcontainerAppsJob0",
6+
"api-version": "2023-04-01-preview",
7+
"JobEnvelope": {
8+
"location": "East US",
9+
"properties": {
10+
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
11+
"configuration": {
12+
"replicaTimeout": 10,
13+
"replicaRetryLimit": 10,
14+
"eventTriggerConfig": {
15+
"replicaCompletionCount": 1,
16+
"parallelism": 4,
17+
"scale": {
18+
"minReplicas": 1,
19+
"maxReplicas": 5,
20+
"rules": [
21+
{
22+
"name": "httpscalingrule",
23+
"custom": {
24+
"type": "http",
25+
"metadata": {
26+
"concurrentRequests": "50"
27+
}
28+
}
29+
}
30+
]
31+
}
32+
},
33+
"triggerType": "Event"
34+
},
35+
"template": {
36+
"containers": [
37+
{
38+
"image": "repo/testcontainerAppsJob0:v1",
39+
"name": "testcontainerAppsJob0",
40+
"probes": [
41+
{
42+
"type": "Liveness",
43+
"httpGet": {
44+
"path": "/health",
45+
"port": 8080,
46+
"httpHeaders": [
47+
{
48+
"name": "Custom-Header",
49+
"value": "Awesome"
50+
}
51+
]
52+
},
53+
"initialDelaySeconds": 5,
54+
"periodSeconds": 3
55+
}
56+
]
57+
}
58+
],
59+
"initContainers": [
60+
{
61+
"image": "repo/testcontainerAppsJob0:v4",
62+
"name": "testinitcontainerAppsJob0",
63+
"resources": {
64+
"cpu": 0.2,
65+
"memory": "100Mi"
66+
},
67+
"command": [
68+
"/bin/sh"
69+
],
70+
"args": [
71+
"-c",
72+
"while true; do echo hello; sleep 10;done"
73+
]
74+
}
75+
]
76+
}
77+
}
78+
}
79+
},
80+
"responses": {
81+
"200": {
82+
"headers": {},
83+
"body": {
84+
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerAppsJob0",
85+
"name": "testcontainerAppsJob0",
86+
"type": "Microsoft.App/jobs",
87+
"location": "East US",
88+
"properties": {
89+
"provisioningState": "InProgress",
90+
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
91+
"configuration": {
92+
"replicaTimeout": 10,
93+
"replicaRetryLimit": 10,
94+
"manualTriggerConfig": {
95+
"replicaCompletionCount": 1,
96+
"parallelism": 4
97+
},
98+
"triggerType": "Manual"
99+
},
100+
"template": {
101+
"containers": [
102+
{
103+
"image": "repo/testcontainerAppsJob0:v4",
104+
"name": "testcontainerAppsJob0",
105+
"resources": {
106+
"cpu": 0.2,
107+
"memory": "100Mi"
108+
},
109+
"probes": [
110+
{
111+
"type": "Liveness",
112+
"httpGet": {
113+
"path": "/health",
114+
"port": 8080,
115+
"httpHeaders": [
116+
{
117+
"name": "Custom-Header",
118+
"value": "Awesome"
119+
}
120+
]
121+
},
122+
"initialDelaySeconds": 3,
123+
"periodSeconds": 3
124+
}
125+
]
126+
}
127+
],
128+
"initContainers": [
129+
{
130+
"image": "repo/testcontainerAppsJob0:v4",
131+
"name": "testinitcontainerAppsJob0",
132+
"resources": {
133+
"cpu": 0.2,
134+
"memory": "100Mi"
135+
},
136+
"command": [
137+
"/bin/sh"
138+
],
139+
"args": [
140+
"-c",
141+
"while true; do echo hello; sleep 10;done"
142+
]
143+
}
144+
]
145+
},
146+
"eventStreamEndpoint": "testEndpoint"
147+
}
148+
}
149+
},
150+
"201": {
151+
"headers": {
152+
"Location": "location"
153+
},
154+
"body": {
155+
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerAppsJob0",
156+
"name": "testcontainerAppsJob0",
157+
"type": "Microsoft.App/jobs",
158+
"location": "East US",
159+
"properties": {
160+
"provisioningState": "InProgress",
161+
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube",
162+
"configuration": {
163+
"replicaTimeout": 10,
164+
"replicaRetryLimit": 10,
165+
"manualTriggerConfig": {
166+
"replicaCompletionCount": 1,
167+
"parallelism": 4
168+
},
169+
"triggerType": "Manual"
170+
},
171+
"template": {
172+
"containers": [
173+
{
174+
"image": "repo/testcontainerAppsJob0:v4",
175+
"name": "testcontainerAppsJob0",
176+
"resources": {
177+
"cpu": 0.2,
178+
"memory": "100Mi"
179+
},
180+
"probes": [
181+
{
182+
"type": "Liveness",
183+
"httpGet": {
184+
"path": "/health",
185+
"port": 8080,
186+
"httpHeaders": [
187+
{
188+
"name": "Custom-Header",
189+
"value": "Awesome"
190+
}
191+
]
192+
},
193+
"initialDelaySeconds": 3,
194+
"periodSeconds": 3
195+
}
196+
]
197+
}
198+
],
199+
"initContainers": [
200+
{
201+
"image": "repo/testcontainerAppsJob0:v4",
202+
"name": "testinitcontainerAppsJob0",
203+
"resources": {
204+
"cpu": 0.2,
205+
"memory": "100Mi"
206+
},
207+
"command": [
208+
"/bin/sh"
209+
],
210+
"args": [
211+
"-c",
212+
"while true; do echo hello; sleep 10;done"
213+
]
214+
}
215+
]
216+
},
217+
"eventStreamEndpoint": "testEndpoint"
218+
}
219+
}
220+
}
221+
}
222+
}

0 commit comments

Comments
 (0)