Browse Source

[API] POST Topic

Oleg Shuralev 5 years ago
parent
commit
ee92f4482f
1 changed files with 17 additions and 0 deletions
  1. 17 0
      api/services/topics.js

+ 17 - 0
api/services/topics.js

@@ -14,6 +14,23 @@ module.exports = function (fastify, opts, next) {
     })
     .get('/clusters/:clusterId/topics/:topicId/config', function (request, reply) {
       reply.send(topicConfig);
+    })
+    .post('/clusters/:clusterId/topics', function (request, reply) {
+      /* Payload
+        {
+          "name":"AlphaNumeric-String_with,and.",
+          "partitions":"1",
+          "replicationFactor":"1",
+          "configs": {
+            "retention.ms": "604800000",
+            "retention.bytes": "-1",
+            "max.message.bytes":"1000012",
+            "min.insync.replicas":"1"
+          }
+        }
+      */
+
+      reply.code(201).send();
     });
 
   next();