Data as a service using pivotal HAWQ - json

We have a requirement,where we need to provide data of HAWQ as a restful API to many consumers such as mobile app, web app etc in JSON format with web service security ;basically Data as a service to different applications from data lake.
Can you please help us with detail architecture or some pointers on the same. We are using Pivotal HD 3.0

I would say you could use any application to develop your webservices (ie: spring) and connect to HAWQ via the JDBC driver to query the data and then reformat it to JSON within your webservice.

Related

How to create Flutter chat app with PHP Mysql rest api?

I want to create a chat app in Flutter but all chat data need to store on my server Mysql via PHP API as backend. (I do not want Firebase Firestore or Realtime database)
As many people create chat app on the web via the help of JavaScript, jQuery & Ajax but I don't know how I will use this on Flutter.
You can create your database with MySQL, and your backend API with php. For the backend you can use SLIM or Laravel or any other php framework. Then in your flutter code you will need to make http requests to this API.
A problem that you can face is Realtime because streams in flutter do not make the data retrieval realtime from a php API. To solve this you will need to add a timer that periodically refreshes the chat. A better solution is to use sockets to make the chat realtime. You can also use firebase cloud messaging for notifications which is free of charge.
This might be useful for you:
https://www.youtube.com/watch?v=6vOIk2-WoxQ&list=PL_5DleQzXnX4GRhKef32CiSs2oBfTVxe3

Link a website (kraken.com) using API on Android Studio

I was wondering how I could link my application to kraken.com server.
For example, making a login activity that sends the username and password to the server and if it's correct, open another activity.
The kraken's API is given by the following link: https://www.kraken.com/help/api
The problem is that I don't know how this API exactly works. How can I make HTTP Request and what is json? Consider I'm new in this area (API).
So firstly, JSON stand for Javascript Object Notation, it's a syntax for exchanging or storing data.
I'm assuming you're using Java since you're using Android Studio.
Looking at Kraken's API page: https://www.kraken.com/help/api#example-api-code
They don't currently have support a 3rd party Java Library for API access. So you would be looking a using a RESTful approach.
Here is an example of how to use that approach in Java: https://www.mkyong.com/webservices/jax-rs/restfull-java-client-with-java-net-url/

AAD Authentication with JSON WebAPI consumed by Power BI

I've written my own web service in ASP.NET Core 2 that authenticates against AzureAD and provides a JSON endpoint which I'm trying to consume in Power BI. When I set authentication to Organizational Account and click sign in, I get the following error:
We were unable to connect because this credential type isn’t supported
for this resource. Please choose another credential type.
Is there something I need to change in my service so that it will work correctly with Power BI?
According to this, AAD auth is not supported:
I am afraid that the AAD authentication type is not supported in Power BI Desktop, please vote up the following ideas.
https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/31405525-support-azure-active-dir...
https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/15039609-active-directory-authent...
Regards,
Lydia
I ended up using auth tokens to get around this unfortunate limitation.

Transform service types when using Bluemix Cloud Integration Service

I have been doing some research about the IBM Bluemix Cloud Integration Service and found the following links:
ftp://public.dhe.ibm.com/cloud/bluemix/cloudintegration/Cloud_Integration_for_Bluemix_User_Guide.pdf
https://www.ng.bluemix.net/docs/services/CloudIntegration/index.html
From what I have read, I have not been able to understand whether it is able to run some kind of "protocol transformation" or if it just publishes a REST or SOAP API.
I mean, imagine for example that I have a full backend publishing everything as SOAP services, but for some reason my apps only can get information through REST APIs. Does the basic connector o maybe the standard one make that kind of integration? Or do I need to put a third party product (or maybe even DataPower) to make that transformation?
Using the Cloud Integration service you can also create a REST API that links to an existing on-premises API (both SOAP and REST). Please take a look here: Creating a REST API that links to an existing on-premises API. You can upload a file that defines the on-premises API (WSDL or Swagger definition).
Please note that currently Cloud Integration cannot retrieve automatically that definition from your on-premises system. It has to be uploaded manually by the user.

Calling R as a web service with parameters and load a JSON?

I am pretty new with R. What I am trying to do is to be able to load a URL from another application (Java) which will run an R script and output a JSON so my application can work with it.
I understand there are some frameworks like shiny which act as web servers for R, but I can't find documentation on those frameworks on how to pass parameters via the URL so R can use them.
Ideally I will need to call a URL like:
http://127.0.0.1/R/param1/param2
And that URL will call an R script which will use param1 and param2 to perform some functions and return a JSON which I will then read from my app.
If you have not done so yet please checkout [DeployR]. You can also post questions to the DeployR Google Group for help.
For full disclose I am one of the authors of DeployR
Overview
DeployR is an integration technology for deploying R analytics inside web, desktop,mobile,and dashboard applications as well as backend systems. DeployR turns your R scripts into analytics web services, so R code can be easily executed by applications running on a secure server.
Using analytics web services, DeployR also solves key integration problems faced by those adopting R-based analytics alongside existing IT infrastructure. These services make it easy for application developers to collaborate with data scientists to integrate R analytics into their applications without any R programming knowledge.
DeployR is available in two editions: DeployR Open and DeployR Enterprise. DeployR Open is a free, open source solution that is ideal for prototyping, building, and deploying non-critical business applications.
DeployR Enterprise scales for business-critical applications and offers support for production-grade workloads, as well as seamless integration with popular enterprise security solutions such as single sign-on (SSO), Lightweight Directory Access Protocol (LDAP), Active Directory, or Pluggable Authentication Modules (PAM).
I am pretty new with R
Prefect. DeployR is intended for both the Data Scientist as well as the application developer who might not know R.
What I am trying to do is to be able to load a URL from another application
(Java) which will run an R script and output a JSON so my application can work with it.
DeployR does this quit well. To aid in the communication between your application
and the DeployR server (that will be executing your R) there are the DeployR Client libraries.
Depending on your needs, DeployR has out-of-the-box 'client library' support in:
Java-client-library: https://github.com/deployr/java-client-library
.NET-client-library: https://github.com/deployr/dotnet-client-library
JavaScript and Node.js-library: https://github.com/deployr/js-client-library
DeployR also supports the RBroker Framework
should your use-case or runtime anticipate a high-volume workload or the need for periodic, scheduled or batch processing.
I understand there are some frameworks like shiny which act as web servers for
R, but I can't find documentation on those frameworks on how to pass parameters
via the URL so R can use them
DeployR acts as your analytics engine through its APIS. Basically think of it as
turning your R scripts into secure analytic web services to be consumed like any
other web service.
Pass parameters
Passing parameters to an R Script in DeployR is easy, however you have to understand that you are passing parameters to an R Script from a language that is not R. As such, there is some 'Data Encoding' that needs to be done. For example, turn your Java String into an R character or your Java boolean to an R logical...
The DeployR Client library or RBroker makes this easy.
It sounds like you are using Java, so first review the Java tutorial java-example-client-basics https://github.com/deployr/java-example-rbroker-basics to give you some context then checkout the many Java examples under java-example-client-data-io https://github.com/deployr/java-example-client-data-io.
The example source is fully available so that should give you everything you need
in order to understand how to do basic I/O from your application to the DeployR server for your R analytics.
Ideally I will need to call a URL like:
http://127.0.0.1/R/param1/param2
I suggest using the DeployR Client libraries for your communication as described above, it does just that.
As always post questions to the DeployR Google Group https://groups.google.com/forum/#!forum/deployr for help.
You have some options to do that, IMHO OpenCPU is a nice one.
It's the simplest open source way to implement a web server to provide R computation as a REST service.
The creator of OpenCPU is the same author of jsonlite package, and you can easily get and pass json parameters with OpenCPU, as you can see here.
Another way to implement REST API web service in R is a plumber package (formerly rapier). It uses function decoration approach within special comments:
# myfile.R
#* #get /mean
normalMean <- function(samples=10){
data <- rnorm(samples)
mean(data)
}
# service.R
library(plumber)
r <- plumb("myfile.R") # Where 'myfile.R' is the location of the file shown above
r$run(port=8000)
Then invoke it:
curl "http://localhost:8000/mean"