-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
Showing
2 changed files
with
240 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
222 changes: 222 additions & 0 deletions
222
...er/Microsoft.App/preview/2023-04-01-preview/examples/Job_CreateorUpdate_EventTrigger.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,222 @@ | ||
{ | ||
"parameters": { | ||
"subscriptionId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", | ||
"resourceGroupName": "rg", | ||
"jobName": "testcontainerAppsJob0", | ||
"api-version": "2023-04-01-preview", | ||
"JobEnvelope": { | ||
"location": "East US", | ||
"properties": { | ||
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", | ||
"configuration": { | ||
"replicaTimeout": 10, | ||
"replicaRetryLimit": 10, | ||
"eventTriggerConfig": { | ||
"replicaCompletionCount": 1, | ||
"parallelism": 4, | ||
"scale": { | ||
"minReplicas": 1, | ||
"maxReplicas": 5, | ||
"rules": [ | ||
{ | ||
"name": "httpscalingrule", | ||
"custom": { | ||
"type": "http", | ||
"metadata": { | ||
"concurrentRequests": "50" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"triggerType": "Event" | ||
}, | ||
"template": { | ||
"containers": [ | ||
{ | ||
"image": "repo/testcontainerAppsJob0:v1", | ||
"name": "testcontainerAppsJob0", | ||
"probes": [ | ||
{ | ||
"type": "Liveness", | ||
"httpGet": { | ||
"path": "/health", | ||
"port": 8080, | ||
"httpHeaders": [ | ||
{ | ||
"name": "Custom-Header", | ||
"value": "Awesome" | ||
} | ||
] | ||
}, | ||
"initialDelaySeconds": 5, | ||
"periodSeconds": 3 | ||
} | ||
] | ||
} | ||
], | ||
"initContainers": [ | ||
{ | ||
"image": "repo/testcontainerAppsJob0:v4", | ||
"name": "testinitcontainerAppsJob0", | ||
"resources": { | ||
"cpu": 0.2, | ||
"memory": "100Mi" | ||
}, | ||
"command": [ | ||
"/bin/sh" | ||
], | ||
"args": [ | ||
"-c", | ||
"while true; do echo hello; sleep 10;done" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"headers": {}, | ||
"body": { | ||
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerAppsJob0", | ||
"name": "testcontainerAppsJob0", | ||
"type": "Microsoft.App/jobs", | ||
"location": "East US", | ||
"properties": { | ||
"provisioningState": "InProgress", | ||
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", | ||
"configuration": { | ||
"replicaTimeout": 10, | ||
"replicaRetryLimit": 10, | ||
"manualTriggerConfig": { | ||
"replicaCompletionCount": 1, | ||
"parallelism": 4 | ||
}, | ||
"triggerType": "Manual" | ||
}, | ||
"template": { | ||
"containers": [ | ||
{ | ||
"image": "repo/testcontainerAppsJob0:v4", | ||
"name": "testcontainerAppsJob0", | ||
"resources": { | ||
"cpu": 0.2, | ||
"memory": "100Mi" | ||
}, | ||
"probes": [ | ||
{ | ||
"type": "Liveness", | ||
"httpGet": { | ||
"path": "/health", | ||
"port": 8080, | ||
"httpHeaders": [ | ||
{ | ||
"name": "Custom-Header", | ||
"value": "Awesome" | ||
} | ||
] | ||
}, | ||
"initialDelaySeconds": 3, | ||
"periodSeconds": 3 | ||
} | ||
] | ||
} | ||
], | ||
"initContainers": [ | ||
{ | ||
"image": "repo/testcontainerAppsJob0:v4", | ||
"name": "testinitcontainerAppsJob0", | ||
"resources": { | ||
"cpu": 0.2, | ||
"memory": "100Mi" | ||
}, | ||
"command": [ | ||
"/bin/sh" | ||
], | ||
"args": [ | ||
"-c", | ||
"while true; do echo hello; sleep 10;done" | ||
] | ||
} | ||
] | ||
}, | ||
"eventStreamEndpoint": "testEndpoint" | ||
} | ||
} | ||
}, | ||
"201": { | ||
"headers": { | ||
"Location": "location" | ||
}, | ||
"body": { | ||
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/jobs/testcontainerAppsJob0", | ||
"name": "testcontainerAppsJob0", | ||
"type": "Microsoft.App/jobs", | ||
"location": "East US", | ||
"properties": { | ||
"provisioningState": "InProgress", | ||
"environmentId": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube", | ||
"configuration": { | ||
"replicaTimeout": 10, | ||
"replicaRetryLimit": 10, | ||
"manualTriggerConfig": { | ||
"replicaCompletionCount": 1, | ||
"parallelism": 4 | ||
}, | ||
"triggerType": "Manual" | ||
}, | ||
"template": { | ||
"containers": [ | ||
{ | ||
"image": "repo/testcontainerAppsJob0:v4", | ||
"name": "testcontainerAppsJob0", | ||
"resources": { | ||
"cpu": 0.2, | ||
"memory": "100Mi" | ||
}, | ||
"probes": [ | ||
{ | ||
"type": "Liveness", | ||
"httpGet": { | ||
"path": "/health", | ||
"port": 8080, | ||
"httpHeaders": [ | ||
{ | ||
"name": "Custom-Header", | ||
"value": "Awesome" | ||
} | ||
] | ||
}, | ||
"initialDelaySeconds": 3, | ||
"periodSeconds": 3 | ||
} | ||
] | ||
} | ||
], | ||
"initContainers": [ | ||
{ | ||
"image": "repo/testcontainerAppsJob0:v4", | ||
"name": "testinitcontainerAppsJob0", | ||
"resources": { | ||
"cpu": 0.2, | ||
"memory": "100Mi" | ||
}, | ||
"command": [ | ||
"/bin/sh" | ||
], | ||
"args": [ | ||
"-c", | ||
"while true; do echo hello; sleep 10;done" | ||
] | ||
} | ||
] | ||
}, | ||
"eventStreamEndpoint": "testEndpoint" | ||
} | ||
} | ||
} | ||
} | ||
} |