From 4ada1e2df6cdbe753441a8b7f8b20f68e9bf295f Mon Sep 17 00:00:00 2001 From: SammyOina Date: Tue, 25 Jul 2023 14:27:21 +0300 Subject: [PATCH] update openapi and docs Signed-off-by: SammyOina --- README.md | 3 +- openapi/openapi.yaml | 72 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 72 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cc9da22..180aedd 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,7 @@ The summary is located on our [Website][website]. To Run: ```bash -make docker-image-server -make docker-image-ui +make docker-image make run ``` diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 7f85d1c..bf43f99 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -16,6 +16,46 @@ tags: description: Find out more url: https://github.com/mainflux/et paths: + /: + get: + tags: + - ui + summary: serve ui + operationId: serve ui + parameters: + - $ref: "#/components/parameters/Limit" + - $ref: "#/components/parameters/Offset" + - $ref: "#/components/parameters/From" + - $ref: "#/components/parameters/To" + responses: + "200": + description: found + content: + text/html: + schema: + type: string + /telemetry/summary: + get: + tags: + - telemetry summary + summary: get telemetry summary + operationId: retrieve-summary + parameters: + - $ref: "#/components/parameters/Limit" + - $ref: "#/components/parameters/Offset" + - $ref: "#/components/parameters/From" + - $ref: "#/components/parameters/To" + responses: + "200": + description: found + content: + application/json: + schema: + $ref: "#/components/schemas/TelemetrySummaryRes" + "429": + description: Too many requests + "401": + description: Request is unauthorized /telemetry: post: tags: @@ -36,6 +76,8 @@ paths: parameters: - $ref: "#/components/parameters/Limit" - $ref: "#/components/parameters/Offset" + - $ref: "#/components/parameters/From" + - $ref: "#/components/parameters/To" tags: - telemetry summary: Retrieve telemetry events @@ -79,6 +121,22 @@ components: default: 0 minimum: 0 required: false + From: + name: from + description: From date filter. + in: query + schema: + type: string + default: "" + required: false + To: + name: to + description: From date filter. + in: query + schema: + type: string + default: "" + required: false requestBodies: TelemetryReq: content: @@ -124,11 +182,23 @@ components: type: string timestamp: type: string + TelemetrySummaryRes: + type: object + properties: + total_deployments: + type: integer + countries: + type: object + properties: + country: + type: string + number_of_deployments: + type: integer securitySchemes: ApiKeyAuth: type: apiKey in: header name: apikey + security: - ApiKeyAuth: [] - type: string