-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEngram.yaml
More file actions
216 lines (216 loc) · 8.27 KB
/
Engram.yaml
File metadata and controls
216 lines (216 loc) · 8.27 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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
apiVersion: catalog.bubustack.io/v1alpha1
kind: EngramTemplate
metadata:
name: http-request
annotations:
registry.bubustack.io/maturity: experimental
spec:
version: 0.1.1 # x-release-please-version
description: "Makes an HTTP request to a specified URL."
supportedModes:
- job
- deployment
- statefulset
image: ghcr.io/bubustack/http-request-engram:0.1.1 # x-release-please-version
configSchema:
type: object
properties:
defaultURL:
type: string
description: "The default URL to use if 'url' is not provided in the input."
defaultMethod:
type: string
description: "The default HTTP method to use if 'method' is not provided in the input."
defaultHeaders:
type: object
description: "Default HTTP headers. Input headers will be merged on top of these."
additionalProperties:
type: string
auth:
type: object
description: "Authentication configuration for the engram instance."
properties:
type:
type: string
enum: ["bearer", "basic", "customHeader"]
description: "The authentication type."
headerName:
type: string
description: "The name of the header for 'customHeader' auth."
proxy:
type: string
description: "The URL of the HTTP proxy to use for requests (e.g., 'http://user:pass@host:port')."
batching:
type: object
description: "Configuration for batching requests in streaming mode. This has no effect in job mode."
properties:
itemsPerBatch:
type: integer
default: 50
description: "The maximum number of requests to send concurrently in a single batch."
batchInterval:
type: string
default: "1s"
description: "The time to wait after one batch completes before starting the next (e.g., '500ms', '2s')."
pagination:
type: object
description: "Configuration for paginating API results in job mode. Fetches all pages and combines results."
properties:
mode:
type: string
enum: ["off", "nextUrl", "updateParam"]
default: "off"
description: "The pagination mode to use. Has no effect in streaming mode."
resultsPath:
type: string
description: "JSONPath to the array of results in the response body (e.g., '$.data[*]'). If empty, the entire body is treated as the result."
maxPages:
type: integer
default: 100
description: "A safeguard limit for the maximum number of pages to fetch."
nextURLPath:
type: string
description: "For 'nextUrl' mode: JSONPath to the URL for the next page in the response body (e.g., '$.links.next'). Resolved URLs must remain on the same origin (scheme + host) as the current page URL."
updateParam:
type: object
description: "For 'updateParam' mode: Configuration for the parameter to update on each request."
properties:
name:
type: string
description: "The name of the query parameter to update for each page (e.g., 'page', 'offset')."
type:
type: string
enum: ["page", "offset", "cursor"]
description: "The type of the parameter to update."
initialValue:
type: string
default: "1"
description: "The initial value for the parameter (use a string to accommodate cursors)."
increment:
type: integer
default: 1
description: "The value to increment for 'page' or 'offset' types."
cursorPath:
type: string
description: "For 'cursor' type: JSONPath to the value for the next cursor in the response body."
queryParams:
type: object
description: "Configuration for how query parameters are formatted."
properties:
arrayFormat:
type: string
enum: ["noBrackets", "brackets", "indices"]
default: "noBrackets"
description: "Controls the format for arrays in query parameters: noBrackets (foo=v1&foo=v2), brackets (foo[]=v1&foo[]=v2), or indices (foo[0]=v1&foo[1]=v2)."
response:
type: object
description: "Configuration for handling the HTTP response."
properties:
includeHeaders:
type: boolean
default: true
description: "If true, includes response headers in the output."
includeStatus:
type: boolean
default: true
description: "If true, includes the status code and text in the output."
format:
type: string
enum: ["auto", "json", "text", "file"]
default: "auto"
description: "The format for the response body. 'file' returns an object with base64 data (`encoding`, `data`, `sizeBytes`, optional `contentType`)."
outputFieldName:
type: string
default: "body"
description: "The field name to use for the output when format is 'text' or 'file'."
neverError:
type: boolean
default: false
description: "If true, the engram will succeed even on non-2xx HTTP status codes."
timeout:
type: string
default: "10s"
description: "Timeout for the HTTP request (e.g., '10s', '1m')."
redirects:
type: object
description: "Configuration for handling HTTP redirects."
properties:
follow:
type: boolean
default: true
description: "If true, the client will follow redirects."
maxRedirects:
type: integer
default: 10
description: "The maximum number of redirects to follow."
ignoreSSLIssues:
type: boolean
default: false
description: "If true, SSL certificate validation will be skipped."
secretSchema:
bearerToken:
description: "Secret containing the bearer token. Must have a 'bearer_token' key."
expectedKeys: ["bearer_token"]
required: false
basicAuth:
description: "Secret for basic auth. Must have 'basic_username' and 'basic_password' keys."
expectedKeys: ["basic_username", "basic_password"]
required: false
customHeader:
description: "Secret for a custom header. Must have a 'custom_header_value' key."
expectedKeys: ["custom_header_value"]
required: false
proxyAuth:
description: "Secret for proxy authentication. Must have 'proxy_username' and 'proxy_password' keys."
expectedKeys: ["proxy_username", "proxy_password"]
required: false
inputSchema:
type: object
properties:
url:
type: string
description: "The URL to send the request to. Optional when the Engram configures defaultURL."
method:
type: string
description: "The HTTP method to use (GET, POST, etc.). Defaults to the Engram's defaultMethod config, or GET if unset."
headers:
type: object
description: "A map of HTTP headers to send with the request."
additionalProperties:
type: string
body:
type: string
description: "The request body (for POST, PUT, etc.)."
outputSchema:
type: object
properties:
statusCode:
type: integer
description: "The HTTP status code of the response."
status:
type: string
description: "The HTTP status text of the response."
headers:
type: object
description: "A map of the response headers."
body:
oneOf:
- type: string
- type: object
properties:
encoding:
type: string
data:
type: string
sizeBytes:
type: integer
contentType:
type: string
description: "The response body. In response.format=file this field is an object with base64 payload metadata."
execution:
service:
ports:
- name: grpc
protocol: TCP
port: 9000
targetPort: 9000