|
## API |
|
|
|
#### Request Validation of RO-Crate |
|
|
|
<details> |
|
<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> |
|
|
|
##### Path Parameters |
|
|
|
| name | type | data type | description | |
|
|------------|-----------|-------------------------|-----------------------------------------------------------------------| |
|
| crate_id | required | string | RO-Crate identifer string | |
|
|
|
##### Parameters |
|
|
|
| name | type | data type | description | |
|
|------------|-----------|-------------------------|-----------------------------------------------------------------------| |
|
| root_path | optional | string | Root path which contains the RO-Crate | |
|
| webhook_url | optional | string | Webhook to send validation result to | |
|
| profile_name | optional | string | RO-Crate profile to validate against | |
|
| minio_config | required | dictionary | MinIO Configuration Details | |
|
|
|
`minio_config` |
|
> | name | type | data type | description | |
|
> |------------|-----------|-------------------------|-----------------------------------------------------------------------| |
|
> | endpoint | required | string | MinIO endpoint | |
|
> | accesskey | required | string | MinIO access key or username | |
|
> | secret | required | string | MinIO secret or password | |
|
> | ssl | required | boolean | Use SSL encryption for MinIO access? | |
|
> | bucket | required | string | MinIO bucket containing RO-Crate | |
|
|
|
##### Responses |
|
|
|
| http code | content-type | response | |
|
|---------------|-----------------------------------|---------------------------------------------------------------------| |
|
| `202` | `application/json` | `{"message": "Validation in progress"}` | |
|
| `400` | `application/json` | `{"message": "No RO-Crate with prefix: <crate_id>"}` | |
|
| `500` | `application/json` | `{"message": "Internal server errors"}` | |
|
|
|
```javascript |
|
curl -X 'POST' \ |
|
'http://localhost:5001/v1/ro_crates/<crate_id>/validation' \ |
|
-H 'accept: application/json' \ |
|
-H 'Content-Type: application/json' \ |
|
-d '{ |
|
"minio_config": { |
|
"accesskey": "<key>", |
|
"bucket": "ro-crates", |
|
"endpoint": "minio:9000", |
|
"secret": "<secret>", |
|
"ssl": false |
|
}, |
|
"profile_name": "<profile>", |
|
"webhook_url": "<webhook>" |
|
}' |
|
``` |
|
|
|
</details> |
|
|
|
|
|
#### Get RO-Crate Validation Result |
|
|
|
<details> |
|
<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> |
|
|
|
##### Path Parameters |
|
|
|
| name | type | data type | description | |
|
|------------|-----------|-------------------------|-----------------------------------------------------------------------| |
|
| crate_id | required | string | RO-Crate identifer string | |
|
|
|
##### Parameters |
|
|
|
| name | type | data type | description | |
|
|------------|-----------|-------------------------|-----------------------------------------------------------------------| |
|
| root_path | optional | string | Root path which contains the RO-Crate | |
|
| minio_config | required | dictionary | MinIO Configuration Details | |
|
|
|
`minio_config` |
|
> | name | type | data type | description | |
|
> |------------|-----------|-------------------------|-----------------------------------------------------------------------| |
|
> | endpoint | required | string | MinIO endpoint | |
|
> | accesskey | required | string | MinIO access key or username | |
|
> | secret | required | string | MinIO secret or password | |
|
> | ssl | required | boolean | Use SSL encryption for MinIO access? | |
|
> | bucket | required | string | MinIO bucket containing RO-Crate | |
|
|
|
##### Responses |
|
|
|
| http code | content-type | response | |
|
|---------------|-----------------------------------|---------------------------------------------------------------------| |
|
| `200` | `application/json` | `Successful Validation` | |
|
| `422` | `application/json` | `Error: Details of Validation Error` | |
|
| `404` | `application/json` | `Not found` | |
|
|
|
##### Example cURL |
|
|
|
```javascript |
|
curl -X 'GET' \ |
|
'http://localhost:5001/v1/ro_crates/<crate_id>/validation' \ |
|
-H 'accept: application/json' \ |
|
-H 'Content-Type: application/json' \ |
|
-d '{ |
|
"minio_config": { |
|
"accesskey": "<key>", |
|
"bucket": "ro-crates", |
|
"endpoint": "minio:9000", |
|
"secret": "<secret>", |
|
"ssl": false |
|
} |
|
}' |
|
``` |
|
|
|
</details> |
The docker-compose service for the
flaskapp has severalMINIO_*configuration variables, including credentials:RO-Crate-Validation-Service/docker-compose.yml
Lines 14 to 17 in 422a4f7
However the documented API calls that connect to the object store require passing the minio config as a parameter
RO-Crate-Validation-Service/README.md
Lines 5 to 118 in 422a4f7
What are the Flask
MINIO_*environment variables used for?