-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevent_simulator_fail.sh
73 lines (61 loc) · 2.31 KB
/
event_simulator_fail.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
# Replace <REPLACE-ME> with the actual webhook IDs
# Mainframe Webhook
echo "Emitting kickoff event..."
curl -X POST 'https://api.prefect.cloud/hooks/<REPLACE-ME>' -H "Content-Type: application/json" -d '{
"event_name": "kickoff",
"file_name": "example-file-fail.csv",
"stage": "on-prem",
"trackingId": "aaa89264-c79c-11eb-b8bc-0242ac140007"
}'
sleep 10
# Mainframe Webhook
echo "Emitting file transfer event..."
curl -X POST 'https://api.prefect.cloud/hooks/<REPLACE-ME>' -H "Content-Type: application/json" -d '{
"event_name": "transfer",
"file_name": "example-file-fail.csv",
"stage": "distributed",
"trackingId": "aaa89264-c79c-11eb-b8bc-0242ac140007"
}'
sleep 10
# Azure Storage Webhook
echo "Emitting storage blob created event..."
curl -X POST 'https://api.prefect.cloud/hooks/<REPLACE-ME>' -H "Content-Type: application/json" -d '[{
"topic": "/subscriptions/{subscription-id}/resourceGroups/Storage/providers/Microsoft.Storage/storageAccounts/my-storage-account",
"subject": "/blobServices/default/containers/test-container/blobs/new-file.txt",
"eventType": "Microsoft.Storage.BlobCreated",
"eventTime": "2017-06-26T18:41:00.9584103Z",
"id": "831e1650-001e-001b-66ab-eeb76e069631",
"data": {
"api": "PutBlockList",
"clientRequestId": "6d79dbfb-0e37-4fc4-981f-442c9ca65760",
"requestId": "831e1650-001e-001b-66ab-eeb76e000000",
"eTag": "asdf",
"contentType": "text/plain",
"contentLength": 524288,
"blobType": "BlockBlob",
"url": "https://my-storage-account.blob.core.windows.net/testcontainer/example-file-fail.csv",
"sequencer": "00000000000004420000000000028963",
"storageDiagnostics": {
"batchId": "b68529f3-68cd-4744-baa4-3c0498ec19f0"
}
},
"dataVersion": "",
"metadataVersion": "1"
}]'
sleep 10
# Summary Webhook
echo "Emitting summary event..."
curl -X POST 'https://api.prefect.cloud/hooks/<REPLACE-ME>' -H "Content-Type: application/json" -d '{
"totalRecordsSent": 123,
"trackingId": "aaa89264-c79c-11eb-b8bc-0242ac140007"
}'
sleep 10
# Reconciliation Webhook
echo "Emitting reconciliation event..."
curl -X POST 'https://api.prefect.cloud/hooks/<REPLACE-ME>' -H "Content-Type: application/json" -d '{
"totalRecordsReceived": 122,
"trackingId": "aaa89264-c79c-11eb-b8bc-0242ac140007"
}'
sleep 10
echo "All events emitted successfully."