You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2020/03/10 20:19:52 UTC

[GitHub] [drill] paul-rogers commented on a change in pull request #1892: DRILL-7437: Storage Plugin for Generic HTTP REST API

paul-rogers commented on a change in pull request #1892: DRILL-7437: Storage Plugin for Generic HTTP REST API
URL: https://github.com/apache/drill/pull/1892#discussion_r390531073
 
 

 ##########
 File path: contrib/storage-http/README.md
 ##########
 @@ -0,0 +1,218 @@
+
+# Generic REST API Storage Plugin
+This plugin is intended to enable you to query APIs over HTTP/REST. At this point, the API reader will only accept JSON as input however in the future, it may be possible to
+ add additional format readers to allow for APIs which return XML, CSV or other formats.  
+ 
+Note:  This plugin should **NOT** be used for interacting with tools which have REST APIs such as Splunk or Solr. It will not be performant for those use cases.  
+
+## Configuration
+To configure the plugin, create a new storage plugin, and add the following configuration options which apply to ALL connections defined in this plugin:
+
+```json
+{
+  "type": "http",
+  "connection": "https://<your url here>/",
+  "cacheResults": true,
+  "timeout": 0,
+  "enabled": true
+}
+```
+The options are:
+* `type`:  This should be `http`
+* `cacheResults`:  Enable caching of the HTTP responses
+* `timeout`:  Sets the response timeout in seconds. Defaults to `0` which is no timeout. 
+
+### Configuring the API Connections
+The HTTP Storage plugin allows you to configure multiple APIS which you can query directly from this plugin. To do so, first add a `connections` parameter to the configuration
+. Next give the connection a name, which will be used in queries.  For instance `stockAPI` or `jira`.
+
+The `connection` can accept the following options:
+* `url`: The base URL which Drill will query. You should include the ending slash if there are additional arguments which you are passing.
+* `method`: The request method. Must be `get` or `post`. Other methods are not allowed and will default to `GET`.  
+* `headers`: Often APIs will require custom headers as part of the authentication. This field allows you to define key/value pairs which are submitted with the http request
+.  The format is:
+```json
+headers: {
+   "key1":, "Value1",
+   "key2", "Value2"
 
 Review comment:
   Nit: Json typo: colon after the second key, no comma after the colon in the first key.

----------------------------------------------------------------
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