Newer
Older
#
# This file is part of PKM (Persistent Knowledge Monitor).
# Copyright (c) 2020 Capgemini Group, Commissariat A l'Énergie Atomique et aux énergies alternatives,
# OW2, Sysgo AG, Technikon, Tree Technology, Universitat Politècnica de València.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
openapi: 3.0.0
info:
title: FramaCRestfulApiForPkm
version: 1.0.0
contact:
name: DECODER project
url: https://www.decoder-project.eu
email: decoder@decoder-project.eu
license:
Gilles Mouchard
committed
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: http://pkm-api_frama-c_1:8081
paths:
/frama_c/{dbName}:
post:
Gilles Mouchard
committed
tags:
- FramaC
operationId: frama_c
parameters:
- name: dbName
description: Database name from where to get source code/header files and put analysis results
in: path
required: true
schema:
type: string
- name: asynchronous
description: flag to control asynchronous/synchronous execution of Frama-C job
in: query
schema:
type: boolean
default: false
Gilles Mouchard
committed
- $ref: '#/components/parameters/InvocationIdParam'
- $ref: '#/components/parameters/keyParam'
content:
application/json:
schema:
type : object
properties:
source_file_paths:
description: Source Code filenames to process
type: array
items:
type: string
mode:
description: mode
type: object
properties:
parser:
description: enable/disable parser (implicitely enabled when neither EVA nor WP are enabled)
type: boolean
eva:
description: enable/disable EVA
type: boolean
wp:
description: enable/disable WP
type: boolean
options:
description: options
type: object
properties:
Gilles Mouchard
committed
args:
description: Frama-C command line options
type: array
items:
type: string
eva:
description: EVA options
type: object
properties:
main:
description: main function for EVA
type: string
wp:
description: WP options
type: object
properties:
wp_fct:
description: functions for WP
type: array
items:
description: function name
type: string
x-codegen-request-body-name: body
responses:
201:
description: Created, returns a job
headers:
Access-Control-Allow-Origin:
$ref: '#/components/headers/Access-Control-Allow-Origin'
Gilles Mouchard
committed
Access-Control-Allow-Methods:
$ref: '#/components/headers/Access-Control-Allow-Methods'
Access-Control-Allow-Headers:
$ref: '#/components/headers/Access-Control-Allow-Headers'
content:
application/json:
schema:
400:
description: Bad request
headers:
Access-Control-Allow-Origin:
$ref: '#/components/headers/Access-Control-Allow-Origin'
Gilles Mouchard
committed
Access-Control-Allow-Methods:
$ref: '#/components/headers/Access-Control-Allow-Methods'
Access-Control-Allow-Headers:
$ref: '#/components/headers/Access-Control-Allow-Headers'
content:
application/json:
schema:
type: string
description: error message
401:
description: Unauthorized operation, returns an error message
headers:
Access-Control-Allow-Origin:
$ref: '#/components/headers/Access-Control-Allow-Origin'
Gilles Mouchard
committed
Access-Control-Allow-Methods:
$ref: '#/components/headers/Access-Control-Allow-Methods'
Access-Control-Allow-Headers:
$ref: '#/components/headers/Access-Control-Allow-Headers'
content:
application/json:
schema:
type: string
description: error message
403:
description: Forbidden operation, returns an error message
headers:
Access-Control-Allow-Origin:
$ref: '#/components/headers/Access-Control-Allow-Origin'
Gilles Mouchard
committed
Access-Control-Allow-Methods:
$ref: '#/components/headers/Access-Control-Allow-Methods'
Access-Control-Allow-Headers:
$ref: '#/components/headers/Access-Control-Allow-Headers'
content:
application/json:
schema:
type: string
description: error message
404:
description: Not found, returns an error message
headers:
Access-Control-Allow-Origin:
$ref: '#/components/headers/Access-Control-Allow-Origin'
Gilles Mouchard
committed
Access-Control-Allow-Methods:
$ref: '#/components/headers/Access-Control-Allow-Methods'
Access-Control-Allow-Headers:
$ref: '#/components/headers/Access-Control-Allow-Headers'
content:
application/json:
schema:
type: string
description: error message
500:
description: Internal Server Error, returns an error message
headers:
Access-Control-Allow-Origin:
$ref: '#/components/headers/Access-Control-Allow-Origin'
Gilles Mouchard
committed
Access-Control-Allow-Methods:
$ref: '#/components/headers/Access-Control-Allow-Methods'
Access-Control-Allow-Headers:
$ref: '#/components/headers/Access-Control-Allow-Headers'
content:
application/json:
schema:
type: string
description: error message
Gilles Mouchard
committed
/frama_c/jobs/{jobId}:
get:
Gilles Mouchard
committed
tags:
- FramaC
Gilles Mouchard
committed
operationId: getJob
description: Get Frama-C Job. Getting a finished or failed job, unpublish it (it is no longer available)
Gilles Mouchard
committed
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
parameters:
- name: jobId
description: Job identifier
in: path
required: true
schema:
type: integer
minimum: 0
- $ref: '#/components/parameters/keyParam'
responses:
200:
description: Successful operation, returns a job
headers:
Access-Control-Allow-Origin:
$ref: '#/components/headers/Access-Control-Allow-Origin'
Access-Control-Allow-Methods:
$ref: '#/components/headers/Access-Control-Allow-Methods'
Access-Control-Allow-Headers:
$ref: '#/components/headers/Access-Control-Allow-Headers'
content:
application/json:
schema:
$ref: '#/components/schemas/Job'
400:
description: Bad request
headers:
Access-Control-Allow-Origin:
$ref: '#/components/headers/Access-Control-Allow-Origin'
Access-Control-Allow-Methods:
$ref: '#/components/headers/Access-Control-Allow-Methods'
Access-Control-Allow-Headers:
$ref: '#/components/headers/Access-Control-Allow-Headers'
content:
application/json:
schema:
type: string
description: error message
401:
description: Unauthorized operation, returns an error message
headers:
Access-Control-Allow-Origin:
$ref: '#/components/headers/Access-Control-Allow-Origin'
Access-Control-Allow-Methods:
$ref: '#/components/headers/Access-Control-Allow-Methods'
Access-Control-Allow-Headers:
$ref: '#/components/headers/Access-Control-Allow-Headers'
content:
application/json:
schema:
type: string
description: error message
403:
description: Forbidden operation, returns an error message
headers:
Access-Control-Allow-Origin:
$ref: '#/components/headers/Access-Control-Allow-Origin'
Access-Control-Allow-Methods:
$ref: '#/components/headers/Access-Control-Allow-Methods'
Access-Control-Allow-Headers:
$ref: '#/components/headers/Access-Control-Allow-Headers'
content:
application/json:
schema:
type: string
description: error message
404:
description: Not found, returns an error message
headers:
Access-Control-Allow-Origin:
$ref: '#/components/headers/Access-Control-Allow-Origin'
Access-Control-Allow-Methods:
$ref: '#/components/headers/Access-Control-Allow-Methods'
Access-Control-Allow-Headers:
$ref: '#/components/headers/Access-Control-Allow-Headers'
content:
application/json:
schema:
type: string
description: error message
500:
description: Internal Server Error, returns an error message
headers:
Access-Control-Allow-Origin:
$ref: '#/components/headers/Access-Control-Allow-Origin'
Access-Control-Allow-Methods:
$ref: '#/components/headers/Access-Control-Allow-Methods'
Access-Control-Allow-Headers:
$ref: '#/components/headers/Access-Control-Allow-Headers'
content:
application/json:
schema:
type: string
description: error message
components:
parameters:
keyParam:
name: key
Gilles Mouchard
committed
description: Access key to the PKM
Gilles Mouchard
committed
InvocationIdParam:
name: invocationID
description: invocation identifier (optional)
in: query
schema:
type: string
Gilles Mouchard
committed
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
schemas:
Job:
type: object
description: a job
properties:
id:
description: job identifier
type: integer
minimum: 0
service_name:
description: name of the service running the job
type: string
parameters:
description: parameters of the job
type: object
properties:
dbName:
description: database name
type: string
state:
description: job state
enum: [pending, running, failed, finished]
start_date:
description: date (GMT) when job started
type: string
end_date:
description: date (GMT) when job ended
type: string
logs:
description: log messages
type: string
warnings:
type: string
description: warning messages
err:
description: error
type: object
Gilles Mouchard
committed
# for CORS (Cross-Origin Resource Sharing)
Access-Control-Allow-Origin:
schema:
type: string
default: '*'
Gilles Mouchard
committed
Access-Control-Allow-Methods:
schema:
type: string
default: 'GET, POST, PUT, DELETE, OPTIONS'
Access-Control-Allow-Headers:
schema:
type: string
default: 'Origin, Content-Type, Accept, key'