From e92dfb906f92771fff450069d2e044e5113393b1 Mon Sep 17 00:00:00 2001 From: gujiawei01 Date: Mon, 16 Oct 2023 18:07:58 +0800 Subject: [PATCH] 1. add swagger yaml --- .../07_operations/swagger/BifroMQ-API.yaml | 234 ++++++++++++++++++ .../07_operations/swagger/BifroMQ-API.yaml | 234 ++++++++++++++++++ 2 files changed, 468 insertions(+) create mode 100644 website/docs/07_operations/swagger/BifroMQ-API.yaml create mode 100644 website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/07_operations/swagger/BifroMQ-API.yaml diff --git a/website/docs/07_operations/swagger/BifroMQ-API.yaml b/website/docs/07_operations/swagger/BifroMQ-API.yaml new file mode 100644 index 00000000..b79fd022 --- /dev/null +++ b/website/docs/07_operations/swagger/BifroMQ-API.yaml @@ -0,0 +1,234 @@ +openapi: 3.0.1 +info: + title: BifroMQ RESTful API + version: "1.0.2" +paths: + /expireinbox: + delete: + summary: Expire inbox manually + operationId: handle + parameters: + - name: req_id + in: header + description: optional caller provided request id + schema: + type: integer + format: int64 + - name: tenant_id + in: header + description: the tenant id + required: true + schema: + type: string + - name: expiry_seconds + in: header + description: the inboxes expiry time + required: true + schema: + type: string + responses: + "200": + description: Success + /kill: + delete: + summary: Disconnect a MQTT client connection + operationId: handle_1 + parameters: + - name: req_id + in: header + description: optional caller provided request id + schema: + type: integer + format: int64 + - name: tenant_id + in: header + description: the tenant id + required: true + schema: + type: string + - name: user_id + in: header + description: the user id of the MQTT client connection to be disconnected + required: true + schema: + type: string + - name: client_type + in: header + description: the client type + required: true + schema: + type: string + - name: client_meta_* + in: header + description: "the metadata header about the kicker client, must be started\ + \ with client_meta_" + schema: + type: string + responses: + "200": + description: Success + "404": + description: Not Found + /pub: + post: + summary: Publish a message to given topic + operationId: handle_2 + parameters: + - name: req_id + in: header + description: optional caller provided request id + schema: + type: integer + format: int64 + - name: tenant_id + in: header + description: the tenant id + required: true + schema: + type: string + - name: topic + in: header + description: the message topic + required: true + schema: + type: string + - name: client_type + in: header + description: the client type + required: true + schema: + type: string + - name: pub_qos + in: header + description: QoS of the message to be distributed + required: true + schema: + type: string + - name: retain + in: header + description: the message should be retained + schema: + type: string + - name: client_meta_* + in: header + description: "the metadata header about the kicker client, must be started\ + \ with client_meta_" + schema: + type: string + requestBody: + description: Message payload will be treated as binary + content: + application/octet-stream: {} + required: true + responses: + "200": + description: Success + /sub: + put: + summary: Add a topic subscription to an inbox + operationId: handle_3 + parameters: + - name: req_id + in: header + description: optional caller provided request id + schema: + type: integer + format: int64 + - name: tenant_id + in: header + description: the tenant id + required: true + schema: + type: string + - name: topic_filter + in: header + description: the topic filter to add + required: true + schema: + type: string + - name: sub_qos + in: header + description: the qos of the subscription + required: true + schema: + type: string + enum: + - "0" + - "1" + - "2" + - name: inbox_id + in: header + description: the inbox for receiving subscribed messages + required: true + schema: + type: string + - name: deliverer_key + in: header + description: deliverer key for subBroker + schema: + type: string + - name: subbroker_id + in: header + description: the id of the subbroker hosting the inbox + required: true + schema: + type: integer + format: int32 + responses: + "200": + description: Success + headers: + sub_qos: + description: the sub qos granted + style: simple + schema: + enum: + - "0" + - "1" + - "2" + /unsub: + delete: + summary: Remove a topic subscription from an inbox + operationId: handle_4 + parameters: + - name: req_id + in: header + description: optional caller provided request id + schema: + type: integer + format: int64 + - name: tenant_id + in: header + description: the tenant id + required: true + schema: + type: string + - name: topic_filter + in: header + description: the topic filter to remove + required: true + schema: + type: string + - name: inbox_id + in: header + description: the inbox for receiving subscribed messages + required: true + schema: + type: string + - name: deliverer_key + in: header + description: deliverer key for subBroker + schema: + type: string + - name: subbroker_id + in: header + description: the id of the subbroker hosting the inbox + required: true + schema: + type: integer + format: int32 + responses: + "200": + description: Success + "404": + description: Topic filter not found diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/07_operations/swagger/BifroMQ-API.yaml b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/07_operations/swagger/BifroMQ-API.yaml new file mode 100644 index 00000000..b79fd022 --- /dev/null +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/07_operations/swagger/BifroMQ-API.yaml @@ -0,0 +1,234 @@ +openapi: 3.0.1 +info: + title: BifroMQ RESTful API + version: "1.0.2" +paths: + /expireinbox: + delete: + summary: Expire inbox manually + operationId: handle + parameters: + - name: req_id + in: header + description: optional caller provided request id + schema: + type: integer + format: int64 + - name: tenant_id + in: header + description: the tenant id + required: true + schema: + type: string + - name: expiry_seconds + in: header + description: the inboxes expiry time + required: true + schema: + type: string + responses: + "200": + description: Success + /kill: + delete: + summary: Disconnect a MQTT client connection + operationId: handle_1 + parameters: + - name: req_id + in: header + description: optional caller provided request id + schema: + type: integer + format: int64 + - name: tenant_id + in: header + description: the tenant id + required: true + schema: + type: string + - name: user_id + in: header + description: the user id of the MQTT client connection to be disconnected + required: true + schema: + type: string + - name: client_type + in: header + description: the client type + required: true + schema: + type: string + - name: client_meta_* + in: header + description: "the metadata header about the kicker client, must be started\ + \ with client_meta_" + schema: + type: string + responses: + "200": + description: Success + "404": + description: Not Found + /pub: + post: + summary: Publish a message to given topic + operationId: handle_2 + parameters: + - name: req_id + in: header + description: optional caller provided request id + schema: + type: integer + format: int64 + - name: tenant_id + in: header + description: the tenant id + required: true + schema: + type: string + - name: topic + in: header + description: the message topic + required: true + schema: + type: string + - name: client_type + in: header + description: the client type + required: true + schema: + type: string + - name: pub_qos + in: header + description: QoS of the message to be distributed + required: true + schema: + type: string + - name: retain + in: header + description: the message should be retained + schema: + type: string + - name: client_meta_* + in: header + description: "the metadata header about the kicker client, must be started\ + \ with client_meta_" + schema: + type: string + requestBody: + description: Message payload will be treated as binary + content: + application/octet-stream: {} + required: true + responses: + "200": + description: Success + /sub: + put: + summary: Add a topic subscription to an inbox + operationId: handle_3 + parameters: + - name: req_id + in: header + description: optional caller provided request id + schema: + type: integer + format: int64 + - name: tenant_id + in: header + description: the tenant id + required: true + schema: + type: string + - name: topic_filter + in: header + description: the topic filter to add + required: true + schema: + type: string + - name: sub_qos + in: header + description: the qos of the subscription + required: true + schema: + type: string + enum: + - "0" + - "1" + - "2" + - name: inbox_id + in: header + description: the inbox for receiving subscribed messages + required: true + schema: + type: string + - name: deliverer_key + in: header + description: deliverer key for subBroker + schema: + type: string + - name: subbroker_id + in: header + description: the id of the subbroker hosting the inbox + required: true + schema: + type: integer + format: int32 + responses: + "200": + description: Success + headers: + sub_qos: + description: the sub qos granted + style: simple + schema: + enum: + - "0" + - "1" + - "2" + /unsub: + delete: + summary: Remove a topic subscription from an inbox + operationId: handle_4 + parameters: + - name: req_id + in: header + description: optional caller provided request id + schema: + type: integer + format: int64 + - name: tenant_id + in: header + description: the tenant id + required: true + schema: + type: string + - name: topic_filter + in: header + description: the topic filter to remove + required: true + schema: + type: string + - name: inbox_id + in: header + description: the inbox for receiving subscribed messages + required: true + schema: + type: string + - name: deliverer_key + in: header + description: deliverer key for subBroker + schema: + type: string + - name: subbroker_id + in: header + description: the id of the subbroker hosting the inbox + required: true + schema: + type: integer + format: int32 + responses: + "200": + description: Success + "404": + description: Topic filter not found