[API] Topic Deatils mocks
This commit is contained in:
parent
dbe497f0f2
commit
ea4b9dc0b4
2 changed files with 18 additions and 3 deletions
10
api/mocks/topicDetails.js
Normal file
10
api/mocks/topicDetails.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
module.exports = {
|
||||
partitionCount: 25,
|
||||
replicationFactor: 1,
|
||||
replicas: 25,
|
||||
inSyncReplicas: 25,
|
||||
bytesInPerSec: 0,
|
||||
segmentSize: 0,
|
||||
segmentCount: 25,
|
||||
underReplicatedPartitions: 0
|
||||
};
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue