Skip to content

Commit b1f4fb3

Browse files
committed
post and get api
1 parent be6c1d4 commit b1f4fb3

1 file changed

Lines changed: 106 additions & 0 deletions

File tree

README.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,114 @@ This project presents a Flask-based API for validating RO-Crates.
66

77
#### Request Validation of RO-Crate
88

9+
<details>
10+
<summary><code>POST</code> <code><b>v1/ro_crates/{crate_id}/validation</b></code> <code>(Request validation of RO-Crate validation in Object Store)</code></summary>
11+
12+
##### Path Parameters
13+
14+
> | name | type | data type | description |
15+
> |------------|-----------|-------------------------|-----------------------------------------------------------------------|
16+
> | crate_id | required | string | RO-Crate identifer string |
17+
18+
##### Parameters
19+
20+
> | name | type | data type | description |
21+
> |------------|-----------|-------------------------|-----------------------------------------------------------------------|
22+
> | root_path | optional | string | Root path which contains the RO-Crate |
23+
> | webhook_url | optional | string | Webhook to send validation result to |
24+
> | minio_config | required | dictionary | MinIO Configuration Details |
25+
26+
`minio_config`
27+
> | name | type | data type | description |
28+
> |------------|-----------|-------------------------|-----------------------------------------------------------------------|
29+
> | endpoint | required | string | MinIO endpoint |
30+
> | accesskey | required | string | MinIO access key or username |
31+
> | secret | required | string | MinIO secret or password |
32+
> | ssl | required | boolean | Use SSL encryption for MinIO access? |
33+
> | bucket | required | string | MinIO bucket containing RO-Crate |
34+
35+
##### Responses
36+
37+
> | http code | content-type | response |
38+
> |---------------|-----------------------------------|---------------------------------------------------------------------|
39+
> | `202` | `application/json` | `{"message": "Validation in progress"}` |
40+
> | `400` | `application/json` | `{"message": "No RO-Crate with prefix: <crate_id>"}` |
41+
> | `500` | `application/json` | `{"message": "Internal server errors"}` |
42+
43+
> ```javascript
44+
> curl -X 'POST' \
45+
> 'http://localhost:5001/v1/ro_crates/<crate_id>/validation' \
46+
> -H 'accept: application/json' \
47+
> -H 'Content-Type: application/json' \
48+
> -d '{
49+
> "minio_config": {
50+
> "accesskey": "<key>",
51+
> "bucket": "ro-crates",
52+
> "endpoint": "minio:9000",
53+
> "secret": "<secret>",
54+
> "ssl": false
55+
> },
56+
> "profile_name": "<profile>",
57+
> "webhook_url": "<webhook>"
58+
> }'
59+
> ```
60+
61+
962
#### Get RO-Crate Validation Result
1063
64+
<details>
65+
<summary><code>GET</code> <code><b>v1/ro_crates/{crate_id}/validation</b></code> <code>(Obtain RO-Crate validation result from Object Store)</code></summary>
66+
67+
##### Path Parameters
68+
69+
> | name | type | data type | description |
70+
> |------------|-----------|-------------------------|-----------------------------------------------------------------------|
71+
> | crate_id | required | string | RO-Crate identifer string |
72+
73+
##### Parameters
74+
75+
> | name | type | data type | description |
76+
> |------------|-----------|-------------------------|-----------------------------------------------------------------------|
77+
> | root_path | optional | string | Root path which contains the RO-Crate |
78+
> | minio_config | required | dictionary | MinIO Configuration Details |
79+
80+
`minio_config`
81+
> | name | type | data type | description |
82+
> |------------|-----------|-------------------------|-----------------------------------------------------------------------|
83+
> | endpoint | required | string | MinIO endpoint |
84+
> | accesskey | required | string | MinIO access key or username |
85+
> | secret | required | string | MinIO secret or password |
86+
> | ssl | required | boolean | Use SSL encryption for MinIO access? |
87+
> | bucket | required | string | MinIO bucket containing RO-Crate |
88+
89+
##### Responses
90+
91+
> | http code | content-type | response |
92+
> |---------------|-----------------------------------|---------------------------------------------------------------------|
93+
> | `200` | `application/json` | `Successful Validation` |
94+
> | `422` | `application/json` | `Error: Details of Validation Error` |
95+
> | `404` | `application/json` | `Not found` |
96+
97+
##### Example cURL
98+
99+
> ```javascript
100+
> curl -X 'GET' \
101+
> 'http://localhost:5001/v1/ro_crates/<crate_id>/validation' \
102+
> -H 'accept: application/json' \
103+
> -H 'Content-Type: application/json' \
104+
> -d '{
105+
> "minio_config": {
106+
> "accesskey": "<key>",
107+
> "bucket": "ro-crates",
108+
> "endpoint": "minio:9000",
109+
> "secret": "<secret>",
110+
> "ssl": false
111+
> }
112+
> }'
113+
> ```
114+
115+
</details>
116+
11117
#### Validate RO-Crate Metadata
12118
13119
<details>

0 commit comments

Comments
 (0)