Skip to content

Commit 83f8c92

Browse files
Lilykospamfilos
authored andcommitted
workflows: adding reana API docs
Signed-off-by: Ilias Koutsakis <[email protected]>
1 parent 730fac1 commit 83f8c92

22 files changed

+910
-23
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
in: query
2+
name: file_path
3+
schema:
4+
type: string
5+
description: The full path (on the server) of the file
6+
required: true

spec/components/parameters/pid.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
in: path
2+
name: pid
3+
schema:
4+
type: string
5+
description: Existing record id (from deposit)
6+
required: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
in: path
2+
name: workflow_id
3+
schema:
4+
type: string
5+
format: uuid
6+
description: Existing workflow id (in UUID form)
7+
required: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
description: API Exception error message
2+
type: object
3+
properties:
4+
message:
5+
type: string

spec/openapi.yaml

+16-11
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,28 @@ info:
1414
https://github.com/cernanalysispreservation/cap-api-docs/raw/master/web/CAP_API_docs.png
1515
description: >
1616
CERN Analysis Preservation offers a REST API to access the service
17-
independently from the web interface. If you want to automate specific tasks
18-
or create your own data interface, you can use the API to do so
17+
independently from the web interface. This allows users to automate specific
18+
tasks or create their own data interface, using simple HTTP calls.
1919
2020
2121
# Introduction
2222
23-
The CAP API is built on HTTP. Our API is RESTful. It has predictable
24-
resource URLs. It returns HTTP response codes to indicate errors. It also
25-
accepts and returns JSON in the HTTP body. You can use your favorite
26-
HTTP/REST library for your programming language to use CAP's API, or you can
27-
use one of our SDKs (CLI clients) (currently available in Python).
23+
CERN Analysis Preservation provides a RESTful API, built on HTTP. It tries
24+
to provide a predictable interface, that includes:
2825
26+
* resource URLs,
2927
30-
We have other APIs that are also available. Every action from our app is
31-
supported by an API which is documented and available for use so that you
32-
may automate any workflows necessary. This document contains the most
33-
commonly integrated resources.
28+
* HTTP response codes to indicate success/errors, and
29+
30+
* accepts and returns JSON in the HTTP body.
31+
32+
33+
You can use your favorite HTTP/REST library for your programming language to
34+
use CAP's API, or you can use one of our SDKs (CLI clients), currently
35+
available in Python. Every action from our app is implemented using REST
36+
endpoints, all of which are documented and available, in order to bea easily
37+
accessible for automations and integrations into specific workflowsor
38+
data-related apps.
3439
3540
3641
# Authentication

spec/paths/ping.yaml

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
get:
22
tags:
33
- Health Check
4-
summary: Ping
5-
description: Check server availability
4+
summary: Ping Server
5+
description: Check CAP server availability.
66
operationId: ping
77
responses:
88
'200':
@@ -13,9 +13,18 @@ get:
1313
X-Expires-After:
1414
$ref: '#/components/headers/ExpiresAfter'
1515
content:
16-
text/csv:
17-
schema:
18-
type: string
16+
application/json:
1917
examples:
2018
response:
2119
value: Pong!
20+
'400':
21+
description: Exception
22+
headers:
23+
X-Rate-Limit:
24+
$ref: '#/components/headers/RateLimit'
25+
X-Expires-After:
26+
$ref: '#/components/headers/ExpiresAfter'
27+
content:
28+
application/json:
29+
schema:
30+
$ref: '#/components/schemas/error_message'

spec/paths/[email protected]

+14-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ get:
22
tags:
33
- Health Check
44
summary: Ping DB
5-
description: Check database availability
5+
description: Check CAP database availability.
66
operationId: pingdb
77
responses:
88
'200':
@@ -18,4 +18,16 @@ get:
1818
type: string
1919
examples:
2020
response:
21-
value: {'message': 'OK'}
21+
value:
22+
message: OK
23+
'400':
24+
description: Exception
25+
headers:
26+
X-Rate-Limit:
27+
$ref: '#/components/headers/RateLimit'
28+
X-Expires-After:
29+
$ref: '#/components/headers/ExpiresAfter'
30+
content:
31+
application/json:
32+
schema:
33+
$ref: '#/components/schemas/error_message'

spec/paths/[email protected]

+14-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ get:
22
tags:
33
- Health Check
44
summary: Ping Files
5-
description: Check Files API availability
5+
description: Check CAP Files API availability.
66
operationId: ping_files
77
responses:
88
'200':
@@ -18,4 +18,16 @@ get:
1818
type: string
1919
examples:
2020
response:
21-
value: {'message': 'OK'}
21+
value:
22+
message: OK
23+
'400':
24+
description: Exception
25+
headers:
26+
X-Rate-Limit:
27+
$ref: '#/components/headers/RateLimit'
28+
X-Expires-After:
29+
$ref: '#/components/headers/ExpiresAfter'
30+
content:
31+
application/json:
32+
schema:
33+
$ref: '#/components/schemas/error_message'

spec/paths/[email protected]

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
get:
22
tags:
33
- Health Check
4-
summary: Ping DB
5-
description: Check Search API availability
4+
summary: Ping Elasticsearch
5+
description: Check CAP Elasticsearch API availability.
66
operationId: ping_search
77
responses:
88
'200':
@@ -21,4 +21,16 @@ get:
2121
type: string
2222
examples:
2323
response:
24-
value: {'message': 'OK'}
24+
value:
25+
message: OK
26+
'400':
27+
description: Exception
28+
headers:
29+
X-Rate-Limit:
30+
$ref: '#/components/headers/RateLimit'
31+
X-Expires-After:
32+
$ref: '#/components/headers/ExpiresAfter'
33+
content:
34+
application/json:
35+
schema:
36+
$ref: '#/components/schemas/error_message'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
parameters:
2+
- $ref: '#/components/parameters/pid'
3+
get:
4+
tags:
5+
- Workflows
6+
summary: Get all the workflows
7+
description: Get all the workflows (created and deleted) from the user
8+
operationId: reana_workflow_all
9+
responses:
10+
'200':
11+
description: OK
12+
headers:
13+
X-Rate-Limit:
14+
$ref: '#/components/headers/RateLimit'
15+
X-Expires-After:
16+
$ref: '#/components/headers/ExpiresAfter'
17+
content:
18+
application/json:
19+
schema:
20+
type: object
21+
properties:
22+
rec_uuid:
23+
type: string
24+
current_workflows:
25+
type: array
26+
items:
27+
type: object
28+
properties:
29+
id:
30+
type: string
31+
name:
32+
type: string
33+
status:
34+
type: string
35+
deleted_workflows:
36+
type: array
37+
items:
38+
type: object
39+
properties:
40+
id:
41+
type: string
42+
name:
43+
type: string
44+
status:
45+
type: string
46+
examples:
47+
response:
48+
value:
49+
current_workflows:
50+
- id: 124f4f68-9f0c-4941-97df-2f23e3f68221
51+
name: cap_demo.3
52+
status: created
53+
- id: bbf6e63e-ba8b-4c7b-b92c-eed3d46c4616
54+
name: cap_demo.2
55+
status: created
56+
deleted_workflows:
57+
- id: a5140d92-65e3-4fb0-a246-dc1f06cc2e13
58+
name: cap_demo.1
59+
status: deleted
60+
rec_uuid: 18a6ae5c-3000-44cc-a5bb-7a386a47ab59
61+
'400':
62+
description: Exception
63+
headers:
64+
X-Rate-Limit:
65+
$ref: '#/components/headers/RateLimit'
66+
X-Expires-After:
67+
$ref: '#/components/headers/ExpiresAfter'
+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
post:
2+
tags:
3+
- Workflows
4+
summary: Create a REANA workflow
5+
description: Create a REANA workflow using the provided parameters.
6+
operationId: reana_create_workflow
7+
requestBody:
8+
content:
9+
application/json:
10+
schema:
11+
type: object
12+
properties:
13+
pid:
14+
type: string
15+
pid_type:
16+
type: string
17+
workflow_name:
18+
type: string
19+
workflow_engine:
20+
type: string
21+
workflow_json:
22+
type: object
23+
parameters:
24+
type: object
25+
outputs:
26+
type: object
27+
example:
28+
pid: a5140d92-65e3-4fb0-a246-dc1f06cc2e13
29+
pid_type: recid
30+
workflow_name: demo
31+
workflow_engine: serial
32+
workflow_json:
33+
steps:
34+
- environment: 'python:2.7-slim'
35+
commands:
36+
- 'python "${helloworld}"'
37+
parameters:
38+
files:
39+
- code/helloworld.py
40+
parameters:
41+
helloworld: code/helloworld.py
42+
outputs:
43+
files:
44+
- results/results.txt
45+
responses:
46+
'200':
47+
description: OK
48+
headers:
49+
X-Rate-Limit:
50+
$ref: '#/components/headers/RateLimit'
51+
X-Expires-After:
52+
$ref: '#/components/headers/ExpiresAfter'
53+
content:
54+
application/json:
55+
schema:
56+
type: object
57+
properties:
58+
depid:
59+
type: string
60+
engine:
61+
type: string
62+
status:
63+
type: string
64+
workflow_id:
65+
type: string
66+
workflow_name:
67+
type: string
68+
examples:
69+
response:
70+
value:
71+
depid: 28484a36-679e-4274-ba15-9f17abe8e075
72+
engine: serial
73+
status: created
74+
workflow_id: 3ffea660-db89-4a30-9454-44aa9cf1d677
75+
workflow_name: wf_demo.1
76+
'400':
77+
description: Exception
78+
headers:
79+
X-Rate-Limit:
80+
$ref: '#/components/headers/RateLimit'
81+
X-Expires-After:
82+
$ref: '#/components/headers/ExpiresAfter'
83+
content:
84+
application/json:
85+
schema:
86+
$ref: '#/components/schemas/error_message'
87+
examples:
88+
response:
89+
value:
90+
message: An exception has occured while creating the workflow.
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
get:
2+
tags:
3+
- Workflows
4+
summary: Ping the REANA server
5+
description: Check the REANA server availability.
6+
operationId: reana_ping
7+
responses:
8+
'200':
9+
description: OK
10+
headers:
11+
X-Rate-Limit:
12+
$ref: '#/components/headers/RateLimit'
13+
X-Expires-After:
14+
$ref: '#/components/headers/ExpiresAfter'
15+
content:
16+
text/plain:
17+
schema:
18+
type: string
19+
example: OK
20+
'400':
21+
description: Exception
22+
headers:
23+
X-Rate-Limit:
24+
$ref: '#/components/headers/RateLimit'
25+
X-Expires-After:
26+
$ref: '#/components/headers/ExpiresAfter'
27+
content:
28+
application/json:
29+
schema:
30+
type: object
31+
properties:
32+
message:
33+
type: string
34+
examples:
35+
response:
36+
value:
37+
message: An exception has occured on the server.

0 commit comments

Comments
 (0)