[
https://issues.apache.org/jira/browse/DRILL-4580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16529422#comment-16529422
]
ASF GitHub Bot commented on DRILL-4580:
---------------------------------------
asfgit closed pull request #1350: DRILL-4580: Support for exporting storage
plugin configurations
URL: https://github.com/apache/drill/pull/1350
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/StorageResources.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/StorageResources.java
index ca108606ca..b6f839ba8f 100644
---
a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/StorageResources.java
+++
b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/StorageResources.java
@@ -35,6 +35,7 @@
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import javax.xml.bind.annotation.XmlRootElement;
@@ -134,6 +135,15 @@ public JsonResult enablePlugin(@PathParam("name") String
name, @PathParam("val")
}
}
+ @GET
+ @Path("/storage/{name}/export")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response exportPlugin(@PathParam("name") String name) {
+ Response.ResponseBuilder response =
Response.ok(getStoragePluginJSON(name));
+ response.header("Content-Disposition",
String.format("attachment;filename=\"%s.json\"", name));
+ return response.build();
+ }
+
@DELETE
@Path("/storage/{name}.json")
@Produces(MediaType.APPLICATION_JSON)
diff --git a/exec/java-exec/src/main/resources/rest/storage/list.ftl
b/exec/java-exec/src/main/resources/rest/storage/list.ftl
index ca20063835..7dfcf2591a 100644
--- a/exec/java-exec/src/main/resources/rest/storage/list.ftl
+++ b/exec/java-exec/src/main/resources/rest/storage/list.ftl
@@ -38,6 +38,7 @@
<td style="border:none;">
<a class="btn btn-primary"
href="/storage/${plugin.getName()}">Update</a>
<a class="btn btn-default"
onclick="doEnable('${plugin.getName()}', false)">Disable</a>
+ <a class="btn btn-default"
href="/storage/${plugin.getName()}/export"">Export</a>
</td>
</tr>
</#if>
diff --git a/exec/java-exec/src/main/resources/rest/storage/update.ftl
b/exec/java-exec/src/main/resources/rest/storage/update.ftl
index a15cc98652..a30b65ee7e 100644
--- a/exec/java-exec/src/main/resources/rest/storage/update.ftl
+++ b/exec/java-exec/src/main/resources/rest/storage/update.ftl
@@ -48,6 +48,7 @@
<#else>
<a id="enabled" class="btn btn-primary">Enable</a>
</#if>
+ <a class="btn btn-default"
href="/storage/${model.getName()}/export"">Export</a>
<a id="del" class="btn btn-danger" onclick="deleteFunction()">Delete</a>
</#if>
</form>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Provide options to import and export storage plugin configurations
> ------------------------------------------------------------------
>
> Key: DRILL-4580
> URL: https://issues.apache.org/jira/browse/DRILL-4580
> Project: Apache Drill
> Issue Type: Improvement
> Components: Client - HTTP
> Reporter: Abhishek Girish
> Assignee: Abhishek Girish
> Priority: Major
> Labels: ready-to-commit
> Fix For: 1.14.0
>
>
> In a few scenarios, such as upgrading Drill or duplicating an existing Drill
> setup, options from the Drill Web UI to import and export storage plugin
> configurations will be helpful.
> Can support exporting only one storage plugin configuration at a time (into a
> JSON file) or exporting all storage plugin configurations (a compressed dir
> with a JSON file for each plugin). Similarly for importing configurations,
> but with additional options to either overwrite an existing storage plugin
> with the same name or to add a new plugin with an different name).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)