From 40e8dd357521ff110cb50407006eb1895b9121ca Mon Sep 17 00:00:00 2001 From: Vlad Klokun Date: Mon, 1 Aug 2022 18:43:37 +0300 Subject: [PATCH] fix: add Swagger file to httphandler package --- httphandler/swagger.yaml | 57 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/httphandler/swagger.yaml b/httphandler/swagger.yaml index 00ca942b..94b0767e 100644 --- a/httphandler/swagger.yaml +++ b/httphandler/swagger.yaml @@ -111,7 +111,6 @@ definitions: x-go-name: Type type: object x-go-package: github.com/armosec/opa-utils/httpserver/meta/v1 -host: 192.168.49.2:31379 info: description: 'The Kubescape Microservice API allows clients to interact with a Kubescape instance running in a Kubernetes cluster: trigger scans, retrieve and delete their @@ -209,7 +208,7 @@ paths: "204": $ref: '#/responses/scanResponse' "400": - $ref: '#/responses/scanResponse' + $ref: '#/responses/scanResponseError' summary: Returns results of a scan tags: - scanning @@ -281,6 +280,60 @@ responses: description: A Scan Response object schema: $ref: '#/definitions/Response' + scanResponseError: + description: "" + schema: + allOf: + - properties: + id: + description: ID of the scan + example: d13791eb-19b1-4222-867b-9a7c1799cfac + format: uuid4 + type: string + x-go-name: ID + response: + description: The actual Response object + example: + some: other + type: object + x-go-name: Response + type: + description: |- + Type of this response + id IDScanResponseType Deprecated: will return busy/notBusy instead + error ErrorScanResponseType A response contains an error message + v1results ResultsV1ScanResponseType A response contains a v1 Results object + busy BusyScanResponseType A response indicates that a server is busy with another request + notBusy NotBusyScanResponseType A response indicates server is not busy with another request + ready ReadyScanResponseType A response indicates that a server has successfully completed the request + enum: + - id + - error + - v1results + - busy + - notBusy + - ready + example: busy + type: string + x-go-enum-desc: |- + id IDScanResponseType Deprecated: will return busy/notBusy instead + error ErrorScanResponseType A response contains an error message + v1results ResultsV1ScanResponseType A response contains a v1 Results object + busy BusyScanResponseType A response indicates that a server is busy with another request + notBusy NotBusyScanResponseType A response indicates server is not busy with another request + ready ReadyScanResponseType A response indicates that a server has successfully completed the request + x-go-name: Type + type: object + - properties: + response: + example: '"an error occurred"' + type: object + x-go-name: Resp + type: + example: error + type: string + x-go-name: Type + type: object schemes: - http swagger: "2.0"