This is an automated email from the ASF dual-hosted git repository. zirui 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 7df7c8cea5 [INLONG-9073][Manager] Add getStreamBriefInfo method for InlongStreamClient (#9074) 7df7c8cea5 is described below commit 7df7c8cea51a4c8b52ccf52116e8ff58d5603dfe Author: fuweng11 <76141879+fuwen...@users.noreply.github.com> AuthorDate: Wed Oct 25 14:23:15 2023 +0800 [INLONG-9073][Manager] Add getStreamBriefInfo method for InlongStreamClient (#9074) --- .../client/api/inner/client/InlongStreamClient.java | 17 +++++++++++++++++ .../manager/client/api/service/InlongStreamApi.java | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/InlongStreamClient.java b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/InlongStreamClient.java index 8085362d41..b8697048e8 100644 --- a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/InlongStreamClient.java +++ b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/inner/client/InlongStreamClient.java @@ -107,6 +107,23 @@ public class InlongStreamClient { } } + /** + * Get inlong stream brief info by the given groupId and streamId. + */ + public InlongStreamBriefInfo getStreamBriefInfo(String groupId, String streamId) { + Response<InlongStreamBriefInfo> response = + ClientUtils.executeHttpCall(inlongStreamApi.getStreamBriefInfo(groupId, streamId)); + + if (response.isSuccess()) { + return response.getData(); + } + if (response.getErrMsg().contains("not exist")) { + return null; + } else { + throw new RuntimeException(response.getErrMsg()); + } + } + /** * Get inlong stream by the given inlong group id and stream id. * diff --git a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/service/InlongStreamApi.java b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/service/InlongStreamApi.java index fc3f4a2fe8..e42e940d3e 100644 --- a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/service/InlongStreamApi.java +++ b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/service/InlongStreamApi.java @@ -51,6 +51,10 @@ public interface InlongStreamApi { Call<Response<InlongStreamInfo>> getStream(@Query("groupId") String groupId, @Query("streamId") String streamId); + @GET("/stream/getBrieft") + Call<Response<InlongStreamBriefInfo>> getStreamBriefInfo(@Query("groupId") String groupId, + @Query("streamId") String streamId); + @POST("stream/list") Call<Response<PageResult<InlongStreamBriefInfo>>> listByCondition(@Body InlongStreamPageRequest request);