-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
service_definition.toml
100 lines (89 loc) · 2.28 KB
/
service_definition.toml
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# API Service Definition Example
[Main]
id = "clivern_poodle"
name = "clivern - poodle"
description = ""
timeout = "30s"
# service_url can also be a variable with default value {$serviceURL:http://127.0.0.1:8080}
service_url = "https://example.com/api/v1"
# These headers will be applied to all endpoints http calls
headers = [ ["Content-Type", "application/json"] ]
[Security]
# Supported Types are basic, bearer and api_key and none
scheme = "none"
[Security.Basic]
username = "{$authUsername:default}"
password = "{$authPassword:default}"
header = ["Authorization", "Basic base64(username:password)"]
[Security.ApiKey]
header = ["X-API-KEY", "{$authApiKey:default}"]
# In case of bearer authentication, it is recommended to create another
# service or endpoint to generate the bearer tokens
[Security.Bearer]
header = ["Authorization", "Bearer {$authBearerToken:default}"]
[[Endpoint]]
id = "GetSystemHealth"
name = "Get system health"
description = ""
method = "get"
# Security will be skipped for this endpoint
public = true
headers = []
parameters = []
uri = "/_health"
body = ""
[[Endpoint]]
id = "CreateItem"
name = "Create an item"
description = ""
method = "post"
headers = []
parameters = []
uri = "/item"
body = """
{
"name": "{$name}",
"type": "{$type:default}"
}
"""
[[Endpoint]]
id = "GetItems"
name = "Get a list of items"
description = ""
method = "get"
headers = []
parameters = [ ["limit", "{$limit:100}"], ["offset", "{$offset:0}"] ]
uri = "/item"
body = ""
[[Endpoint]]
id = "GetItem"
name = "Get an item"
description = ""
method = "get"
headers = []
parameters = []
uri = "/item/{$id}"
body = ""
[[Endpoint]]
id = "DeleteItem"
name = "Delete an item"
description = ""
method = "delete"
headers = []
parameters = []
uri = "/item/{$id}"
body = ""
[[Endpoint]]
id = "UpdateItem"
name = "Update an item"
description = ""
method = "put"
headers = []
parameters = []
uri = "/item/{$id}"
body = """
{
"name": "{$name}",
"type": "{$type:default}"
}
"""