diff --git a/src/routes/tanksRoute.js b/src/routes/tanksRoute.js index 6f465b77..920c65d6 100644 --- a/src/routes/tanksRoute.js +++ b/src/routes/tanksRoute.js @@ -327,6 +327,45 @@ module.exports = function (fastify, opts, next) { }); + + + fastify.route({ + method: "POST", + url: "/api/APIWrite", + schema: { + tags: ["Tank"], + description: "This is for creating an IOT Device", + summary: "this is to Create IOT Device", + body: { + type: "object", + properties: { + hardwareId: { type: "string" }, + mode: { type: "string" }, + tanks: { + type: "array", + items: { + type: "object", + properties: { + tankhardwareId: { type: "string" }, + tankHeight: { type: "string" }, + maxLevel: { type: "string" }, + minLevel: { type: "string" } + }, + required: ["tankhardwareId", "tankHeight", "maxLevel", "minLevel"] + } + } + }, + required: ["hardwareId", "mode", "tanks"] + }, + security: [ + { + basicAuth: [] + } + ] + }, + handler: tanksController.IotDevice + }); + fastify.get("/api/APIRead", { schema: {