From 8f051b19238b21702bd0818a032df12b6fb71a9c Mon Sep 17 00:00:00 2001 From: Alberto Codutti Date: Thu, 11 Aug 2022 15:38:55 +0200 Subject: [PATCH] Fixed JobTarget OpenAPI definition Signed-off-by: Alberto Codutti --- .../openapi/jobTarget/jobTarget.yaml | 49 +++++++++++++------ 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/rest-api/resources/src/main/resources/openapi/jobTarget/jobTarget.yaml b/rest-api/resources/src/main/resources/openapi/jobTarget/jobTarget.yaml index 81d8fc39be8..b43e65c17e1 100644 --- a/rest-api/resources/src/main/resources/openapi/jobTarget/jobTarget.yaml +++ b/rest-api/resources/src/main/resources/openapi/jobTarget/jobTarget.yaml @@ -11,22 +11,47 @@ info: name: Eclipse Public License 2.0 url: https://www.eclipse.org/legal/epl-2.0 -paths: {} +paths: { } components: parameters: targetId: name: targetId in: path - description: The ID of the Job Target on which to perform the operation + description: The entity ID of the on which perform the operations schema: $ref: '../openapi.yaml#/components/schemas/kapuaId' required: true schemas: + jobTargetCreator: + allOf: + - $ref: '../openapi.yaml#/components/schemas/kapuaUpdatableEntityCreator' + - type: object + properties: + jobId: + allOf: + - $ref: '../openapi.yaml#/components/schemas/kapuaId' + - description: The ID of the Job to attach the target to + jobTargetId: + allOf: + - $ref: '../openapi.yaml#/components/schemas/kapuaId' + - description: The ID of the Device to attach the target to + example: + type: jobTargetCreator + jobId: auSoU2ph1bY + jobTargetId: JMQdKuPgUjE jobTarget: allOf: - $ref: '../openapi.yaml#/components/schemas/kapuaUpdatableEntity' - $ref: '#/components/schemas/jobTargetCreator' + - type: object + properties: + status: + $ref: '#/components/schemas/jobTargetStatus' + stepIndex: + type: integer + statusMessage: + type: string example: type: jobTarget id: Y-vYl9TKaf8 @@ -40,18 +65,6 @@ components: jobTargetId: VBk_ZDZSOV0 status: PROCESS_OK stepIndex: 0 - jobTargetCreator: - allOf: - - $ref: '../openapi.yaml#/components/schemas/kapuaUpdatableEntityCreator' - - type: object - properties: - jobTargetId: - allOf: - - $ref: '../openapi.yaml#/components/schemas/kapuaId' - - description: The ID of the Device to attach the target to - example: - type: jobTargetCreator - jobTargetId: JMQdKuPgUjE jobTargetListResult: allOf: - $ref: '../openapi.yaml#/components/schemas/kapuaListResult' @@ -78,3 +91,11 @@ components: jobTargetId: VBk_ZDZSOV0 status: PROCESS_OK stepIndex: 0 + jobTargetStatus: + type: string + enum: + - PROCESS_OK + - PROCESS_FAILED + - PROCESS_AWAITING + - AWAITING_COMPLETION + - NOTIFIED_COMPLETION \ No newline at end of file