Generate Personal Access Token in your Tableau profile
...
...
Copy your TokenSecret and paste it into a new environment variable called TableauTokenSecret
on Windowson Linux
...
on Linux
run nano .my.cshrc and add variable
Code Block setenv TableauTokenSecret "123456..."
ssh-connect to “analytics” server
run “~analytics/TigerETL3/runEtlShell.sh“
Establish new session to Tableau REST API
Code Block |
---|
import analytics.tiger.agents.TableauRestAPI._
val session = signin("https://tableau.broadinstitute.org/api/3.6","myToken") |
Examples:
lookup extractRefreshId by Workbook name
session.lookupExtractRefreshTaskId("Array QC Tesy Extract With REST_API")
print out first 5 items from extracts-list
session.siteItems("tasks/extractRefreshes", "tasks").take(5).foreach(println)
print out dataAlerts having daily-frequency
Code Block session.siteItems("dataAlerts").filter(it => ((it \ "@frequency").text) == "daily").map(da => (da \ "@subject", da \ "@frequency", da \ "@suspended")).foreach(println)