blob: 44aed5551482969ee8c3c2ab0b90e3485abf72e5 [file] [log] [blame]
openapi: 3.0.0
info:
version: 1.0.0
title: APP4MC Validation API
description: APP4MC Validation API to validate an Amalthea model file
servers:
- url: http://localhost:8080/app4mc/validation
- url: https://app4mc.eclipseprojects.io/app4mc/validation
paths:
/:
post:
summary: Upload the file to validate and start the validation process asynchronously
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
file:
type: string
format: binary
profiles:
type: string
description: The validation profiles to execute. Parameter is optional and defaults to the Amalthea Standard Validations profile.
responses:
'201':
description: Upload succeeded and validation process started
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: ID of the created validation resource
headers:
Location:
schema:
type: string
format: uri
description: The URI to the status URL
links:
status:
operationId: getStatus
parameters:
statusId: '$response.body#/id'
description: >
The `id` value returned in the response can be used as
the `statusId` parameter in `GET /{statusId}`.
'400':
description: No model file provided as upload
'404':
description: Upload failed
/{statusId}:
get:
summary: Get the status of the triggered validation process
operationId: getStatus
parameters:
- in: path
name: statusId
required: true
schema:
type: string
responses:
'200':
description: Processing finished successfully
headers:
Cache-Control:
schema:
type: string
enum:
- private, no-store, no-cache, must-revalidate
links:
result:
operationId: getDownload
parameters:
statusId: $request.path.statusId
'202':
description: Validation process in progress
headers:
Cache-Control:
schema:
type: string
enum:
- private, no-store, no-cache, must-revalidate
'204':
description: Processing finished with an error
headers:
Cache-Control:
schema:
type: string
enum:
- private, no-store, no-cache, must-revalidate
links:
result:
operationId: getError
parameters:
statusId: $request.path.statusId
'404':
description: Resource not available
delete:
summary: Delete the uploaded and result resource from the server
operationId: deleteResource
parameters:
- in: path
name: statusId
required: true
schema:
type: string
responses:
'200':
description: Resource deleted successfully
'404':
description: Resource not available
/{statusId}/download:
get:
summary: Download the validation result file
operationId: getDownload
parameters:
- in: path
name: statusId
required: true
schema:
type: string
responses:
'200':
description: Validation successful
content:
application/octet-stream:
schema:
type: string
format: binary
headers:
# custom header to configure that the result should not be used as input to the next process in the workflow
x-app4mc-use-result:
schema:
type: string
enum:
- false
links:
delete:
operationId: deleteResource
parameters:
statusId: $request.path.statusId
'400':
description: Validation finished with validation failures
content:
application/octet-stream:
schema:
type: string
format: binary
headers:
# custom header to configure that the result should not be used as input to the next process in the workflow
x-app4mc-use-result:
schema:
type: string
enum:
- false
links:
delete:
operationId: deleteResource
parameters:
statusId: $request.path.statusId
'404':
description: Progress still running / Resource not available / No result available
content:
application/json:
schema:
type: string
/{statusId}/error:
get:
summary: Download the error file of the validation process
operationId: getError
parameters:
- in: path
name: statusId
required: true
schema:
type: string
responses:
'200':
description: Error occured
content:
application/octet-stream:
schema:
type: string
format: binary
links:
delete:
operationId: deleteResource
parameters:
statusId: $request.path.statusId
'404':
description: Resource not available / No error occured
content:
application/json:
schema:
type: string
/config:
get:
summary: Get the configuration definition of the service
responses:
'200':
description: The configuration definition of the service
content:
application/json:
schema:
type: string