Skip to content

Commit b8f3e29

Browse files
chore: update examples
Signed-off-by: Matthias Pichler <[email protected]>
1 parent d01ded3 commit b8f3e29

8 files changed

+136
-136
lines changed

examples/accumulate-room-readings.yaml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,43 @@ document:
44
name: accumulate-room-readings
55
version: 1.0.0-alpha1
66
do:
7-
- name: consumeReading
8-
listen:
9-
to:
10-
all:
11-
- with:
12-
source: https://my.home.com/sensor
13-
type: my.home.sensors.temperature
14-
correlate:
15-
roomId:
16-
from: .roomid
17-
output:
18-
from: .data.reading
19-
- with:
20-
source: https://my.home.com/sensor
21-
type: my.home.sensors.humidity
22-
correlate:
23-
roomId:
24-
from: .roomid
25-
output:
26-
from: .data.reading
7+
- consumeReading:
8+
listen:
9+
to:
10+
all:
11+
- with:
12+
source: https://my.home.com/sensor
13+
type: my.home.sensors.temperature
14+
correlate:
15+
roomId:
16+
from: .roomid
17+
output:
18+
from: .data.reading
19+
- with:
20+
source: https://my.home.com/sensor
21+
type: my.home.sensors.humidity
22+
correlate:
23+
roomId:
24+
from: .roomid
25+
output:
26+
from: .data.reading
2727
as: readings
28-
- name: logReading
29-
for:
30-
each: reading
31-
in: .readings
32-
do:
28+
- logReading:
29+
for:
30+
each: reading
31+
in: .readings
32+
do:
33+
call: openapi
34+
with:
35+
document:
36+
uri: http://myorg.io/ordersservices.json
37+
operationId: logreading
38+
- generateReport:
3339
call: openapi
3440
with:
3541
document:
3642
uri: http://myorg.io/ordersservices.json
37-
operationId: logreading
38-
- name: generateReport
39-
call: openapi
40-
with:
41-
document:
42-
uri: http://myorg.io/ordersservices.json
43-
operationId: produceReport
43+
operationId: produceReport
4444
timeout:
4545
after:
4646
hours: 1

examples/asyncapi.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ document:
44
name: bearer-auth
55
version: 1.0.0-alpha1
66
do:
7-
- name: greetUser
8-
call: asyncapi
9-
with:
10-
document:
11-
uri: https://fake.com/docs/asyncapi.json
12-
operationRef: findPetsByStatus
13-
server: staging
14-
message: getPetByStatusQuery
15-
binding: http
16-
payload:
17-
petId: ${ .pet.id }
18-
authentication:
19-
bearer:
20-
token: ${ .token }
7+
- greetUser:
8+
call: asyncapi
9+
with:
10+
document:
11+
uri: https://fake.com/docs/asyncapi.json
12+
operationRef: findPetsByStatus
13+
server: staging
14+
message: getPetByStatusQuery
15+
binding: http
16+
payload:
17+
petId: ${ .pet.id }
18+
authentication:
19+
bearer:
20+
token: ${ .token }

examples/bearer-auth-uri-format.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ document:
44
name: bearer-auth-uri-format
55
version: 1.0.0-alpha1
66
do:
7-
- name: getPetById
8-
call: http
9-
with:
10-
method: get
11-
endpoint:
12-
uri: https://petstore.swagger.io/v2/pet/1
13-
authentication:
14-
bearer:
15-
token: ${ .token }
7+
- getPetById:
8+
call: http
9+
with:
10+
method: get
11+
endpoint:
12+
uri: https://petstore.swagger.io/v2/pet/1
13+
authentication:
14+
bearer:
15+
token: ${ .token }

examples/bearer-auth.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ document:
44
name: bearer-auth
55
version: 1.0.0-alpha1
66
do:
7-
- name: getPetById
8-
call: http
9-
with:
10-
method: get
11-
endpoint:
12-
uri: https://petstore.swagger.io/v2/pet/{petId}
13-
authentication:
14-
bearer:
15-
token: ${ .token }
7+
- getPetById:
8+
call: http
9+
with:
10+
method: get
11+
endpoint:
12+
uri: https://petstore.swagger.io/v2/pet/{petId}
13+
authentication:
14+
bearer:
15+
token: ${ .token }

examples/call-http-shorthand-endpoint.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ document:
44
name: call-http-shorthand-endpoint
55
version: 1.0.0-alpha1
66
do:
7-
- name: getPetById
8-
call: http
9-
with:
10-
method: get
11-
endpoint: https://petstore.swagger.io/v2/pet/{petId}
7+
- getPetById:
8+
call: http
9+
with:
10+
method: get
11+
endpoint: https://petstore.swagger.io/v2/pet/{petId}

examples/mock-service-extension.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ document:
55
version: '0.1.0'
66
use:
77
extensions:
8-
- name: mockService
9-
extend: call
10-
when: ($task.with.endpoint != null and ($task.with.endpoint | startswith("https://mocked.service.com"))) or ($task.with.endpoint.uri != null and ($task.with.endpoint.uri | startswith("https://mocked.service.com")))
11-
before:
12-
set:
13-
statusCode: 200
14-
headers:
15-
Content-Type: application/json
16-
content:
17-
foo:
18-
bar: baz
19-
then: exit #using this, we indicate to the workflow we want to exit the extended task, thus just returning what we injected
8+
- mockService:
9+
extend: call
10+
when: ($task.with.endpoint != null and ($task.with.endpoint | startswith("https://mocked.service.com"))) or ($task.with.endpoint.uri != null and ($task.with.endpoint.uri | startswith("https://mocked.service.com")))
11+
before:
12+
set:
13+
statusCode: 200
14+
headers:
15+
Content-Type: application/json
16+
content:
17+
foo:
18+
bar: baz
19+
then: exit #using this, we indicate to the workflow we want to exit the extended task, thus just returning what we injected
2020
do:
21-
- name: get
22-
call: http
23-
with:
24-
method: get
25-
endpoint:
26-
uri: https://fake.com/sample
21+
- get:
22+
call: http
23+
with:
24+
method: get
25+
endpoint:
26+
uri: https://fake.com/sample

examples/switch-then-string.yaml

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,45 @@ document:
44
name: sample-workflow
55
version: '0.1.0'
66
do:
7-
- name: processOrder
8-
switch:
9-
- name: case1
10-
when: .orderType == "electronic"
11-
then: processElectronicOrder
12-
- name: case2
13-
when: .orderType == "physical"
14-
then: processPhysicalOrder
15-
- name: default
16-
then: handleUnknownOrderType
17-
- name: processElectronicOrder
18-
execute:
19-
sequentially:
20-
- name: validatePayment
21-
set:
22-
validate: true
23-
- name: fulfillOrder
24-
set:
25-
status: fulfilled
26-
then: exit
27-
- name: processPhysicalOrder
28-
execute:
29-
sequentially:
30-
- name: checkInventory
31-
set:
32-
inventory: clear
33-
- name: packItems
34-
set:
35-
items: 1
36-
- name: scheduleShipping
37-
set:
38-
address: Elmer St
39-
then: exit
40-
- name: handleUnknownOrderType
41-
execute:
42-
sequentially:
43-
- name: logWarning
44-
set:
45-
log: warn
46-
- name: notifyAdmin
47-
set:
48-
message: something's wrong
7+
- processOrder:
8+
switch:
9+
- case1:
10+
when: .orderType == "electronic"
11+
then: processElectronicOrder
12+
- case2:
13+
when: .orderType == "physical"
14+
then: processPhysicalOrder
15+
- default:
16+
then: handleUnknownOrderType
17+
- processElectronicOrder:
18+
execute:
19+
sequentially:
20+
- validatePayment:
21+
set:
22+
validate: true
23+
- fulfillOrder:
24+
set:
25+
status: fulfilled
26+
then: exit
27+
- processPhysicalOrder:
28+
execute:
29+
sequentially:
30+
- checkInventory:
31+
set:
32+
inventory: clear
33+
- packItems:
34+
set:
35+
items: 1
36+
- scheduleShipping:
37+
set:
38+
address: Elmer St
39+
then: exit
40+
- handleUnknownOrderType:
41+
execute:
42+
sequentially:
43+
- logWarning:
44+
set:
45+
log: warn
46+
- notifyAdmin:
47+
set:
48+
message: something's wrong

examples/use-authentication.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ use:
99
bearer:
1010
token: ${ .token }
1111
do:
12-
- name: getPetById
13-
call: http
14-
with:
15-
method: get
16-
endpoint:
17-
uri: https://petstore.swagger.io/v2/pet/{petId}
18-
authentication: petStoreAuth
12+
- getPetById:
13+
call: http
14+
with:
15+
method: get
16+
endpoint:
17+
uri: https://petstore.swagger.io/v2/pet/{petId}
18+
authentication: petStoreAuth

0 commit comments

Comments
 (0)