2021-11-18 19:27:39 +01:00
|
|
|
openapi: 3.0.0
|
|
|
|
|
|
|
|
info:
|
2021-11-22 19:07:46 +01:00
|
|
|
title: Generic Database API Service
|
2021-11-26 16:51:09 +01:00
|
|
|
version: "2.0.0"
|
2021-11-18 19:27:39 +01:00
|
|
|
|
|
|
|
paths:
|
|
|
|
/pdb/v2/test1:
|
2021-11-19 12:39:46 +01:00
|
|
|
# post:
|
|
|
|
# tags: [ "Regular" ]
|
|
|
|
# operationId: Regular.test1insert
|
|
|
|
# summary: Inserts an item into table test1
|
|
|
|
# requestBody:
|
|
|
|
# description: test1
|
|
|
|
# content:
|
|
|
|
# application/json:
|
|
|
|
# schema:
|
|
|
|
# $ref: "#/components/schemas/test1"
|
|
|
|
# responses:
|
|
|
|
# 201:
|
|
|
|
# description: Your items has been inserted
|
2021-11-30 15:02:52 +01:00
|
|
|
/pdb/v2/productionOrder/{productionOrderNumber}:
|
|
|
|
get:
|
|
|
|
tags: [ "Regular" ]
|
|
|
|
operationId: Regular.productionOrder
|
|
|
|
summary: Returns productionOrder entries
|
|
|
|
description:
|
|
|
|
STATEMENTBEGIN
|
|
|
|
SELECT produktionsauftrag AS productionOrderNumber,
|
2021-12-02 14:28:53 +01:00
|
|
|
C_Nummer AS cgNumber,
|
2021-11-30 15:02:52 +01:00
|
|
|
artikelcode AS articleCode,
|
|
|
|
stueckzahl AS numOfParts,
|
|
|
|
IX AS ix,
|
|
|
|
referenz_dokument AS referenceDocument
|
2021-11-30 18:15:09 +01:00
|
|
|
FROM auftraege
|
2021-11-30 15:02:52 +01:00
|
|
|
WHERE produktionsauftrag = @productionOrderNumber
|
|
|
|
STATEMENTEND
|
|
|
|
parameters:
|
|
|
|
- name: productionOrderNumber
|
|
|
|
in: path
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
type: string
|
2021-11-30 19:09:22 +01:00
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
description: Here are your productionOrder items
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
2021-11-30 19:16:32 +01:00
|
|
|
$ref: "#/components/schemas/productionOrder"
|
2021-12-02 09:26:27 +01:00
|
|
|
400:
|
2021-12-02 12:32:33 +01:00
|
|
|
$ref: "#/components/responses/clientSideError"
|
2021-12-02 11:59:10 +01:00
|
|
|
500:
|
2021-12-02 12:32:33 +01:00
|
|
|
$ref: "#/components/responses/serverSideError"
|
2021-11-30 19:09:22 +01:00
|
|
|
/pdb/v2/baseData/{articleNumber}:
|
|
|
|
get:
|
|
|
|
tags: [ "Regular" ]
|
|
|
|
operationId: Regular.baseData
|
|
|
|
summary: Returns baseData entries
|
|
|
|
description:
|
|
|
|
STATEMENTBEGIN
|
2021-11-30 19:24:06 +01:00
|
|
|
SELECT Artikelcode AS articleNumber,
|
|
|
|
Art AS category,
|
|
|
|
bezeichnung AS description
|
2021-11-30 19:09:22 +01:00
|
|
|
FROM stammdaten
|
|
|
|
WHERE Artikelcode = @articleNumber
|
|
|
|
STATEMENTEND
|
|
|
|
parameters:
|
|
|
|
- name: articleNumber
|
|
|
|
in: path
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
type: string
|
2021-11-30 15:02:52 +01:00
|
|
|
responses:
|
|
|
|
200:
|
2021-11-30 19:24:06 +01:00
|
|
|
description: Here are your baseData items
|
2021-11-30 15:02:52 +01:00
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: array
|
|
|
|
items:
|
2021-11-30 19:24:06 +01:00
|
|
|
$ref: "#/components/schemas/baseData"
|
2021-12-02 14:28:53 +01:00
|
|
|
400:
|
|
|
|
$ref: "#/components/responses/clientSideError"
|
|
|
|
500:
|
|
|
|
$ref: "#/components/responses/serverSideError"
|
|
|
|
/pdb/v2/productionItem/{serialNumber}:
|
|
|
|
get:
|
|
|
|
tags: [ "Regular" ]
|
|
|
|
operationId: Regular.productionItem
|
|
|
|
summary: Returns productionItem entries
|
|
|
|
description:
|
|
|
|
STATEMENTBEGIN
|
|
|
|
SELECT seriennummer AS serialNumber,
|
|
|
|
produktionsauftrag AS productionOrder,
|
|
|
|
ERev_geplant AS eRevPlanned,
|
|
|
|
ERev_gefertigt AS eRevDone,
|
|
|
|
ergebnis_erstinbetriebnahme AS resultFirstStartup,
|
|
|
|
kalibrierung_ergebnis AS resultCalibration,
|
|
|
|
ausliefer_datum AS deliveryDate,
|
|
|
|
sn_lp1 AS snlp1,
|
|
|
|
sn_lp2 AS snlp2,
|
|
|
|
sn_lp3 AS snlp3,
|
|
|
|
sn_lp4 AS snlp4,
|
|
|
|
sn_lp5 AS snlp5,
|
|
|
|
sn_lp6 AS snlp6,
|
|
|
|
sn_lp7 AS snlp7,
|
|
|
|
sn_lp8 AS snlp8,
|
|
|
|
sn_lp9 AS snlp9,
|
|
|
|
sn_lp10 AS snlp10
|
|
|
|
FROM geraete_daten
|
|
|
|
WHERE seriennummer = @serialNumber
|
|
|
|
STATEMENTEND
|
|
|
|
parameters:
|
|
|
|
- name: serialNumber
|
|
|
|
in: path
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
description: Here are your productionItem items
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
$ref: "#/components/schemas/productionItem"
|
|
|
|
400:
|
|
|
|
$ref: "#/components/responses/clientSideError"
|
|
|
|
500:
|
|
|
|
$ref: "#/components/responses/serverSideError"
|
|
|
|
/pdb/v2/productionItemReference/{serialNumber}:
|
|
|
|
get:
|
|
|
|
tags: [ "Regular" ]
|
|
|
|
operationId: Regular.productionItemReference
|
|
|
|
summary: Returns productionOrderItem entries
|
|
|
|
description:
|
|
|
|
STATEMENTBEGIN
|
|
|
|
SELECT produktionsauftrag AS productionOrder,
|
|
|
|
seriennummer AS serialNumber,
|
|
|
|
n AS batchIndex
|
|
|
|
FROM sn
|
|
|
|
WHERE seriennummer = @serialNumber
|
|
|
|
STATEMENTEND
|
|
|
|
parameters:
|
|
|
|
- name: serialNumber
|
|
|
|
in: path
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
type: integer
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
description: Here are your productionOrderItem items
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
$ref: "#/components/schemas/productionOrderItem"
|
|
|
|
400:
|
|
|
|
$ref: "#/components/responses/clientSideError"
|
|
|
|
500:
|
|
|
|
$ref: "#/components/responses/serverSideError"
|
|
|
|
/pdb/v2/productionOrderItemList/{productionOrder}:
|
|
|
|
get:
|
|
|
|
tags: [ "Regular" ]
|
|
|
|
operationId: Regular.productionOrderItemList
|
|
|
|
summary: Returns productionOrderItem entries
|
|
|
|
description:
|
|
|
|
STATEMENTBEGIN
|
|
|
|
SELECT produktionsauftrag AS productionOrder,
|
|
|
|
seriennummer as serialNumber,
|
|
|
|
n as batchIndex
|
|
|
|
FROM sn
|
|
|
|
WHERE produktionsauftrag = @productionOrder
|
|
|
|
STATEMENTEND
|
|
|
|
parameters:
|
|
|
|
- name: productionOrder
|
|
|
|
in: path
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
responses:
|
|
|
|
200:
|
|
|
|
description: Here are your productionOrderItem items
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
$ref: "#/components/schemas/productionOrderItem"
|
|
|
|
400:
|
|
|
|
$ref: "#/components/responses/clientSideError"
|
|
|
|
500:
|
|
|
|
$ref: "#/components/responses/serverSideError"
|
|
|
|
# /pdb/v2/runDataById/{runId}:
|
|
|
|
# get:
|
|
|
|
# tags: [ "Regular" ]
|
|
|
|
# operationId: Regular.runDataById
|
|
|
|
# summary: Returns runData entries
|
|
|
|
# description:
|
|
|
|
# STATEMENTBEGIN
|
|
|
|
# SELECT run_id,
|
|
|
|
# message,
|
|
|
|
# system_serial_number,
|
|
|
|
# electronic_serial_number,
|
|
|
|
# timestamp,
|
|
|
|
# machine_name,
|
|
|
|
# appname,
|
|
|
|
# appversion
|
|
|
|
# FROM pdb_doc.runs
|
|
|
|
# WHERE run_id = @runId
|
|
|
|
# STATEMENTEND
|
|
|
|
# parameters:
|
|
|
|
# - name: runId
|
|
|
|
# in: path
|
|
|
|
# required: true
|
|
|
|
# schema:
|
|
|
|
# type: string
|
|
|
|
# responses:
|
|
|
|
# 200:
|
|
|
|
# description: Here are your runData items
|
|
|
|
# content:
|
|
|
|
# application/json:
|
|
|
|
# schema:
|
|
|
|
# type: array
|
|
|
|
# items:
|
|
|
|
# $ref: "#/components/schemas/runData"
|
|
|
|
# 400:
|
|
|
|
# $ref: "#/components/responses/clientSideError"
|
|
|
|
# 500:
|
|
|
|
# $ref: "#/components/responses/serverSideError"
|
|
|
|
# /pdb/v2/resultsDataById/{runId}:
|
|
|
|
# get:
|
|
|
|
# tags: [ "Regular" ]
|
|
|
|
# operationId: Regular.resultsDataById
|
|
|
|
# summary: Returns resultsData entries
|
|
|
|
# description:
|
|
|
|
# STATEMENTBEGIN
|
|
|
|
# SELECT run_Id,
|
|
|
|
# name,
|
|
|
|
# type,
|
|
|
|
# objNr,
|
|
|
|
# subNr,
|
|
|
|
# value
|
|
|
|
# FROM pdb_doc.results
|
|
|
|
# WHERE run_id = @runId
|
|
|
|
# STATEMENTEND
|
|
|
|
# parameters:
|
|
|
|
# - name: runId
|
|
|
|
# in: path
|
|
|
|
# required: true
|
|
|
|
# schema:
|
|
|
|
# type: string
|
|
|
|
# responses:
|
|
|
|
# 200:
|
|
|
|
# description: Here are your resultsData items
|
|
|
|
# content:
|
|
|
|
# application/json:
|
|
|
|
# schema:
|
|
|
|
# type: array
|
|
|
|
# items:
|
|
|
|
# $ref: "#/components/schemas/resultsData"
|
|
|
|
# 400:
|
|
|
|
# $ref: "#/components/responses/clientSideError"
|
|
|
|
# 500:
|
|
|
|
# $ref: "#/components/responses/serverSideError"
|
|
|
|
# /pdb/v2/runDataBySystemSerialNumber/{runId}:
|
|
|
|
# get:
|
|
|
|
# tags: [ "Regular" ]
|
|
|
|
# operationId: Regular.runDataBySystemSerialNumber
|
|
|
|
# summary: Returns runData entries
|
|
|
|
# description:
|
|
|
|
# STATEMENTBEGIN
|
|
|
|
# SELECT run_id,
|
|
|
|
# message,
|
|
|
|
# system_serial_number,
|
|
|
|
# electronic_serial_number,
|
|
|
|
# timestamp,
|
|
|
|
# machine_name,
|
|
|
|
# appname,
|
|
|
|
# appversion
|
|
|
|
# FROM pdb_doc.runs
|
|
|
|
# WHERE system_serial_number = @systemSerialNumber
|
|
|
|
# STATEMENTEND
|
|
|
|
# parameters:
|
|
|
|
# - name: runId
|
|
|
|
# in: path
|
|
|
|
# required: true
|
|
|
|
# schema:
|
|
|
|
# type: string
|
|
|
|
# responses:
|
|
|
|
# 200:
|
|
|
|
# description: Here are your runData items
|
|
|
|
# content:
|
|
|
|
# application/json:
|
|
|
|
# schema:
|
|
|
|
# type: array
|
|
|
|
# items:
|
|
|
|
# $ref: "#/components/schemas/runData"
|
|
|
|
# 400:
|
|
|
|
# $ref: "#/components/responses/clientSideError"
|
|
|
|
# 500:
|
|
|
|
# $ref: "#/components/responses/serverSideError"
|
2021-11-18 19:27:39 +01:00
|
|
|
|
|
|
|
components:
|
2021-12-02 12:32:33 +01:00
|
|
|
responses:
|
|
|
|
clientSideError:
|
|
|
|
description: There is something wrong with the data you sent, look into the response object for details
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: "#/components/schemas/errorResultObject"
|
|
|
|
serverSideError:
|
|
|
|
description: Internal Server Error, look into the response object for details
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: "#/components/schemas/errorResultObject"
|
2021-11-18 19:27:39 +01:00
|
|
|
schemas:
|
2021-12-02 09:26:27 +01:00
|
|
|
errorResultObject:
|
|
|
|
description: Object returned in case of an error
|
|
|
|
properties:
|
|
|
|
errorCode:
|
|
|
|
description: repeat the http error code
|
|
|
|
type: integer
|
|
|
|
serviceErrorCode:
|
|
|
|
description: service-specific error code
|
|
|
|
type: integer
|
|
|
|
errorMessage:
|
|
|
|
description: human-readable error message
|
|
|
|
type: string
|
|
|
|
errorInfoURL:
|
|
|
|
description: URL to some more information on the error
|
|
|
|
type: string
|
2021-12-02 11:59:10 +01:00
|
|
|
offensiveData:
|
|
|
|
description: Input data which causes this error
|
|
|
|
type: string
|
2021-11-30 15:02:52 +01:00
|
|
|
productionOrder:
|
|
|
|
description: Selecting columns of the auftraege table from pdb_el
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
productionOrderNumber:
|
|
|
|
type: string
|
2021-12-02 14:28:53 +01:00
|
|
|
cgNumber:
|
2021-11-30 15:02:52 +01:00
|
|
|
type: string
|
2021-11-30 18:20:53 +01:00
|
|
|
nullable: true
|
2021-11-30 15:02:52 +01:00
|
|
|
articleCode:
|
|
|
|
type: string
|
|
|
|
numOfParts:
|
|
|
|
type: integer
|
|
|
|
ix:
|
|
|
|
type: string
|
|
|
|
referenceDocument:
|
|
|
|
type: string
|
2021-11-30 19:24:06 +01:00
|
|
|
baseData:
|
|
|
|
description: Selecting columns of the stammdaten table from pdb_el
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
articleNumber:
|
|
|
|
type: string
|
|
|
|
category:
|
|
|
|
type: string
|
|
|
|
description:
|
|
|
|
type: string
|
2021-12-02 14:28:53 +01:00
|
|
|
productionItem:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
serialNumber:
|
|
|
|
type: integer
|
|
|
|
productionOrder:
|
|
|
|
type: string
|
|
|
|
eRevPlanned:
|
|
|
|
type: string
|
|
|
|
eRevDone:
|
|
|
|
type: string
|
|
|
|
resultFirstStartup:
|
|
|
|
type: string
|
|
|
|
resultCalibration:
|
|
|
|
type: string
|
|
|
|
deliveryDate:
|
|
|
|
type: datetime
|
|
|
|
snlp1:
|
|
|
|
type: integer
|
|
|
|
snlp2:
|
|
|
|
type: integer
|
|
|
|
snlp3:
|
|
|
|
type: integer
|
|
|
|
snlp4:
|
|
|
|
type: integer
|
|
|
|
snlp5:
|
|
|
|
type: integer
|
|
|
|
snlp6:
|
|
|
|
type: integer
|
|
|
|
snlp7:
|
|
|
|
type: integer
|
|
|
|
snlp8:
|
|
|
|
type: integer
|
|
|
|
snlp9:
|
|
|
|
type: integer
|
|
|
|
snlp10:
|
|
|
|
type: integer
|
|
|
|
productionOrderItem:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
productionOrder:
|
|
|
|
type: string
|
|
|
|
serialNumber:
|
|
|
|
type: integer
|
|
|
|
batchIndex:
|
|
|
|
type: integer
|