From bd8d73640c9d8b00ad6a097d5883634addfc13f6 Mon Sep 17 00:00:00 2001 From: yuri Date: Tue, 14 Sep 2021 05:10:55 -0400 Subject: [PATCH] [ISSUE #435] Initial Creation of eventMesh-admin module in EventMesh (#513) * initial checkin of eventmesh-schema-plugin * add file header * rework pr to add eventmesh-admin module * typo in readme * add topic rest apis in readme * add topic rest apis in readme * move schema registry out of this pr * move schema registry out of this pr --- build.gradle | 1 + eventmesh-admin/README.md | 53 +++++++++++++++++++ eventmesh-admin/build.gradle | 19 +++++++ eventmesh-admin/gradle.properties | 16 ++++++ eventmesh-runtime/build.gradle | 1 - .../controller/ClientManageController.java | 2 +- settings.gradle | 1 + 7 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 eventmesh-admin/README.md create mode 100644 eventmesh-admin/build.gradle create mode 100644 eventmesh-admin/gradle.properties diff --git a/build.gradle b/build.gradle index 5cd021d4af..c24692ab06 100644 --- a/build.gradle +++ b/build.gradle @@ -202,6 +202,7 @@ subprojects { exclude 'eventmesh-common*.jar' exclude 'eventmesh-connector-api*.jar' exclude 'eventmesh-connector-plugin*.jar' + exclude 'eventmesh-admin*.jar' exclude 'eventmesh-starter*.jar' exclude 'eventmesh-test*.jar' exclude 'eventmesh-sdk*.jar' diff --git a/eventmesh-admin/README.md b/eventmesh-admin/README.md new file mode 100644 index 0000000000..84f80470d8 --- /dev/null +++ b/eventmesh-admin/README.md @@ -0,0 +1,53 @@ +# EventMesh Administration Module + +EventMesh Administration Module for EventMesh. It manages Admin Service, Configurations such as topics/subscriptions management.It works as a control plane and provide some interface to manage the eventmesh-runtime module and other configurations. + +## Administration Client Manager APIs + +### POST /clientmanage/topics/ +- Create a new topic if does not exist +- Exposed POST endpoint to create a new topic if it does not exist. + * Url - http://localhost:8081/clientmanage/topics/ + * sample request payload + ```json + { + "name": "mytopic1" + } + ``` + + Sample response + + ```json + { + "topic": "mytopic1", + "created_time": "2021-09-03", + } + ``` +### DELETE /clientmanage/topics/(string: topic)/ +- Delete a specific topic. +- Exposed DELETE endpoint to remove a specific topic + * URL - + ```url + http://localhost:8081/clientmanage/topics/mytopic1 + ``` + + * Response - + + ```json + { + "topic": "mytopic1", + } + ``` + +### GET /clientmanage/topics +- Retrieve a list of topics +- Exposed GET endpoint to retrieve all topics + * URL - + ```url + http://localhost:8081/clientmanage/topics + ``` + * Response + + ```json + ["mytopic1", "mytopic2"] + ``` diff --git a/eventmesh-admin/build.gradle b/eventmesh-admin/build.gradle new file mode 100644 index 0000000000..2bbbee28ff --- /dev/null +++ b/eventmesh-admin/build.gradle @@ -0,0 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +dependencies { +} \ No newline at end of file diff --git a/eventmesh-admin/gradle.properties b/eventmesh-admin/gradle.properties new file mode 100644 index 0000000000..a9fd83fea0 --- /dev/null +++ b/eventmesh-admin/gradle.properties @@ -0,0 +1,16 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# \ No newline at end of file diff --git a/eventmesh-runtime/build.gradle b/eventmesh-runtime/build.gradle index ffa13cc9a7..0f5ca14420 100644 --- a/eventmesh-runtime/build.gradle +++ b/eventmesh-runtime/build.gradle @@ -29,7 +29,6 @@ dependencies { implementation project(":eventmesh-registry-plugin:eventmesh-registry-api") implementation project(":eventmesh-registry-plugin:eventmesh-registry-rocketmq-namesrv") - testImplementation project(":eventmesh-connector-plugin:eventmesh-connector-api") testImplementation project(":eventmesh-security-plugin:eventmesh-security-api") testImplementation project(":eventmesh-security-plugin:eventmesh-security-acl") diff --git a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/controller/ClientManageController.java b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/controller/ClientManageController.java index e2cb0427ac..cd6d094db5 100644 --- a/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/controller/ClientManageController.java +++ b/eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/controller/ClientManageController.java @@ -53,4 +53,4 @@ public void start() throws IOException { server.start(); logger.info("ClientManageController start success, port:{}", port); } -} +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index e5b8965db8..92c8c5becc 100644 --- a/settings.gradle +++ b/settings.gradle @@ -29,4 +29,5 @@ include 'eventmesh-security-plugin:eventmesh-security-api' include 'eventmesh-security-plugin:eventmesh-security-acl' include 'eventmesh-registry-plugin:eventmesh-registry-api' include 'eventmesh-registry-plugin:eventmesh-registry-rocketmq-namesrv' +include 'eventmesh-admin'