You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
control-service: fix the examples in swagger (#945)
The examples for the query jobs endpoing (graphql) were not working
(syntax was wrong/broken) so this is fixing them.
I am also using markdown (which is supported by swagger) to visualize
them instead of html tags (which is hard to maintain)
Testing Done: started locally the service and inspected the swagger ui
Signed-off-by: Antoni Ivanov <[email protected]>
Copy file name to clipboardExpand all lines: projects/control-service/projects/model/apidefs/datajob-api/api.yaml
+148-142
Original file line number
Diff line number
Diff line change
@@ -142,15 +142,15 @@ paths:
142
142
Check the latest example for the full list of supported query fields.<br/><br/>
143
143
144
144
Simplest query that you could make is to fetch the job names
145
-
<pre>
146
-
{<br/>
147
-
jobs(pageNumber: 1, pageSize: 25) {<br/>
148
-
content {<br/>
149
-
jobName<br/>
150
-
}<br/>
151
-
}<br/>
152
-
}<br/>
153
-
</pre><br/>
145
+
```
146
+
{
147
+
jobs(pageNumber: 1, pageSize: 25) {
148
+
content {
149
+
jobName
150
+
}
151
+
}
152
+
}
153
+
```
154
154
155
155
You could also use filtering and sorting function. Filter object has <b>property, pattern and sort</b> fields.<br/>
156
156
* <b>property</b> points out which field you want to filter, if you point out some other field that is not supported,
@@ -160,155 +160,161 @@ paths:
160
160
If a pattern string is not provided, then you must atleast provide the property field<br/>
161
161
* <b>sort</b> should be an enum value - ASC (ascending) or DESC (descending) option [not required, default is ASC]
162
162
Multiple filters could be applied, but <b>maximum one should contain sorting</b>!
163
-
<pre>
164
-
{<br/>
165
-
jobs(<br/>
166
-
pageNumber: 1,<br/>
167
-
pageSize: 25,<br/>
168
-
filter: [{<br/>
169
-
property: "jobName",<br/>
170
-
pattern: "starshot",<br/>
171
-
sort: "DESC"<br/>
172
-
}],<br/>
173
-
) {<br/>
174
-
content {<br/>
175
-
jobName<br/>
176
-
}<br/>
177
-
}<br/>
178
-
}<br/>
179
-
</pre><br/>
163
+
```
164
+
{
165
+
jobs(
166
+
pageNumber: 1,
167
+
pageSize: 25,
168
+
filter: [{
169
+
property: "jobName",
170
+
pattern: "starshot",
171
+
sort: DESC
172
+
}],
173
+
) {
174
+
content {
175
+
jobName
176
+
}
177
+
}
178
+
}
179
+
```
180
180
181
181
You could also search for a string into the properties that you are requesting, for instance:
182
182
This query will search for job names, team names and descriptions which contains the provided "starshot" string
183
-
<pre>
184
-
{<br/>
185
-
jobs(<br/>
186
-
pageNumber: 1,<br/>
187
-
pageSize: 25,<br/>
188
-
search: "starshot"<br/>
189
-
) {<br/>
190
-
content {<br/>
191
-
jobName,<br/>
192
-
config {<br/>
193
-
team<br/>
194
-
description<br/>
195
-
}<br/>
196
-
}<br/>
197
-
}<br/>
198
-
}<br/>
199
-
</pre><br/>
183
+
```
184
+
{
185
+
jobs(
186
+
pageNumber: 1,
187
+
pageSize: 25,
188
+
search: "starshot"
189
+
) {
190
+
content {
191
+
jobName,
192
+
config {
193
+
team
194
+
description
195
+
}
196
+
}
197
+
}
198
+
}
199
+
```
200
200
201
201
Data jobs execution could also be searched by providing arguments to the <b>execution</b> field.
202
202
Same as parent query arguments, the <b>pageNumber</b> and <b>pageSize</b> arguments are required! Page number should be a <b>number greater than 1</b>,
203
203
and pageSize <b>should be between 1 and 100 results</b> (per page). You can also <b>filter</b> using the similar object structure as the parent query,
204
204
but currently <b>filtering is not supported</b>, you can only provide field for sorting.
0 commit comments