You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2019/03/15 15:27:44 UTC

[GitHub] [nifi] bbende commented on a change in pull request #3366: NIFI-6112: Add some useful commands to NiFi Toolkit for automating NiFi cluster construction.

bbende commented on a change in pull request #3366: NIFI-6112: Add some useful commands to NiFi Toolkit for automating NiFi cluster construction.
URL: https://github.com/apache/nifi/pull/3366#discussion_r266013297
 
 

 ##########
 File path: nifi-toolkit/nifi-toolkit-cli/src/main/java/org/apache/nifi/toolkit/cli/impl/command/nifi/cs/GetControllerServices.java
 ##########
 @@ -0,0 +1,52 @@
+/*
+ * 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.cs;
+
+import org.apache.commons.cli.MissingOptionException;
+import org.apache.nifi.toolkit.cli.api.CommandException;
+import org.apache.nifi.toolkit.cli.impl.client.nifi.FlowClient;
+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.command.nifi.AbstractNiFiCommand;
+import org.apache.nifi.toolkit.cli.impl.result.ControllerServicesResult;
+import org.apache.nifi.web.api.entity.ControllerServicesEntity;
+
+import java.io.IOException;
+import java.util.Properties;
+
+/**
+ * Command to get the list of controller services for the reporting tasks.
+ */
+public class GetControllerServices extends AbstractNiFiCommand<ControllerServicesResult> {
+
+    public GetControllerServices() {
+        super("get-services", ControllerServicesResult.class);
+    }
+
+    @Override
+    public String getDescription() {
+        return "Retrieves the list of controller services for the reporting tasks.";
+    }
+
+    @Override
+    public ControllerServicesResult doExecute(NiFiClient client, Properties properties)
+            throws NiFiClientException, IOException, MissingOptionException, CommandException {
+        final FlowClient flowClient = client.getFlowClient();
+        final ControllerServicesEntity servicesEntity = flowClient.getControllerServices();
+        return new ControllerServicesResult(getResultType(properties), servicesEntity);
 
 Review comment:
   I realize ControllerServicesResult is an existing class, but we may want to update that to include the service UUID as a column to be consistent with the others

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services