falcon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pall...@apache.org
Subject falcon git commit: FALCON-2266 extension APIs added to server
Date Wed, 01 Feb 2017 09:30:20 GMT
Repository: falcon
Updated Branches:
  refs/heads/master ed2f3fb86 -> 29cbcd79b


FALCON-2266 extension APIs added to server

Author: Pracheer Agarwal <pracheer.agarwal@inmobi.com>
Author: Pracheer Agarwal <pracheeragarwal@gmail.com>
Author: Pracheer Agarwal <pr@im2216-x0.corp.inmobi.com>

Reviewers: @sandeepSamudrala, @pallavi-rao

Closes #350 from PracheerAgarwal/FALCON-2266 and squashes the following commits:

ce17388 [Pracheer Agarwal] FALCON-2266 extension APIs added to server
9ff05df [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
9c2f0a5 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
9cd8c17 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
778c579 [Pracheer Agarwal] Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
e39808d [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
a932633 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
fda3b28 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
a93d71a [Pracheer Agarwal] Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
e3728d5 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
066c8e2 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
b20f044 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
7f572a1 [Pracheer Agarwal] Merge branch 'master' of https://github.com/apache/falcon
46042fd [Pracheer Agarwal] Merge branch 'master' of https://github.com/PracheerAgarwal/falcon
daa3ffc [Pracheer Agarwal] FALCON-2225 extension owner added for trusted extensions
622cae4 [Pracheer Agarwal] FALCON-2225 extension owner added for trusted extensions


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

Branch: refs/heads/master
Commit: 29cbcd79b354a0672421073db4feefc5ee73da38
Parents: ed2f3fb
Author: Pracheer Agarwal <pracheer.agarwal@inmobi.com>
Authored: Wed Feb 1 15:00:08 2017 +0530
Committer: Pallavi Rao <pallavi.rao@inmobi.com>
Committed: Wed Feb 1 15:00:08 2017 +0530

----------------------------------------------------------------------
 .../falcon/resource/ExtensionManager.java       | 109 +++++++++++++++++--
 1 file changed, 100 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/falcon/blob/29cbcd79/webapp/src/main/java/org/apache/falcon/resource/ExtensionManager.java
----------------------------------------------------------------------
diff --git a/webapp/src/main/java/org/apache/falcon/resource/ExtensionManager.java b/webapp/src/main/java/org/apache/falcon/resource/ExtensionManager.java
index b1ab513..9534d44 100644
--- a/webapp/src/main/java/org/apache/falcon/resource/ExtensionManager.java
+++ b/webapp/src/main/java/org/apache/falcon/resource/ExtensionManager.java
@@ -44,9 +44,10 @@ import java.util.List;
 public class ExtensionManager extends AbstractExtensionManager {
     private static final Logger LOG = LoggerFactory.getLogger(ExtensionManager.class);
 
+    //SUSPEND CHECKSTYLE CHECK ParameterNumberCheck
     @GET
     @Path("enumerate")
-    @Produces({MediaType.APPLICATION_JSON})
+    @Produces({MediaType.TEXT_PLAIN, MediaType.TEXT_XML})
     public APIResult getExtensions() {
         LOG.error("Enumerate is not supported on Server.Please run your operation on Prism
");
         throw FalconWebException.newAPIException("Enumerate is not supported on Server. Please
run your operation "
@@ -79,8 +80,8 @@ public class ExtensionManager extends AbstractExtensionManager {
             @FormDataParam("feeds") List<FormDataBodyPart> feedForms,
             @FormDataParam("config") InputStream config) {
         LOG.error("submit is not supported on Server.Please run your operation on Prism ");
-        throw FalconWebException.newAPIException("submit is not supported on Server. Please
run your operation "
-                + "on Prism.");
+        throw FalconWebException.newAPIException("submit is not supported on Server. "
+                + "Please run your operation on Prism.");
     }
 
     @POST
@@ -101,8 +102,39 @@ public class ExtensionManager extends AbstractExtensionManager {
     }
 
     @GET
+    @Path("list/{extension-name}")
+    @Produces({MediaType.TEXT_XML, MediaType.APPLICATION_JSON})
+    public ExtensionJobList getExtensionJobs(
+            @PathParam("extension-name") String extensionName,
+            @DefaultValue(ASCENDING_SORT_ORDER) @QueryParam("sortOrder") String sortOrder,
+            @DefaultValue("") @QueryParam("doAs") String doAsUser) {
+        LOG.error("list jobs is not supported on Server.Please run your operation on Prism
");
+        throw FalconWebException.newAPIException("list jobs is not supported on Server. Please
run your "
+                + "operation on Prism.");
+    }
+
+    @GET
+    @Path("instances/{job-name}")
+    @Produces(MediaType.APPLICATION_JSON)
+    public ExtensionInstanceList getInstances(
+            @PathParam("job-name") final String jobName,
+            @QueryParam("start") final String nominalStart,
+            @QueryParam("end") final String nominalEnd,
+            @DefaultValue("") @QueryParam("instanceStatus") String instanceStatus,
+            @DefaultValue("") @QueryParam("fields") String fields,
+            @DefaultValue("") @QueryParam("orderBy") String orderBy,
+            @DefaultValue("") @QueryParam("sortOrder") String sortOrder,
+            @DefaultValue("0") @QueryParam("offset") final Integer offset,
+            @QueryParam("numResults") Integer resultsPerPage,
+            @DefaultValue("") @QueryParam("doAs") String doAsUser) {
+        LOG.error("instances is not supported on Server.Please run your operation on Prism
");
+        throw FalconWebException.newAPIException("instances is not supported on Server. Please
run your "
+                + "operation on Prism.");
+    }
+
+    @GET
     @Path("describe/{extension-name}")
-    @Produces(MediaType.TEXT_PLAIN)
+    @Produces({MediaType.TEXT_PLAIN, MediaType.TEXT_XML})
     public APIResult getExtensionDescription(
             @PathParam("extension-name") String extensionName) {
         LOG.error("Describe is not supported on Server.Please run your operation on Prism
");
@@ -112,7 +144,7 @@ public class ExtensionManager extends AbstractExtensionManager {
 
     @GET
     @Path("detail/{extension-name}")
-    @Produces({MediaType.APPLICATION_JSON})
+    @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_XML, MediaType.TEXT_PLAIN})
     public APIResult getDetail(@PathParam("extension-name") String extensionName) {
         LOG.error("Detail is not supported on Server.Please run your operation on Prism ");
         throw FalconWebException.newAPIException("Detail is not supported on Server. Please
run your operation "
@@ -122,7 +154,7 @@ public class ExtensionManager extends AbstractExtensionManager {
     @POST
     @Path("unregister/{extension-name}")
     @Consumes({MediaType.TEXT_XML, MediaType.TEXT_PLAIN})
-    @Produces(MediaType.TEXT_PLAIN)
+    @Produces({MediaType.TEXT_PLAIN, MediaType.TEXT_XML})
     public APIResult deleteExtensionMetadata(
             @PathParam("extension-name") String extensionName) {
         LOG.error("Unregister is not supported on Server.Please run your operation on Prism
");
@@ -131,6 +163,54 @@ public class ExtensionManager extends AbstractExtensionManager {
     }
 
     @POST
+    @Path("delete/{job-name}")
+    @Consumes({MediaType.TEXT_XML, MediaType.TEXT_PLAIN})
+    @Produces({MediaType.TEXT_XML, MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
+    public APIResult delete(@PathParam("job-name") String jobName,
+                            @Context HttpServletRequest request,
+                            @DefaultValue("") @QueryParam("doAs") String doAsUser) {
+        LOG.error("delete is not supported on Server.Please run your operation on Prism ");
+        throw FalconWebException.newAPIException("delete is not supported on Server. Please
run your operation "
+                + "on Prism.");
+    }
+
+    @POST
+    @Path("update/{job-name}")
+    @Consumes({MediaType.TEXT_XML, MediaType.TEXT_PLAIN, MediaType.MULTIPART_FORM_DATA})
+    @Produces({MediaType.TEXT_XML, MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
+    public APIResult update(
+            @PathParam("job-name") String jobName,
+            @Context HttpServletRequest request,
+            @DefaultValue("") @QueryParam("doAs") String doAsUser,
+            @FormDataParam("processes") List<FormDataBodyPart> processForms,
+            @FormDataParam("feeds") List<FormDataBodyPart> feedForms,
+            @FormDataParam("config") InputStream config) {
+        LOG.error("update is not supported on Server.Please run your operation on Prism ");
+        throw FalconWebException.newAPIException("update is not supported on Server. Please
run your operation "
+                + "on Prism.");
+    }
+
+    @GET
+    @Path("extensionJobDetails/{job-name}")
+    @Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_XML, MediaType.TEXT_PLAIN})
+    public APIResult getExtensionJobDetail(@PathParam("job-name") String jobName) {
+        LOG.error("extensionJobDetails is not supported on Server.Please run your operation
on Prism ");
+        throw FalconWebException.newAPIException("extensionJobDetails is not supported on
Server. "
+                + "Please run your operation on Prism.");
+    }
+
+    @POST
+    @Path("register/{extension-name}")
+    @Consumes({MediaType.TEXT_XML, MediaType.TEXT_PLAIN})
+    @Produces({MediaType.TEXT_PLAIN, MediaType.TEXT_XML})
+    public APIResult registerExtensionMetadata(
+            @PathParam("extension-name") String extensionName) {
+        LOG.error("Register is not supported on Server.Please run your operation on Prism
");
+        throw FalconWebException.newAPIException("Register is not supported on Server. Please
run your operation "
+                + "on Prism.");
+    }
+
+    @POST
     @Path("suspend/{job-name}")
     @Consumes({MediaType.TEXT_XML, MediaType.TEXT_PLAIN})
     @Produces({MediaType.TEXT_XML, MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
@@ -152,9 +232,20 @@ public class ExtensionManager extends AbstractExtensionManager {
                 + "Please run your operation on Prism.");
     }
 
+    @POST
+    @Path("validate/{extension-name}")
+    @Consumes({MediaType.TEXT_XML, MediaType.TEXT_PLAIN})
+    @Produces({MediaType.TEXT_XML, MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
+    public APIResult validate(@PathParam("extension-name") String extensionName, @Context
HttpServletRequest request,
+                              @DefaultValue("") @QueryParam("doAs") String doAsUser) {
+        LOG.error("Validate extension is not supported on Server.Please run your operation
on Prism ");
+        throw FalconWebException.newAPIException("Validate extension is not supported on
Server."
+                + "Please run your operation on Prism.");
+    }
+
     @GET
     @Path("definition/{extension-name}")
-    @Produces({MediaType.APPLICATION_JSON})
+    @Produces({MediaType.TEXT_PLAIN, MediaType.TEXT_XML})
     public APIResult getExtensionDefinition(
             @PathParam("extension-name") String extensionName) {
         LOG.error("Definition is not supported on Server. Please run your operation on Prism
");
@@ -165,7 +256,7 @@ public class ExtensionManager extends AbstractExtensionManager {
     @GET
     @Path("enable/{extension-name}")
     @Consumes({MediaType.TEXT_XML, MediaType.TEXT_PLAIN})
-    @Produces(MediaType.TEXT_PLAIN)
+    @Produces({MediaType.TEXT_PLAIN, MediaType.TEXT_XML})
     public APIResult enableExtension(
             @PathParam("extension-name") String extensionName) {
         LOG.error("Enable extension is not supported on Server. Please run your operation
on Prism ");
@@ -176,7 +267,7 @@ public class ExtensionManager extends AbstractExtensionManager {
     @GET
     @Path("disable/{extension-name}")
     @Consumes({MediaType.TEXT_XML, MediaType.TEXT_PLAIN})
-    @Produces(MediaType.TEXT_PLAIN)
+    @Produces({MediaType.TEXT_PLAIN, MediaType.TEXT_XML})
     public APIResult disableExtension(
             @PathParam("extension-name") String extensionName) {
         LOG.error("Disable extension is not supported on Server. Please run your operation
on Prism ");


Mime
View raw message