falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject falcon git commit: FALCON-1790 CLI support for instance search
Date Thu, 21 Apr 2016 22:06:10 GMT
Repository: falcon
Updated Branches:
  refs/heads/master b34069b7f -> c2a802b40


FALCON-1790 CLI support for instance search

Tested CLI support. Also added documentation for both REST api and CLI.

Author: yzheng-hortonworks <yzheng@hortonworks.com>

Reviewers: "Praveen Adlakha <adlakha.praveen@gmail.com>, Balu Vellanki <balu@apache.org>"

Closes #110 from yzheng-hortonworks/FALCON-1790


Project: http://git-wip-us.apache.org/repos/asf/falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/falcon/commit/c2a802b4
Tree: http://git-wip-us.apache.org/repos/asf/falcon/tree/c2a802b4
Diff: http://git-wip-us.apache.org/repos/asf/falcon/diff/c2a802b4

Branch: refs/heads/master
Commit: c2a802b40efa55441b2be218a6d44c09e5adaa72
Parents: b34069b
Author: yzheng-hortonworks <yzheng@hortonworks.com>
Authored: Thu Apr 21 15:06:05 2016 -0700
Committer: bvellanki <bvellanki@hortonworks.com>
Committed: Thu Apr 21 15:06:05 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/falcon/cli/FalconCLI.java   |  2 +-
 .../org/apache/falcon/cli/FalconEntityCLI.java  | 10 +-
 .../apache/falcon/cli/FalconInstanceCLI.java    | 22 ++++-
 .../org/apache/falcon/FalconCLIConstants.java   |  3 +
 .../org/apache/falcon/client/FalconClient.java  | 23 ++++-
 docs/src/site/twiki/falconcli/FalconCLI.twiki   |  3 +-
 .../site/twiki/falconcli/SearchInstance.twiki   | 17 ++++
 .../src/site/twiki/restapi/InstanceSearch.twiki | 97 ++++++++++++++++++++
 .../java/org/apache/falcon/cli/FalconCLIIT.java |  7 +-
 .../org/apache/falcon/cli/FalconCLISmokeIT.java |  2 +
 10 files changed, 173 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/c2a802b4/cli/src/main/java/org/apache/falcon/cli/FalconCLI.java
----------------------------------------------------------------------
diff --git a/cli/src/main/java/org/apache/falcon/cli/FalconCLI.java b/cli/src/main/java/org/apache/falcon/cli/FalconCLI.java
index c1b9d8c..b6f4290 100644
--- a/cli/src/main/java/org/apache/falcon/cli/FalconCLI.java
+++ b/cli/src/main/java/org/apache/falcon/cli/FalconCLI.java
@@ -98,7 +98,7 @@ public class FalconCLI {
                 "Entity operations like submit, suspend, resume, delete, status, definition,
submitAndSchedule",
                 entityCLI.createEntityOptions(), false);
         parser.addCommand(FalconCLIConstants.INSTANCE_CMD, "",
-                "Process instances operations like running, status, kill, suspend, resume,
rerun, logs",
+                "Process instances operations like running, status, kill, suspend, resume,
rerun, logs, search",
                 instanceCLI.createInstanceOptions(), false);
         parser.addCommand(FalconCLIConstants.METADATA_CMD, "", "Metadata operations like
list, relations",
                 metadataCLI.createMetadataOptions(), true);

http://git-wip-us.apache.org/repos/asf/falcon/blob/c2a802b4/cli/src/main/java/org/apache/falcon/cli/FalconEntityCLI.java
----------------------------------------------------------------------
diff --git a/cli/src/main/java/org/apache/falcon/cli/FalconEntityCLI.java b/cli/src/main/java/org/apache/falcon/cli/FalconEntityCLI.java
index fa71d67..5c3d2a6 100644
--- a/cli/src/main/java/org/apache/falcon/cli/FalconEntityCLI.java
+++ b/cli/src/main/java/org/apache/falcon/cli/FalconEntityCLI.java
@@ -58,8 +58,6 @@ public class FalconEntityCLI extends FalconCLI {
     private static final String FIELDS_OPT = "fields";
     private static final String TAGS_OPT = "tags";
     private static final String NUM_INSTANCES_OPT = "numInstances";
-    private static final String NAMESEQ_OPT = "nameseq";
-    private static final String TAGKEYS_OPT = "tagkeys";
     private static final String SHOWSCHEDULER_OPT = "showScheduler";
 
     public FalconEntityCLI() throws Exception {
@@ -135,8 +133,8 @@ public class FalconEntityCLI extends FalconCLI {
         Option filterBy = new Option(FalconCLIConstants.FILTER_BY_OPT, true,
                 "Filter returned entities by the specified status");
         Option filterTags = new Option(TAGS_OPT, true, "Filter returned entities by the specified
tags");
-        Option nameSubsequence = new Option(NAMESEQ_OPT, true, "Subsequence of entity name");
-        Option tagKeywords = new Option(TAGKEYS_OPT, true, "Keywords in tags");
+        Option nameSubsequence = new Option(FalconCLIConstants.NAMESEQ_OPT, true, "Subsequence
of entity name");
+        Option tagKeywords = new Option(FalconCLIConstants.TAGKEYS_OPT, true, "Keywords in
tags");
         Option orderBy = new Option(FalconCLIConstants.ORDER_BY_OPT, true,
                 "Order returned entities by this field");
         Option sortOrder = new Option(FalconCLIConstants.SORT_ORDER_OPT, true, "asc or desc
order for results");
@@ -203,8 +201,8 @@ public class FalconEntityCLI extends FalconCLI {
         String sortOrder = commandLine.getOptionValue(FalconCLIConstants.SORT_ORDER_OPT);
         String filterBy = commandLine.getOptionValue(FalconCLIConstants.FILTER_BY_OPT);
         String filterTags = commandLine.getOptionValue(TAGS_OPT);
-        String nameSubsequence = commandLine.getOptionValue(NAMESEQ_OPT);
-        String tagKeywords = commandLine.getOptionValue(TAGKEYS_OPT);
+        String nameSubsequence = commandLine.getOptionValue(FalconCLIConstants.NAMESEQ_OPT);
+        String tagKeywords = commandLine.getOptionValue(FalconCLIConstants.TAGKEYS_OPT);
         String fields = commandLine.getOptionValue(FIELDS_OPT);
         String feedInstancePath = commandLine.getOptionValue(PATH_OPT);
         Integer offset = parseIntegerInput(commandLine.getOptionValue(FalconCLIConstants.OFFSET_OPT),
0, "offset");

http://git-wip-us.apache.org/repos/asf/falcon/blob/c2a802b4/cli/src/main/java/org/apache/falcon/cli/FalconInstanceCLI.java
----------------------------------------------------------------------
diff --git a/cli/src/main/java/org/apache/falcon/cli/FalconInstanceCLI.java b/cli/src/main/java/org/apache/falcon/cli/FalconInstanceCLI.java
index afbba12..43482b3 100644
--- a/cli/src/main/java/org/apache/falcon/cli/FalconInstanceCLI.java
+++ b/cli/src/main/java/org/apache/falcon/cli/FalconInstanceCLI.java
@@ -46,6 +46,7 @@ public class FalconInstanceCLI extends FalconCLI {
     private static final String KILL_OPT = "kill";
     private static final String RERUN_OPT = "rerun";
     private static final String LOG_OPT = "logs";
+    private static final String SEARCH_OPT = "search";
     private static final String ALL_ATTEMPTS = "allAttempts";
     private static final String RUNID_OPT = "runid";
     private static final String CLUSTERS_OPT = "clusters";
@@ -93,6 +94,8 @@ public class FalconInstanceCLI extends FalconCLI {
                 "Displays dependent instances for a specified instance.");
         Option triage = new Option(TRIAGE_OPT, false,
                 "Triage a feed or process instance and find the failures in it's lineage.");
+        Option search = new Option(SEARCH_OPT, false,
+                "Search instances with filtering criteria on the entity, instance time and
status.");
 
         OptionGroup group = new OptionGroup();
         group.addOption(running);
@@ -109,6 +112,7 @@ public class FalconInstanceCLI extends FalconCLI {
         group.addOption(listing);
         group.addOption(dependency);
         group.addOption(triage);
+        group.addOption(search);
 
         Option url = new Option(FalconCLIConstants.URL_OPTION, true, "Falcon URL");
         Option start = new Option(FalconCLIConstants.START_OPT, true,
@@ -151,9 +155,10 @@ public class FalconInstanceCLI extends FalconCLI {
         Option doAs = new Option(FalconCLIConstants.DO_AS_OPT, true, "doAs user");
         Option debug = new Option(FalconCLIConstants.DEBUG_OPTION, false, "Use debug mode
to see"
                 + " debugging statements on stdout");
-
         Option instanceTime = new Option(INSTANCE_TIME_OPT, true, "Time for an instance");
-
+        Option instanceStatus = new Option(FalconCLIConstants.INSTANCE_STATUS_OPT, true,
"Instance status");
+        Option nameSubsequence = new Option(FalconCLIConstants.NAMESEQ_OPT, true, "Subsequence
of entity name");
+        Option tagKeywords = new Option(FalconCLIConstants.TAGKEYS_OPT, true, "Keywords in
tags");
         Option allAttempts = new Option(ALL_ATTEMPTS, false, "To get all attempts of corresponding
instances");
 
         instanceOptions.addOption(url);
@@ -177,6 +182,9 @@ public class FalconInstanceCLI extends FalconCLI {
         instanceOptions.addOption(doAs);
         instanceOptions.addOption(debug);
         instanceOptions.addOption(instanceTime);
+        instanceOptions.addOption(instanceStatus);
+        instanceOptions.addOption(nameSubsequence);
+        instanceOptions.addOption(tagKeywords);
         instanceOptions.addOption(allAttempts);
 
         return instanceOptions;
@@ -194,6 +202,9 @@ public class FalconInstanceCLI extends FalconCLI {
         String instanceTime = commandLine.getOptionValue(INSTANCE_TIME_OPT);
         String start = commandLine.getOptionValue(FalconCLIConstants.START_OPT);
         String end = commandLine.getOptionValue(FalconCLIConstants.END_OPT);
+        String status = commandLine.getOptionValue(FalconCLIConstants.INSTANCE_STATUS_OPT);
+        String nameSubsequence = commandLine.getOptionValue(FalconCLIConstants.NAMESEQ_OPT);
+        String tagKeywords = commandLine.getOptionValue(FalconCLIConstants.TAGKEYS_OPT);
         String filePath = commandLine.getOptionValue(FalconCLIConstants.FILE_PATH_OPT);
         String runId = commandLine.getOptionValue(RUNID_OPT);
         String colo = commandLine.getOptionValue(FalconCLIConstants.COLO_OPT);
@@ -211,7 +222,9 @@ public class FalconInstanceCLI extends FalconCLI {
         colo = getColo(colo);
         String instanceAction = "instance";
         validateSortOrder(sortOrder);
-        validateInstanceCommands(optionsList, entity, type, colo);
+        if (!optionsList.contains(SEARCH_OPT)) {
+            validateInstanceCommands(optionsList, entity, type, colo);
+        }
 
         if (optionsList.contains(TRIAGE_OPT)) {
             validateNotEmpty(colo, FalconCLIConstants.COLO_OPT);
@@ -280,6 +293,9 @@ public class FalconInstanceCLI extends FalconCLI {
                     start, colo, lifeCycles, doAsUser));
         } else if (optionsList.contains(LISTING_OPT)) {
             result = ResponseHelper.getString(client.getFeedInstanceListing(type, entity,
start, end, colo, doAsUser));
+        } else if (optionsList.contains(SEARCH_OPT)) {
+            result = ResponseHelper.getString(client.searchInstances(
+                    type, nameSubsequence, tagKeywords, start, end, status, orderBy, offset,
numResults));
         } else {
             throw new FalconCLIException("Invalid command");
         }

http://git-wip-us.apache.org/repos/asf/falcon/blob/c2a802b4/client/src/main/java/org/apache/falcon/FalconCLIConstants.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/FalconCLIConstants.java b/client/src/main/java/org/apache/falcon/FalconCLIConstants.java
index 5f1fb3c..bfa1748 100644
--- a/client/src/main/java/org/apache/falcon/FalconCLIConstants.java
+++ b/client/src/main/java/org/apache/falcon/FalconCLIConstants.java
@@ -52,6 +52,9 @@ public final class FalconCLIConstants {
     public static final String DEPENDENCY_OPT = "dependency";
     public static final String LIST_OPT = "list";
     public static final String SKIPDRYRUN_OPT = "skipDryRun";
+    public static final String INSTANCE_STATUS_OPT = "instanceStatus";
+    public static final String NAMESEQ_OPT = "nameseq";
+    public static final String TAGKEYS_OPT = "tagkeys";
     public static final String FILTER_BY_OPT = "filterBy";
     public static final String ORDER_BY_OPT = "orderBy";
     public static final String SORT_ORDER_OPT = "sortOrder";

http://git-wip-us.apache.org/repos/asf/falcon/blob/c2a802b4/client/src/main/java/org/apache/falcon/client/FalconClient.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/falcon/client/FalconClient.java b/client/src/main/java/org/apache/falcon/client/FalconClient.java
index 02908d9..e8ff6f1 100644
--- a/client/src/main/java/org/apache/falcon/client/FalconClient.java
+++ b/client/src/main/java/org/apache/falcon/client/FalconClient.java
@@ -95,6 +95,7 @@ public class FalconClient extends AbstractFalconClient {
     public static final String FORCE = "force";
     public static final String SHOW_SCHEDULER = "showScheduler";
     public static final String ENTITY_NAME = "name";
+    public static final String ENTITY_TYPE = "type";
     public static final String SKIP_DRYRUN = "skipDryRun";
     public static final String FILTER_BY = "filterBy";
     public static final String ORDER_BY = "orderBy";
@@ -104,6 +105,7 @@ public class FalconClient extends AbstractFalconClient {
     public static final String START = "start";
     public static final String END = "end";
     public static final String INSTANCE_TIME = "instanceTime";
+    public static final String INSTANCE_STATUS = "instanceStatus";
     public static final String PROPERTIES = "properties";
     private static final String FIELDS = "fields";
     private static final String NAME_SUBSEQUENCE = "nameseq";
@@ -297,7 +299,8 @@ public class FalconClient extends AbstractFalconClient {
         PARAMS("api/instance/params/", HttpMethod.GET, MediaType.APPLICATION_JSON),
         DEPENDENCY("api/instance/dependencies/", HttpMethod.GET, MediaType.APPLICATION_JSON),
         TRIAGE("api/instance/triage/", HttpMethod.GET, MediaType.APPLICATION_JSON),
-        LISTING("api/instance/listing/", HttpMethod.GET, MediaType.APPLICATION_JSON);
+        LISTING("api/instance/listing/", HttpMethod.GET, MediaType.APPLICATION_JSON),
+        SEARCH("api/instance/search/", HttpMethod.GET, MediaType.APPLICATION_JSON);
 
         private String path;
         private String method;
@@ -560,6 +563,7 @@ public class FalconClient extends AbstractFalconClient {
         return getResponse(InstancesSummaryResult.class, clientResponse);
     }
 
+
     public FeedInstanceResult getFeedListing(String type, String entity, String start,
                                      String end, String colo, String doAsUser) throws FalconCLIException
{
         ClientResponse clientResponse = new ResourceBuilder().path(Instances.KILL.path, type,
entity)
@@ -568,6 +572,23 @@ public class FalconClient extends AbstractFalconClient {
         return getResponse(FeedInstanceResult.class, clientResponse);
     }
 
+    public InstancesResult searchInstances(String type, String nameSubsequence, String tagKeywords,
+                                           String start, String end, String status, String
orderBy,
+                                           Integer offset, Integer numResults) throws FalconCLIException
{
+        ClientResponse clientResponse = new ResourceBuilder().path(Instances.SEARCH.path)
+                .addQueryParam(ENTITY_TYPE, type)
+                .addQueryParam(NAME_SUBSEQUENCE, nameSubsequence)
+                .addQueryParam(TAG_KEYWORDS, tagKeywords)
+                .addQueryParam(START, start)
+                .addQueryParam(END, end)
+                .addQueryParam(INSTANCE_STATUS, status)
+                .addQueryParam(ORDER_BY, orderBy)
+                .addQueryParam(OFFSET, offset)
+                .addQueryParam(NUM_RESULTS, numResults)
+                .call(Instances.SEARCH);
+        return getResponse(InstancesResult.class, clientResponse);
+    }
+
     public InstancesResult killInstances(String type, String entity, String start,
                                 String end, String colo, String clusters,
                                 String sourceClusters, List<LifeCycle> lifeCycles,

http://git-wip-us.apache.org/repos/asf/falcon/blob/c2a802b4/docs/src/site/twiki/falconcli/FalconCLI.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/falconcli/FalconCLI.twiki b/docs/src/site/twiki/falconcli/FalconCLI.twiki
index 0c0082f..2290569 100644
--- a/docs/src/site/twiki/falconcli/FalconCLI.twiki
+++ b/docs/src/site/twiki/falconcli/FalconCLI.twiki
@@ -68,7 +68,8 @@ $FALCON_HOME/bin/falcon entity -submit -type cluster -file /cluster/definition.x
 | [[ContinueInstance][Continue]]                 | Continue the failed workflow instances
         |
 | [[RerunInstance][Rerun]]                       | Rerun instances of specified process 
          |
 | [[ResumeInstance][Resume]]                     | Resume instance of specified process from
suspended state   |
-| [[StatusInstance][Status]]                     | Gets the status of entity            
          |
+| [[SearchInstance][Search]]                     | Search instances                     
          |
+| [[StatusInstance][Status]]                     | Gets the status of instances         
          |
 | [[ListInstance][List]]                         | Gets single or multiple instances    
          |
 | [[SummaryInstance][Summary]]                   | Gets consolidated status of the instances
between the specified time period    |
 | [[RunningInstance][Running]]                   | Gets running instances of the mentioned
process |

http://git-wip-us.apache.org/repos/asf/falcon/blob/c2a802b4/docs/src/site/twiki/falconcli/SearchInstance.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/falconcli/SearchInstance.twiki b/docs/src/site/twiki/falconcli/SearchInstance.twiki
new file mode 100644
index 0000000..35cac74
--- /dev/null
+++ b/docs/src/site/twiki/falconcli/SearchInstance.twiki
@@ -0,0 +1,17 @@
+---+++Search
+
+[[CommonCLI][Common CLI Options]]
+
+Search option via CLI can be used to get instances that meet search criteria, e.g. nominal
time, instance status, entity name subsequence, entity tag, etc.
+Instance name and status are listed in the output. More instance properties will be added
to the output in the future (e.g. log url, running time).
+Example usage include: search of instances of all entities with the same tag; search of all
current running instances.
+
+Usage:
+$FALCON_HOME/bin/falcon instance -search
+
+Optional Args : -type <<[feed|process|datasource],[feed|process|datasource]>>
+-nameseq <<namesubsequence>> -tagkeys <<tagkeyword1,tagkeyword2>>
+-instanceStatus <<status>> -start "yyyy-MM-dd'T'HH:mm'Z'" -end "yyyy-MM-dd'T'HH:mm'Z'"
+-orderBy <<field>> -offset 0 -numResults 10
+
+<a href="../restapi/InstanceSearch.html">Optional params and examples described here.</a>

http://git-wip-us.apache.org/repos/asf/falcon/blob/c2a802b4/docs/src/site/twiki/restapi/InstanceSearch.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/restapi/InstanceSearch.twiki b/docs/src/site/twiki/restapi/InstanceSearch.twiki
new file mode 100644
index 0000000..4744240
--- /dev/null
+++ b/docs/src/site/twiki/restapi/InstanceSearch.twiki
@@ -0,0 +1,97 @@
+---++  GET /api/instance/search
+   * <a href="#Description">Description</a>
+   * <a href="#Parameters">Parameters</a>
+   * <a href="#Results">Results</a>
+   * <a href="#Examples">Examples</a>
+
+---++ Description
+Get the list of instances that meet search criteria.
+
+---++ Parameters
+   * :type <optional param> Comma-separated entity types. Valid entity types are feed,
process or datasource.
+   * nameseq <optional param> Subsequence of entity name. Not case sensitive.
+      * The entity name needs to contain all the characters in the subsequence in the same
order.
+      * Example 1: "sample1" will match the entity named "SampleFeed1-2".
+      * Example 2: "mhs" will match the entity named "New-My-Hourly-Summary".
+   * tagkeys <optional param> Keywords in tags, separated by comma. Not case sensitive.
+      * The returned entities will have tags that match all the tag keywords.
+   * instanceStatus <optional param> Valid options are RUNNING, SUCCEEDED, FAILED,
WAITING, SUSPENDED, KILLED, TIMEOUT.
+   * start <optional param> Show instances from this nominal time. Format: yyyy-MM-dd'T'HH:mm'Z'.
+      * By default, it is set to (end - (10 * entityFrequency)).
+   * end <optional param> Show instances up to this nominal time. Format: yyyy-MM-dd'T'HH:mm'Z'.
+      * Default is set to now.
+   * orderBy <optional param> Field by which results should be ordered. Sorted by descending
order.
+      * If not specified, instances of the same entity will be listed together in the result.
+      * Current valid option: status. Coming soon: sorting by name, nominal time, running
time.
+   * offset <optional param> Show results from the offset, used for pagination. Defaults
to 0.
+   * numResults <optional param> Number of results to show per request, used for pagination.
+      * Only integers > 0 are valid. Default is 10.
+   * doAs <optional query param> allows the current user to impersonate the user passed
in doAs.
+
+---++ Results
+A list of instances.
+
+---++ Examples
+---+++ Rest Call
+<verbatim>
+GET http://localhost:15000/api/instance/search?nameseq=usbill&start=2012-04-03T00:00Z
+</verbatim>
+---+++ Result
+<verbatim>
+{
+    "instances": [
+        {
+	 “name":"SampleUSHealthBill”,
+	 “type":"FEED”,
+	 “tags”: {"tag":["related=ushealthcare","department=billingDepartment"]},
+            “nominalTime": "2012-04-03T07:00Z"
+            "cluster": "primary-cluster",
+            "status": "SUCCEEDED",
+            "logFile": "http:\/\/localhost:11000\/oozie?job=0000070-131021115933395-oozie-rgau-W",
+            "startTime": "2013-10-21T14:39:56-07:00",
+            "endTime": "2013-10-21T14:40:26-07:00",
+        }
+    ],
+    "requestId": "default\/e15bb378-d09f-4911-9df2-5334a45153d2\n",
+    "message": "Instances Search Results",
+    "status": "SUCCEEDED”
+}
+</verbatim>
+
+---+++ Rest Call
+<verbatim>
+GET http://localhost:15000/api/instance/search?nameseq=samplebill&tagkeys=billing,healthcare&start=2012-04-03T00:00Z&instanceStatus=succeeded&orderBy=nominalTime&offset=2&numResults=2
+</verbatim>
+---+++ Result
+<verbatim>
+ {
+    "instances": [
+        {
+	 "name":"SampleHealthBill",
+	 "type":"PROCESS",
+	 "tags”: {"tag":["related=healthcare","department=billingDepartment"]},
+            “nominalTime": "2012-04-03T08:00Z"
+            "cluster": "primary-cluster",
+            "status": "SUCCEEDED",
+            "logFile": "http:\/\/localhost:11000\/oozie?job=0000070-131021115933397-oozie-rgau-W",
+            "startTime": "2013-10-21T14:41:56-07:00",
+            "endTime": "2013-10-21T14:42:26-07:00",
+        },
+        {
+	 "name":"SampleUSHealthBill",
+	 "type":"FEED”,
+	 "tags": {"tag":["related=ushealthcare","department=billingDepartment"]},
+            “nominalTime": "2012-04-03T07:00Z"
+            "cluster": "primary-cluster",
+            "status": "SUCCEEDED",
+            "logFile": "http:\/\/localhost:11000\/oozie?job=0000070-131021115933395-oozie-rgau-W",
+            "startTime": "2013-10-21T14:39:56-07:00",
+            "endTime": "2013-10-21T14:40:26-07:00",
+        },
+    ],
+
+    "requestId": "default\/e15bb378-d09f-4911-9df2-5334a45153d2\n",
+    "message": "Instances Search Results",
+    "status": "SUCCEEDED”
+}
+</verbatim>

http://git-wip-us.apache.org/repos/asf/falcon/blob/c2a802b4/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java b/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java
index 5ce8893..4f72d82 100644
--- a/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java
+++ b/webapp/src/test/java/org/apache/falcon/cli/FalconCLIIT.java
@@ -481,7 +481,7 @@ public class FalconCLIIT {
 
     }
 
-    public void testInstanceRunningAndSummaryCommands() throws Exception {
+    public void testInstanceRunningAndSearchSummaryCommands() throws Exception {
         TestContext context = new TestContext();
         Map<String, String> overlay = context.getUniqueOverlay();
         submitTestFiles(context, overlay);
@@ -495,9 +495,14 @@ public class FalconCLIIT {
         Assert.assertEquals(executeWithURL("instance -status -type feed -name " + overlay.get("outputFeedName")
                 + " -start " + START_INSTANCE), 0);
 
+        Assert.assertEquals(executeWithURL("instance -search"), 0);
+
         Assert.assertEquals(executeWithURL("instance -running -type process -name " + overlay.get("processName")),
0);
 
         //with doAs
+        Assert.assertEquals(executeWithURL(
+                "instance -search -type process -instanceStatus RUNNING -doAs " + FalconTestUtil.TEST_USER_2),
0);
+
         Assert.assertEquals(executeWithURL("instance -running -type process -doAs " + FalconTestUtil.TEST_USER_2
                 + " -name " + overlay.get("processName")), 0);
 

http://git-wip-us.apache.org/repos/asf/falcon/blob/c2a802b4/webapp/src/test/java/org/apache/falcon/cli/FalconCLISmokeIT.java
----------------------------------------------------------------------
diff --git a/webapp/src/test/java/org/apache/falcon/cli/FalconCLISmokeIT.java b/webapp/src/test/java/org/apache/falcon/cli/FalconCLISmokeIT.java
index 8a5c440..2ce1aaf 100644
--- a/webapp/src/test/java/org/apache/falcon/cli/FalconCLISmokeIT.java
+++ b/webapp/src/test/java/org/apache/falcon/cli/FalconCLISmokeIT.java
@@ -100,6 +100,8 @@ public class FalconCLISmokeIT {
         Assert.assertEquals(executeWithURL("instance -status -type feed -name "
                         + overlay.get("outputFeedName") + " -start " + START_INSTANCE), 0);
         Assert.assertEquals(executeWithURL("instance -running -type process -name " + overlay.get("processName")),
0);
+        Assert.assertEquals(executeWithURL("instance -search"), 0);
+        Assert.assertEquals(executeWithURL("instance -search -type process -instanceStatus
RUNNING"), 0);
     }
 
     private int executeWithURL(String command) throws Exception {


Mime
View raw message