Created
June 10, 2017 11:28
-
-
Save aliostad/0de3467793d26ee6fd0b969c70b4c229 to your computer and use it in GitHub Desktop.
How to get Spark Cluster's external IP for IP whitelisting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val client = new org.apache.http.impl.client.DefaultHttpClient() | |
val request = new org.apache.http.client.methods.HttpGet("http://ipinfo.io") | |
request.addHeader("accept", "application/json") | |
val response = client.execute(request) | |
val handler = new org.apache.http.impl.client.BasicResponseHandler() | |
println(handler.handleResponse(response).trim.toString) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment