kipshi commented on code in PR #3525: URL: https://github.com/apache/incubator-inlong/pull/3525#discussion_r845167539
########## inlong-manager/manager-client-tools/src/main/java/org/apache/inlong/manager/client/cli/CommandDescribe.java: ########## @@ -0,0 +1,127 @@ +/* + * 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.client.cli; + +import com.beust.jcommander.Parameter; +import com.beust.jcommander.Parameters; +import com.github.pagehelper.PageInfo; +import org.apache.inlong.manager.client.api.inner.InnerInlongManagerClient; +import org.apache.inlong.manager.common.pojo.group.InlongGroupListResponse; +import org.apache.inlong.manager.common.pojo.sink.SinkListResponse; +import org.apache.inlong.manager.common.pojo.source.SourceListResponse; +import org.apache.inlong.manager.common.pojo.stream.FullStreamResponse; + +import java.util.List; + +@Parameters(commandDescription = "Display details of one or more resources.") +public class CommandDescribe extends CommandBase { + + public CommandDescribe() { + super("describe"); + jcommander.addCommand("stream", new DescribeStream()); + jcommander.addCommand("group", new DescribeGroup()); + jcommander.addCommand("sink", new DescribeSink()); + jcommander.addCommand("source", new DescribeSource()); + } + + @Parameter() + private java.util.List<String> params; + + @Parameters(commandDescription = "Get stream details") + private class DescribeStream extends CommandUtil { + + @Parameter() + private java.util.List<String> params; + + @Parameter(names = {"-g", "--group"}, required = true, description = "Get stream details by group id.") + private String groupId; + + @Override + void run() { + InnerInlongManagerClient managerClient = connect(); + List<FullStreamResponse> fullStreamResponseList = managerClient.listStreamInfo(groupId); + fullStreamResponseList.forEach(response -> printJson(response.getStreamInfo())); + } + } + + @Parameters(commandDescription = "Get group details") + private class DescribeGroup extends CommandUtil { + + @Parameter() + private java.util.List<String> params; + + @Parameter(names = {"-s", "--status"}, description = "Get group details by status.") + private int status; Review Comment: status must be more abstract, such as INIT, FAIL, rather than int enum -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
