From ea4b9dc0b43ea2ef0cc91d1fe0236960b98e391c Mon Sep 17 00:00:00 2001 From: Oleg Shuralev Date: Sun, 12 Jan 2020 01:52:37 +0300 Subject: [PATCH] [API] Topic Deatils mocks --- api/mocks/topicDetails.js | 10 ++++++++++ api/services/topics.js | 11 ++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 api/mocks/topicDetails.js diff --git a/api/mocks/topicDetails.js b/api/mocks/topicDetails.js new file mode 100644 index 0000000000..416bc48517 --- /dev/null +++ b/api/mocks/topicDetails.js @@ -0,0 +1,10 @@ +module.exports = { + partitionCount: 25, + replicationFactor: 1, + replicas: 25, + inSyncReplicas: 25, + bytesInPerSec: 0, + segmentSize: 0, + segmentCount: 25, + underReplicatedPartitions: 0 +}; diff --git a/api/services/topics.js b/api/services/topics.js index 857cb46291..0d0aa12021 100644 --- a/api/services/topics.js +++ b/api/services/topics.js @@ -1,11 +1,16 @@ 'use strict' const topics = require('../mocks/topics'); +const topicDetails = require('../mocks/topicDetails'); module.exports = function (fastify, opts, next) { - fastify.get('/clusters/:clusterId/topics', function (request, reply) { - reply.send(topics[request.params.clusterId]); - }); + fastify + .get('/clusters/:clusterId/topics', function (request, reply) { + reply.send(topics[request.params.clusterId]); + }) + .get('/clusters/:clusterId/topics/:topicId', function (request, reply) { + reply.send(topicDetails); + }); next(); }