use of org.apache.nifi.toolkit.cli.impl.client.nifi.FlowClient in project nifi by apache.
the class PGStart method doExecute.
@Override
public VoidResult doExecute(final NiFiClient client, final Properties properties) throws NiFiClientException, IOException, MissingOptionException, CommandException {
final String pgId = getRequiredArg(properties, CommandOption.PG_ID);
final ScheduleComponentsEntity entity = new ScheduleComponentsEntity();
entity.setId(pgId);
entity.setState(ScheduleComponentsEntity.STATE_RUNNING);
final FlowClient flowClient = client.getFlowClient();
final ScheduleComponentsEntity resultEntity = flowClient.scheduleProcessGroupComponents(pgId, entity);
return VoidResult.getInstance();
}
use of org.apache.nifi.toolkit.cli.impl.client.nifi.FlowClient in project nifi by apache.
the class PGStop method doExecute.
@Override
public VoidResult doExecute(final NiFiClient client, final Properties properties) throws NiFiClientException, IOException, MissingOptionException {
final String pgId = getRequiredArg(properties, CommandOption.PG_ID);
final ScheduleComponentsEntity entity = new ScheduleComponentsEntity();
entity.setId(pgId);
entity.setState(ScheduleComponentsEntity.STATE_STOPPED);
final FlowClient flowClient = client.getFlowClient();
final ScheduleComponentsEntity resultEntity = flowClient.scheduleProcessGroupComponents(pgId, entity);
return VoidResult.getInstance();
}
Aggregations