-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrest-endpoints.camel.yaml
41 lines (41 loc) · 1.33 KB
/
rest-endpoints.camel.yaml
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
- rest:
get:
- id: get-transactions
description: An endpoint to retrieve the last 10 transactions
param:
- description: Limit how many records are returned
dataType: integer
name: limit
required: false
type: query
path: /transactions
produces: application/json
to: direct:get-transactions
- route:
id: route-1526
from:
description: An endpoint to retrieve the last 10 transactions
uri: direct:get-transactions
steps:
- to:
id: to-1127
description: Retrieve the last n records
uri: sql:SELECT * FROM transactions ORDER BY timestamp DESC LIMIT
:#${headerAs(limit, int)};
parameters:
dataSource: "#PostgresqlDataSource"
- marshal:
id: marshal-2107
description: Convert to JSON
json:
prettyPrint: true
useList: true
- beans:
- name: PostgresqlDataSource
properties:
databaseName: "{{secret:postgres/database-name}}"
password: "{{secret:postgres/database-password}}"
portNumber: "5432"
serverName: postgres.rm066rh-dev.svc.cluster.local
user: "{{secret:postgres/database-user}}"
type: org.postgresql.ds.PGSimpleDataSource