This is an automated email from the ASF dual-hosted git repository.
dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git
The following commit(s) were added to refs/heads/master by this push:
new 3186d0a43b [INLONG-10391][Manager] Supports configuring zk clusters
and issuing zk addresses to agents (#10392)
3186d0a43b is described below
commit 3186d0a43b4dc22dfe03aca00670a1140a53705a
Author: fuweng11 <[email protected]>
AuthorDate: Thu Jun 13 11:02:48 2024 +0800
[INLONG-10391][Manager] Supports configuring zk clusters and issuing zk
addresses to agents (#10392)
---
.../inlong/common/pojo/agent/AgentConfigInfo.java | 46 +++++++++++
.../common/pojo/agent/AgentConfigRequest.java | 36 +++++++++
.../inlong/manager/common/enums/ClusterType.java | 2 +
.../manager/pojo/cluster/zk/AgentZkClusterDTO.java | 63 +++++++++++++++
.../pojo/cluster/zk/AgentZkClusterInfo.java | 49 +++++++++++
.../pojo/cluster/zk/AgentZkClusterRequest.java | 43 ++++++++++
.../service/cluster/AgentZkClusterOperator.java | 94 ++++++++++++++++++++++
.../inlong/manager/service/core/AgentService.java | 10 +++
.../service/core/impl/AgentServiceImpl.java | 34 ++++++++
.../web/controller/openapi/AgentController.java | 8 ++
10 files changed, 385 insertions(+)
diff --git
a/inlong-common/src/main/java/org/apache/inlong/common/pojo/agent/AgentConfigInfo.java
b/inlong-common/src/main/java/org/apache/inlong/common/pojo/agent/AgentConfigInfo.java
new file mode 100644
index 0000000000..7d5f8ce4df
--- /dev/null
+++
b/inlong-common/src/main/java/org/apache/inlong/common/pojo/agent/AgentConfigInfo.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+package org.apache.inlong.common.pojo.agent;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * The Agent config info.
+ */
+@Data
+public class AgentConfigInfo {
+
+ private String zkUrl;
+
+ private AgentClusterInfo cluster;
+
+ @Data
+ @Builder
+ @NoArgsConstructor
+ @AllArgsConstructor
+ public static class AgentClusterInfo {
+
+ private Integer parentId;
+
+ private String clusterName;
+
+ }
+}
diff --git
a/inlong-common/src/main/java/org/apache/inlong/common/pojo/agent/AgentConfigRequest.java
b/inlong-common/src/main/java/org/apache/inlong/common/pojo/agent/AgentConfigRequest.java
new file mode 100644
index 0000000000..f81bd3a281
--- /dev/null
+++
b/inlong-common/src/main/java/org/apache/inlong/common/pojo/agent/AgentConfigRequest.java
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+package org.apache.inlong.common.pojo.agent;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * Request for Agent config
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class AgentConfigRequest {
+
+ private String clusterTag;
+
+ private String clusterName;
+
+}
diff --git
a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/ClusterType.java
b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/ClusterType.java
index 8e98bd0383..d7e8ba7d4b 100644
---
a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/ClusterType.java
+++
b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/ClusterType.java
@@ -38,6 +38,8 @@ public class ClusterType {
public static final String SORT_PULSAR = "SORT_PULSAR";
public static final String SORT_KAFKA = "SORT_KAFKA";
+ public static final String AGENT_ZK = "AGENT_ZK";
+
private static final Set<String> TYPE_SET = new HashSet<String>() {
{
diff --git
a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/cluster/zk/AgentZkClusterDTO.java
b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/cluster/zk/AgentZkClusterDTO.java
new file mode 100644
index 0000000000..c758efe4b7
--- /dev/null
+++
b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/cluster/zk/AgentZkClusterDTO.java
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+
+package org.apache.inlong.manager.pojo.cluster.zk;
+
+import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
+import org.apache.inlong.manager.common.exceptions.BusinessException;
+import org.apache.inlong.manager.common.util.CommonBeanUtils;
+import org.apache.inlong.manager.common.util.JsonUtils;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.StringUtils;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * Agent zk cluster info
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@ApiModel("Agent zk cluster info")
+public class AgentZkClusterDTO {
+
+ /**
+ * Get the dto instance from the request
+ */
+ public static AgentZkClusterDTO getFromRequest(AgentZkClusterRequest
request, String extParams) {
+ AgentZkClusterDTO dto = StringUtils.isNotBlank(extParams)
+ ? AgentZkClusterDTO.getFromJson(extParams)
+ : new AgentZkClusterDTO();
+ return CommonBeanUtils.copyProperties(request, dto, true);
+ }
+
+ /**
+ * Get the dto instance from the JSON string.
+ */
+ public static AgentZkClusterDTO getFromJson(@NotNull String extParams) {
+ try {
+ return JsonUtils.parseObject(extParams, AgentZkClusterDTO.class);
+ } catch (Exception e) {
+ throw new BusinessException(ErrorCodeEnum.CLUSTER_INFO_INCORRECT,
+ String.format("parse extParams of agent zk Cluster
failure: %s", e.getMessage()));
+ }
+ }
+}
diff --git
a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/cluster/zk/AgentZkClusterInfo.java
b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/cluster/zk/AgentZkClusterInfo.java
new file mode 100644
index 0000000000..1c748c938d
--- /dev/null
+++
b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/cluster/zk/AgentZkClusterInfo.java
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+package org.apache.inlong.manager.pojo.cluster.zk;
+
+import org.apache.inlong.manager.common.enums.ClusterType;
+import org.apache.inlong.manager.common.util.CommonBeanUtils;
+import org.apache.inlong.manager.common.util.JsonTypeDefine;
+import org.apache.inlong.manager.pojo.cluster.ClusterInfo;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+/**
+ * Inlong cluster info for agent ZK
+ */
+@Data
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+@JsonTypeDefine(value = ClusterType.AGENT_ZK)
+@ApiModel("Inlong cluster info for agent ZK")
+public class AgentZkClusterInfo extends ClusterInfo {
+
+ public AgentZkClusterInfo() {
+ this.setType(ClusterType.AGENT_ZK);
+ }
+
+ @Override
+ public AgentZkClusterRequest genRequest() {
+ return CommonBeanUtils.copyProperties(this,
AgentZkClusterRequest::new);
+ }
+
+}
diff --git
a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/cluster/zk/AgentZkClusterRequest.java
b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/cluster/zk/AgentZkClusterRequest.java
new file mode 100644
index 0000000000..365ca2974e
--- /dev/null
+++
b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/cluster/zk/AgentZkClusterRequest.java
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+
+package org.apache.inlong.manager.pojo.cluster.zk;
+
+import org.apache.inlong.manager.common.enums.ClusterType;
+import org.apache.inlong.manager.common.util.JsonTypeDefine;
+import org.apache.inlong.manager.pojo.cluster.ClusterRequest;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+/**
+ * Inlong cluster request for agent ZK
+ */
+@Data
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+@JsonTypeDefine(value = ClusterType.AGENT_ZK)
+@ApiModel("Inlong cluster request for agent ZK")
+public class AgentZkClusterRequest extends ClusterRequest {
+
+ public AgentZkClusterRequest() {
+ this.setType(ClusterType.AGENT_ZK);
+ }
+
+}
diff --git
a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/AgentZkClusterOperator.java
b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/AgentZkClusterOperator.java
new file mode 100644
index 0000000000..ce438fa8df
--- /dev/null
+++
b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/cluster/AgentZkClusterOperator.java
@@ -0,0 +1,94 @@
+/*
+ * 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.
+ */
+
+package org.apache.inlong.manager.service.cluster;
+
+import org.apache.inlong.manager.common.enums.ClusterType;
+import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
+import org.apache.inlong.manager.common.exceptions.BusinessException;
+import org.apache.inlong.manager.common.util.CommonBeanUtils;
+import org.apache.inlong.manager.dao.entity.InlongClusterEntity;
+import org.apache.inlong.manager.pojo.cluster.ClusterInfo;
+import org.apache.inlong.manager.pojo.cluster.ClusterRequest;
+import org.apache.inlong.manager.pojo.cluster.zk.AgentZkClusterDTO;
+import org.apache.inlong.manager.pojo.cluster.zk.AgentZkClusterInfo;
+import org.apache.inlong.manager.pojo.cluster.zk.AgentZkClusterRequest;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Service
+public class AgentZkClusterOperator extends AbstractClusterOperator {
+
+ private static final Logger LOGGER =
LoggerFactory.getLogger(AgentZkClusterOperator.class);
+
+ @Autowired
+ private ObjectMapper objectMapper;
+
+ @Override
+ public Boolean accept(String clusterType) {
+ return getClusterType().equals(clusterType);
+ }
+
+ @Override
+ public String getClusterType() {
+ return ClusterType.AGENT_ZK;
+ }
+
+ @Override
+ protected void setTargetEntity(ClusterRequest request, InlongClusterEntity
targetEntity) {
+ AgentZkClusterRequest agentZkClusterRequest = (AgentZkClusterRequest)
request;
+ CommonBeanUtils.copyProperties(agentZkClusterRequest, targetEntity,
true);
+ try {
+ AgentZkClusterDTO dto =
+ AgentZkClusterDTO.getFromRequest(agentZkClusterRequest,
targetEntity.getExtParams());
+ targetEntity.setExtParams(objectMapper.writeValueAsString(dto));
+ } catch (Exception e) {
+ throw new BusinessException(ErrorCodeEnum.CLUSTER_INFO_INCORRECT,
+ String.format("serialize extParams of agent zk Cluster
failure: %s", e.getMessage()));
+ }
+ }
+
+ @Override
+ public ClusterInfo getFromEntity(InlongClusterEntity entity) {
+ if (entity == null) {
+ throw new BusinessException(ErrorCodeEnum.CLUSTER_NOT_FOUND);
+ }
+ AgentZkClusterInfo info = new AgentZkClusterInfo();
+ CommonBeanUtils.copyProperties(entity, info);
+ if (StringUtils.isNotBlank(entity.getExtParams())) {
+ AgentZkClusterDTO dto =
AgentZkClusterDTO.getFromJson(entity.getExtParams());
+ CommonBeanUtils.copyProperties(dto, info);
+ }
+ return info;
+ }
+
+ @Override
+ public Object getClusterInfo(InlongClusterEntity entity) {
+ AgentZkClusterInfo agentZkClusterInfo = (AgentZkClusterInfo)
this.getFromEntity(entity);
+ Map<String, String> map = new HashMap<>();
+ map.put("url", agentZkClusterInfo.getUrl());
+ return map;
+ }
+}
diff --git
a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/AgentService.java
b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/AgentService.java
index 14d63f3c6a..cd1d8dbfb0 100644
---
a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/AgentService.java
+++
b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/AgentService.java
@@ -17,6 +17,8 @@
package org.apache.inlong.manager.service.core;
+import org.apache.inlong.common.pojo.agent.AgentConfigInfo;
+import org.apache.inlong.common.pojo.agent.AgentConfigRequest;
import org.apache.inlong.common.pojo.agent.TaskRequest;
import org.apache.inlong.common.pojo.agent.TaskResult;
import org.apache.inlong.common.pojo.agent.TaskSnapshotRequest;
@@ -44,6 +46,14 @@ public interface AgentService {
*/
void report(TaskRequest request);
+ /**
+ * Agent cluster config.
+ *
+ * @param request Request of the agent config.
+ * @return Agent config info result.
+ */
+ AgentConfigInfo getAgentConfig(AgentConfigRequest request);
+
/**
* Agent pull task config.
*
diff --git
a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/AgentServiceImpl.java
b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/AgentServiceImpl.java
index 52268e0a41..522bdc1022 100644
---
a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/AgentServiceImpl.java
+++
b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/AgentServiceImpl.java
@@ -23,6 +23,8 @@ import org.apache.inlong.common.db.CommandEntity;
import org.apache.inlong.common.enums.PullJobTypeEnum;
import org.apache.inlong.common.enums.TaskStateEnum;
import org.apache.inlong.common.enums.TaskTypeEnum;
+import org.apache.inlong.common.pojo.agent.AgentConfigInfo;
+import org.apache.inlong.common.pojo.agent.AgentConfigRequest;
import org.apache.inlong.common.pojo.agent.CmdConfig;
import org.apache.inlong.common.pojo.agent.DataConfig;
import org.apache.inlong.common.pojo.agent.TaskRequest;
@@ -61,6 +63,7 @@ import
org.apache.inlong.manager.dao.mapper.ModuleConfigEntityMapper;
import org.apache.inlong.manager.dao.mapper.PackageConfigEntityMapper;
import org.apache.inlong.manager.dao.mapper.StreamSourceEntityMapper;
import org.apache.inlong.manager.pojo.cluster.ClusterPageRequest;
+import org.apache.inlong.manager.pojo.cluster.agent.AgentClusterInfo;
import
org.apache.inlong.manager.pojo.cluster.agent.AgentClusterNodeBindGroupRequest;
import org.apache.inlong.manager.pojo.cluster.agent.AgentClusterNodeDTO;
import org.apache.inlong.manager.pojo.cluster.pulsar.PulsarClusterDTO;
@@ -68,6 +71,7 @@ import
org.apache.inlong.manager.pojo.group.pulsar.InlongPulsarDTO;
import org.apache.inlong.manager.pojo.module.ModuleDTO;
import org.apache.inlong.manager.pojo.source.file.FileSourceDTO;
import org.apache.inlong.manager.pojo.stream.InlongStreamInfo;
+import org.apache.inlong.manager.service.cluster.InlongClusterService;
import org.apache.inlong.manager.service.core.AgentService;
import org.apache.inlong.manager.service.source.SourceOperatorFactory;
import org.apache.inlong.manager.service.source.SourceSnapshotOperator;
@@ -182,6 +186,8 @@ public class AgentServiceImpl implements AgentService {
private ModuleConfigEntityMapper moduleConfigEntityMapper;
@Autowired
private PackageConfigEntityMapper packageConfigEntityMapper;
+ @Autowired
+ private InlongClusterService clusterService;
/**
* Start the update task
@@ -322,6 +328,34 @@ public class AgentServiceImpl implements AgentService {
}
}
+ @Override
+ public AgentConfigInfo getAgentConfig(AgentConfigRequest request) {
+ LOGGER.debug("begin to get agent config info for {}", request);
+ AgentConfigInfo agentConfigInfo = new AgentConfigInfo();
+ Set<String> tagSet = new HashSet<>(16);
+
tagSet.addAll(Arrays.asList(request.getClusterTag().split(InlongConstants.COMMA)));
+ List<String> clusterTagList = new ArrayList<>(tagSet);
+ ClusterPageRequest pageRequest = ClusterPageRequest.builder()
+ .type(ClusterType.AGENT_ZK)
+ .clusterTagList(clusterTagList)
+ .build();
+ List<InlongClusterEntity> agentZkCluster =
clusterMapper.selectByCondition(pageRequest);
+ if (CollectionUtils.isEmpty(agentZkCluster)) {
+ throw new BusinessException("zk cluster for ha not found for
cluster tag=" + request.getClusterTag());
+ }
+ agentConfigInfo.setZkUrl(agentZkCluster.get(0).getUrl());
+
+ AgentClusterInfo clusterInfo = (AgentClusterInfo)
clusterService.getOne(
+ null, request.getClusterName(), ClusterType.AGENT);
+ agentConfigInfo.setCluster(AgentConfigInfo.AgentClusterInfo.builder()
+ .parentId(clusterInfo.getId())
+ .clusterName(clusterInfo.getName())
+ .build());
+
+ LOGGER.debug("success to get agent config info for: {}, result: {}",
request, agentConfigInfo);
+ return agentConfigInfo;
+ }
+
@Override
@Transactional(rollbackFor = Throwable.class, isolation =
Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW)
public TaskResult getTaskResult(TaskRequest request) {
diff --git
a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/openapi/AgentController.java
b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/openapi/AgentController.java
index 77011bd2e1..32c0b7175c 100644
---
a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/openapi/AgentController.java
+++
b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/openapi/AgentController.java
@@ -17,6 +17,8 @@
package org.apache.inlong.manager.web.controller.openapi;
+import org.apache.inlong.common.pojo.agent.AgentConfigInfo;
+import org.apache.inlong.common.pojo.agent.AgentConfigRequest;
import org.apache.inlong.common.pojo.agent.TaskRequest;
import org.apache.inlong.common.pojo.agent.TaskResult;
import org.apache.inlong.common.pojo.agent.TaskSnapshotRequest;
@@ -70,6 +72,12 @@ public class AgentController {
return Response.success(agentService.getTaskResult(request));
}
+ @PostMapping("/agent/getConfig")
+ @ApiOperation(value = "Pull agent config info")
+ public Response<AgentConfigInfo> getAgentConfig(@RequestBody
AgentConfigRequest request) {
+ return Response.success(agentService.getAgentConfig(request));
+ }
+
@PostMapping("/agent/getExistTaskConfig")
@ApiOperation(value = "Get all exist task config")
public Response<TaskResult> getExistTaskConfig(@RequestBody TaskRequest
request) {