blob: 7bae19f1603719dca30ff6f09ca701d9d34be601 [file] [log] [blame]
Rohan Patel5f5c7ec2019-09-25 14:35:28 -04001openapi: 3.0.1
2info:
3 title: Open Test Framework API
4 description: A RESTful API used to communicate with the OTF test control unit.
5 contact:
6 name: OTF
7 url: https://localhost:32524
8 version: "1.0"
9tags:
10- name: Health Service
11 description: Query the availability of the API
12- name: Test Execution Service
13 description: Query the status and history of your test executions
14- name: Test Instance Service
15 description: Create, execute,and query test instances
16- name: Test Strategy Service
17 description: Deploy and delete test strategies to and from the test control unit.
18 (This documentation will only be available to the development team)
19paths:
20 /otf/api/health/v1:
21 get:
22 tags:
23 - Health Service
24 summary: Checks if the test control unit is available
25 operationId: getHealth_1
26 responses:
27 200:
28 description: The test control unit is available
29 content:
30 application/json:
31 schema:
32 $ref: '#/components/schemas/OtfApiResponse'
33 /otf/api/testExecution/v1/executionId/{executionId}:
34 get:
35 tags:
36 - Test Execution Service
37 operationId: getExecutionStatus_1
38 parameters:
39 - name: executionId
40 in: path
41 required: true
42 schema:
43 type: string
44 - name: Authorization
45 in: header
46 schema:
47 type: string
48 responses:
49 default:
50 description: default response
51 content:
52 application/json: {}
53 /otf/api/testInstance/execute/v1/id/{testInstanceId}:
54 post:
55 tags:
56 - Test Instance Service
57 summary: Executes a test instance by it's unique identifier
58 operationId: execute_1
59 parameters:
60 - name: testInstanceId
61 in: path
62 description: A string representation of a BSON ObjectId
63 required: true
64 schema:
65 type: string
66 description: The UUID of the test instance
67 format: uuid
68 example: 12345678912345678912345f
69 - name: Authorization
70 in: header
71 description: Base64 encoded Application Authorization Framework credentials
72 required: true
73 schema:
74 type: string
75 example: Basic b3RmQGF0dC5jb206cGFzc3dvcmQxMjM=
76 requestBody:
77 content:
78 application/json:
79 schema:
80 $ref: '#/components/schemas/ExecuteTestInstanceRequest'
81 responses:
82 200:
83 description: A successful synchronously executed test returns a test execution
84 object
85 content:
86 application/json:
87 schema:
88 $ref: '#/components/schemas/TestExecutionResult'
89 201:
90 description: |-
91 A successful asynchronously executed test with asyncMode set to 'poll' returns an execution identifier
92 The identifier can be used as a parameter to the Test Execution Service to check the status of the executed test
93 content:
94 application/json:
95 schema:
96 $ref: '#/components/schemas/TestExecutionResult'
97 401:
98 description: The mechanized identifier used with the request is prohibited
99 from accessing the resource.
100 content:
101 application/json:
102 schema:
103 $ref: '#/components/schemas/OtfApiResponse'
104 /otf/api/testInstance/v1/id/{id}:
105 get:
106 tags:
107 - Test Instance Service
108 operationId: findById_1
109 parameters:
110 - name: id
111 in: path
112 description: A string representation of a BSON ObjectId
113 required: true
114 schema:
115 type: string
116 description: The UUID of the test instance
117 format: uuid
118 example: 12345678912345678912345f
119 - name: Authorization
120 in: header
121 description: Base64 encoded Application Authorization Framework credentials
122 required: true
123 schema:
124 type: string
125 example: Basic b3RmQGF0dC5jb206cGFzc3dvcmQxMjM=
126 responses:
127 default:
128 description: default response
129 content:
130 application/json: {}
131 /otf/api/testInstance/create/v1/testDefinitionId/{testDefinitionId}/version/{version}:
132 post:
133 tags:
134 - Test Instance Service
135 summary: Create a test instance using the specified version of the test definition
136 operationId: createByTestDefinitionIdAndVersion_1
137 parameters:
138 - name: testDefinitionId
139 in: path
140 description: A string representation of a BSON ObjectId
141 required: true
142 schema:
143 type: string
144 description: The UUID of the test definition.
145 format: uuid
146 example: 12345678912345678912345f
147 - name: version
148 in: path
149 description: The version of the test definition used to create the instance
150 required: true
151 schema:
152 type: string
153 example: 2
154 - name: Authorization
155 in: header
156 description: Base64 encoded Application Authorization Framework credentials
157 required: true
158 schema:
159 type: string
160 example: Basic b3RmQGF0dC5jb206cGFzc3dvcmQxMjM=
161 - name: execute
162 in: query
163 description: Execute the test instance after it is created
164 allowEmptyValue: true
165 schema:
166 type: boolean
167 example: true
168 requestBody:
169 content:
170 application/json:
171 schema:
172 $ref: '#/components/schemas/CreateTestInstanceRequest'
173 responses:
174 201:
175 description: The created Test Instance object is returned when it is created
176 content:
177 application/json:
178 schema:
179 $ref: '#/components/schemas/TestInstance'
180 /otf/api/testInstance/v1/testInstanceName/{testInstanceName}:
181 get:
182 tags:
183 - Test Instance Service
184 summary: Finds a test instance by it's name
185 operationId: findByTestInstanceName_1
186 parameters:
187 - name: testInstanceName
188 in: path
189 description: The name of the test instance to retrieve
190 required: true
191 schema:
192 type: string
193 example: myTestInstance
194 - name: Authorization
195 in: header
196 description: Base64 encoded Application Authorization Framework credentials
197 required: true
198 schema:
199 type: string
200 example: Basic b3RmQGF0dC5jb206cGFzc3dvcmQxMjM=
201 responses:
202 200:
203 description: A test instance object is returned when if it is found
204 content:
205 application/json:
206 schema:
207 $ref: '#/components/schemas/TestInstance'
208 /otf/api/testInstance/v1/processDefinitionKey/{processDefinitionKey}:
209 get:
210 tags:
211 - Test Instance Service
212 operationId: findByProcessDefKey_1
213 parameters:
214 - name: processDefinitionKey
215 in: path
216 description: The process definition key associated with the test definition
217 required: true
218 schema:
219 type: string
220 example: someUniqueProcessDefinitionKey
221 - name: Authorization
222 in: header
223 description: Base64 encoded Application Authorization Framework credentials
224 required: true
225 schema:
226 type: string
227 example: Basic b3RmQGF0dC5jb206cGFzc3dvcmQxMjM=
228 responses:
229 default:
230 description: default response
231 content:
232 application/json: {}
233 /otf/api/testInstance/create/v1/testDefinitionId/{testDefinitionId}:
234 post:
235 tags:
236 - Test Instance Service
237 summary: Create a test instance using the latest version of the test definition
238 operationId: createByTestDefinitionId_1
239 parameters:
240 - name: testDefinitionId
241 in: path
242 description: A string representation of a BSON ObjectId
243 required: true
244 schema:
245 type: string
246 description: The UUID of the test definition
247 format: uuid
248 example: 12345678912345678912345f
249 - name: Authorization
250 in: header
251 description: Base64 encoded Application Authorization Framework credentials
252 required: true
253 schema:
254 type: string
255 example: Basic b3RmQGF0dC5jb206cGFzc3dvcmQxMjM=
256 - name: execute
257 in: query
258 description: Execute the test instance after it is created
259 allowEmptyValue: true
260 schema:
261 type: boolean
262 example: true
263 requestBody:
264 content:
265 application/json:
266 schema:
267 $ref: '#/components/schemas/CreateTestInstanceRequest'
268 responses:
269 201:
270 description: The created Test Instance object is returned when it is created
271 content:
272 application/json:
273 schema:
274 $ref: '#/components/schemas/TestInstance'
275 /otf/api/testInstance/v1/processDefinitionKey/{processDefinitionKey}/version/{version}:
276 get:
277 tags:
278 - Test Instance Service
279 operationId: findByProcessDefKeyAndVersion_1
280 parameters:
281 - name: processDefinitionKey
282 in: path
283 description: The process definition key associated with the test definition
284 required: true
285 schema:
286 type: string
287 example: someUniqueProcessDefinitionKey
288 - name: version
289 in: path
290 description: The version of the test definition used to create the instance
291 required: true
292 schema:
293 type: string
294 example: 2
295 - name: Authorization
296 in: header
297 description: Base64 encoded Application Authorization Framework credentials
298 required: true
299 schema:
300 type: string
301 example: Basic b3RmQGF0dC5jb206cGFzc3dvcmQxMjM=
302 responses:
303 default:
304 description: default response
305 content:
306 application/json: {}
307 /otf/api/testInstance/create/v1/processDefinitionKey/{processDefinitionKey}/version/{version}:
308 post:
309 tags:
310 - Test Instance Service
311 summary: Create a test instance using the specified version of the test definition
312 operationId: createByProcessDefKeyAndVersion_1
313 parameters:
314 - name: processDefinitionKey
315 in: path
316 description: The process definition key associated with the test definition
317 required: true
318 schema:
319 type: string
320 example: someUniqueProcessDefinitionKey
321 - name: version
322 in: path
323 description: The version of the test definition used to create the instance
324 required: true
325 schema:
326 type: string
327 example: 2
328 - name: Authorization
329 in: header
330 description: Base64 encoded Application Authorization Framework credentials
331 required: true
332 schema:
333 type: string
334 example: Basic b3RmQGF0dC5jb206cGFzc3dvcmQxMjM=
335 - name: execute
336 in: query
337 description: Execute the test instance after it is created
338 allowEmptyValue: true
339 schema:
340 type: boolean
341 example: true
342 requestBody:
343 content:
344 application/json:
345 schema:
346 $ref: '#/components/schemas/CreateTestInstanceRequest'
347 responses:
348 201:
349 description: The created Test Instance object is returned when it is created
350 content:
351 application/json:
352 schema:
353 $ref: '#/components/schemas/TestInstance'
354 /otf/api/testInstance/create/v1/processDefinitionKey/{processDefinitionKey}:
355 post:
356 tags:
357 - Test Instance Service
358 summary: Create a test instance using the latest version of the test definition
359 operationId: createByProcessDefKey_1
360 parameters:
361 - name: processDefinitionKey
362 in: path
363 description: The process definition key associated with the test definition
364 required: true
365 schema:
366 type: string
367 example: someUniqueProcessDefinitionKey
368 - name: Authorization
369 in: header
370 description: Base64 encoded Application Authorization Framework credentials
371 required: true
372 schema:
373 type: string
374 example: Basic b3RmQGF0dC5jb206cGFzc3dvcmQxMjM=
375 - name: execute
376 in: query
377 description: Execute the test instance after it is created
378 allowEmptyValue: true
379 schema:
380 type: boolean
381 example: true
382 requestBody:
383 content:
384 application/json:
385 schema:
386 $ref: '#/components/schemas/CreateTestInstanceRequest'
387 responses:
388 201:
389 description: The created Test Instance object is returned when it is created
390 content:
391 application/json:
392 schema:
393 $ref: '#/components/schemas/TestInstance'
394 /otf/api/testStrategy/delete/v1/deploymentId/{deploymentId}:
395 delete:
396 tags:
397 - Test Strategy Service
398 operationId: deleteByDeploymentId_1
399 parameters:
400 - name: deploymentId
401 in: path
402 required: true
403 schema:
404 type: string
405 - name: authorization
406 in: header
407 schema:
408 type: string
409 responses:
410 default:
411 description: default response
412 content:
413 application/json: {}
414 /otf/api/testStrategy/delete/v1/testDefinitionId/{testDefinitionId}:
415 delete:
416 tags:
417 - Test Strategy Service
418 operationId: deleteByTestDefinitionId_1
419 parameters:
420 - name: testDefinitionId
421 in: path
422 required: true
423 schema:
424 type: string
425 - name: authorization
426 in: header
427 schema:
428 type: string
429 responses:
430 default:
431 description: default response
432 content:
433 application/json: {}
434 /otf/api/testStrategy/deploy/v1:
435 post:
436 tags:
437 - Test Strategy Service
438 operationId: deployTestStrategy_1
439 parameters:
440 - name: Authorization
441 in: header
442 schema:
443 type: string
444 requestBody:
445 content:
446 multipart/form-data:
447 schema:
448 type: object
449 properties:
450 bpmn:
451 type: object
452 resources:
453 type: object
454 testDefinitionId:
455 type: string
456 testDefinitionDeployerId:
457 type: string
458 definitionId:
459 type: string
460 responses:
461 default:
462 description: default response
463 content:
464 application/json: {}
465components:
466 schemas:
467 ApiResponse:
468 type: object
469 properties:
470 code:
471 type: integer
472 format: int32
473 date:
474 type: string
475 format: date-time
476 message:
477 type: string
478 JSONObject:
479 type: object
480 ObjectId:
481 type: object
482 properties:
483 timestamp:
484 type: integer
485 format: int32
486 machineIdentifier:
487 type: integer
488 format: int32
489 processIdentifier:
490 type: integer
491 format: int32
492 counter:
493 type: integer
494 format: int32
495 time:
496 type: integer
497 format: int64
498 date:
499 type: string
500 format: date-time
501 timeSecond:
502 type: integer
503 format: int32
504 TestExecution:
505 type: object
506 properties:
507 get_id:
508 $ref: '#/components/schemas/ObjectId'
509 executionId:
510 type: string
511 testResult:
512 type: string
513 testDetails:
514 type: object
515 additionalProperties:
516 type: object
517 startTime:
518 type: string
519 format: date-time
520 endTime:
521 type: string
522 format: date-time
523 async:
524 type: boolean
525 asyncTopic:
526 type: string
527 asyncMode:
528 type: string
529 executor:
530 type: string
531 groupId:
532 $ref: '#/components/schemas/ObjectId'
533 testInstanceId:
534 $ref: '#/components/schemas/ObjectId'
535 testInstance:
536 type: object
537 additionalProperties:
538 type: object
539 testHeadResults:
540 type: array
541 items:
542 $ref: '#/components/schemas/TestHeadResult'
543 testDetailsJSON:
544 type: string
545 testInstanceJSON:
546 type: string
547 TestExecutionResult:
548 type: object
549 properties:
550 testExecution:
551 $ref: '#/components/schemas/TestExecution'
552 executionId:
553 type: string
554 testCompleted:
555 type: boolean
556 testExists:
557 type: boolean
558 TestHeadResult:
559 type: object
560 properties:
561 testHeadId:
562 $ref: '#/components/schemas/ObjectId'
563 testHeadName:
564 type: string
565 bpmnVthTaskId:
566 type: string
567 testHeadResponse:
568 type: object
569 additionalProperties:
570 type: object
571 startTime:
572 type: string
573 format: date-time
574 endTime:
575 type: string
576 format: date-time
577 testHeadResponseJSON:
578 $ref: '#/components/schemas/JSONObject'
579 ExecuteTestInstanceRequest:
580 type: object
581 properties:
582 async:
583 type: boolean
584 writeOnly: true
585 asyncTopic:
586 title: Execute the test synchronously or asynchronously..
587 type: string
588 description: Ignored unless async is true, and asyncMode is DMaaP.
589 example: MyDMaaPTopic.
590 asyncMode:
591 title: Set the asynchronous execution mode.
592 type: string
593 description: Ignored unless async is true. The poll mode will return an
594 executionId that can be used to query the result of the executed test.
595 DMaaP is currently unsupported.
596 example: POLL
597 enum:
598 - POLL
599 - DMAAP
600 testData:
601 title: Use an existing test instance with different global test data.
602 type: object
603 description: Overrides (not overwrites) the testData field for the requested
604 execution. The overridden data will be preserved in the test execution
605 result.
606 example:
607 globalVar1: I'm available to your workflow!
608 globalVar2:
609 me: too
610 vthInput:
611 title: Use an existing test instance with different inputs to your VTHs.
612 type: object
613 description: Overrides (not overwrites) the vthInput field for the requested
614 execution. The overridden data will be preserved in the test execution
615 result.
616 example:
617 ServiceTask_123:
618 vthArg1: An argument your VTH expects.
619 vthArg2: {}
620 ServiceTask_456:
621 vthArg1: An argument your VTH expects.
622 description: The model2 for a test instance execution request.
623 TestInstance:
624 type: object
625 properties:
626 get_id:
627 $ref: '#/components/schemas/ObjectId'
628 testInstanceName:
629 type: string
630 testInstanceDescription:
631 type: string
632 groupId:
633 $ref: '#/components/schemas/ObjectId'
634 testDefinitionId:
635 $ref: '#/components/schemas/ObjectId'
636 processDefinitionId:
637 type: string
638 useLatestTestDefinition:
639 type: boolean
640 testData:
641 type: object
642 additionalProperties:
643 type: object
644 vthInput:
645 type: object
646 additionalProperties:
647 type: object
648 internalTestData:
649 type: object
650 additionalProperties:
651 type: object
652 createdAt:
653 type: string
654 format: date-time
655 updatedAt:
656 type: string
657 format: date-time
658 createdBy:
659 $ref: '#/components/schemas/ObjectId'
660 updatedBy:
661 $ref: '#/components/schemas/ObjectId'
662 vthInputJSON:
663 $ref: '#/components/schemas/JSONObject'
664 testDataJSON:
665 $ref: '#/components/schemas/JSONObject'
666 internalTestDataJSON:
667 $ref: '#/components/schemas/JSONObject'
668 CreateTestInstanceRequest:
669 required:
670 - testData
671 - testInstanceDescription
672 - testInstanceName
673 type: object
674 properties:
675 testInstanceName:
676 title: Name the test instance
677 type: string
678 description: The name must be unique among all test instances belonging
679 to the same test definition.
680 example: MyTestInstance
681 testInstanceDescription:
682 title: Describe the test instance being created
683 type: string
684 description: Use this field to describe the functionality of the test instance
685 example: This test instance does absolutely nothing!
686 testData:
687 title: Set global variables
688 type: object
689 description: |-
690 This field has read and write access by any task within the workflow.
691 See the example for more information
692 example:
693 globalVar1: I'm available to your workflow!
694 globalVar2:
695 me: too
696 vthInput:
697 title: Set virtual test head data
698 type: object
699 description: |-
700 This field determines the data each VTH at the designated ServiceTask will receive.
701 See the example for more information
702 example:
703 ServiceTask_123:
704 vthArg1: An argument your VTH expects.
705 vthArg2: {}
706 ServiceTask_456:
707 vthArg1: An argument your VTH expects.
708 async:
709 type: boolean
710 asyncTopic:
711 type: string
712 asyncMode:
713 type: string
714 description: The model2 for a test instance creation request.