-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample-bootstrap.workflow
More file actions
55 lines (53 loc) · 1.39 KB
/
sample-bootstrap.workflow
File metadata and controls
55 lines (53 loc) · 1.39 KB
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
version: "3.11"
id: "01J9SAMPLEBOOTSTRAP0000001"
name: "sample-bootstrap-seed"
description: "Demonstrates ensure, expectedStatuses, onStatus, bodyFile, dataFile, and forEach for collection bootstraps."
output: true
references:
apis:
- name: "accounts"
definition: "accounts"
input:
- name: "jwt"
type: "Text"
required: true
stages:
- name: "seed-accounts"
kind: "Http"
expectedStatuses: [201, 409]
dataFile: "./seed/accounts.json"
forEach: "accounts"
itemName: "account"
indexName: "accountIndex"
config:
apiRef: "accounts"
endpoint: "/api/accounts"
httpVerb: "POST"
bodyFile: "./payloads/bootstrap-account.json"
headers:
Content-Type: "application/json"
Authorization: "Bearer {{input.jwt}}"
onStatus:
409:
output:
conflict: "true"
conflictBody: "{{response.body}}"
ensure:
mode: "CreateIfMissing"
existsOn: [409]
output:
seedStatus: "existing"
mock:
status: 201
payload: |
{
"appId": "seeded-{{context:accountIndex}}",
"login": "{{context:account.login}}"
}
output:
created: "{{response.body}}"
accountAppId: "{{response.body.appId?}}"
endStage:
output:
foreachCount: "{{stage:seed-accounts.output.foreach_count}}"
foreachItems: "{{stage:seed-accounts.output.foreach_items}}"