exceptionfactory commented on code in PR #9509: URL: https://github.com/apache/nifi/pull/9509#discussion_r1841513145
########## nifi-toolkit/nifi-toolkit-cli/src/main/java/org/apache/nifi/toolkit/cli/impl/command/nifi/processors/ProcessorStart.java: ########## @@ -0,0 +1,68 @@ +/* + * 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.nifi.toolkit.cli.impl.command.nifi.processors; + +import org.apache.commons.cli.MissingOptionException; +import org.apache.nifi.toolkit.cli.api.CommandException; +import org.apache.nifi.toolkit.cli.api.Context; +import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClient; +import org.apache.nifi.toolkit.cli.impl.client.nifi.NiFiClientException; +import org.apache.nifi.toolkit.cli.impl.client.nifi.ProcessorClient; +import org.apache.nifi.toolkit.cli.impl.command.CommandOption; +import org.apache.nifi.toolkit.cli.impl.command.nifi.AbstractNiFiCommand; +import org.apache.nifi.toolkit.cli.impl.result.nifi.ProcessorResult; +import org.apache.nifi.web.api.entity.ProcessorEntity; + +import java.io.IOException; +import java.util.Properties; + +/** + * Command to start a processor (or execute a run once on a processor) + */ +public class ProcessorStart extends AbstractNiFiCommand<ProcessorResult> { + + public ProcessorStart() { + super("processor-start", ProcessorResult.class); + } + + @Override + public String getDescription() { + return "Starts a processor. Can also be used to execute a Run Once on a processor with the corresponding flag."; + } + + @Override + protected void doInitialize(Context context) { + addOption(CommandOption.PROC_ID.createOption()); + addOption(CommandOption.RUN_ONCE.createOption()); Review Comment: At the risk of having more commands, what do you think about having a separate `run-processor` command, instead of having `RUN_ONCE` as an optional argument to start? It seems like that would align more closely with the REST API behavior. -- 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]
