APIs

Rest

Please see the REST API section for more details.
1
import requests
2
import json
3
4
# Variables
5
owl = 'https://<ip_address>' #Edit
6
user = '<user>' #Edit
7
password = '<password>' #Edit
8
tenant = 'public' #Edit
9
dataset = '<your_dataset_name>' #Edit
10
runDate = '2021-08-08' #Edit
11
agentName = 'your_agent_name' #Edit
12
13
# Authenticate
14
url = owl+'/auth/signin'
15
payload = json.dumps({"username": user, "password": password, "iss": tenant })
16
headers = {'Content-Type': 'application/json'}
17
response = requests.request("POST", url, headers=headers, data=payload, verify=False)
18
owl_header = {'Authorization': 'Bearer ' + response.json()['token']}
19
20
# Run
21
response = requests.post(url = owl + '/v3/jobs/run?agentName='+agentName+'&dataset='+dataset+'&runDate='+runDate, headers=owl_header, verify=False)
22
jobId = str(response.json()['jobId'])
23
24
# Wait
25
time.sleep(100)
26
27
# Results
28
response = requests.get(url = owl + '/v3/jobs/'+jobId+'/findings', headers=owl_header, verify=False)
29
Copied!

Notebook

Please see the Databricks example for more information
1
val dataset = "cdq_notebook"
2
var date = "2018-01-11"
3
4
// Options
5
val opt = new OwlOptions()
6
opt.dataset = dataset
7
opt.runId = date
8
opt.host = pgHost
9
opt.port = pgPort
10
opt.pgUser = pgUser
11
opt.pgPassword = pgPass
12
13
// Pre Routine
14
val cdq = com.owl.core.util.OwlUtils.OwlContext(df, opt)
15
.register(opt)
16
17
// Scan
18
cdq.owlCheck()
19
val results = cdq.hoot()
Copied!
Copy link
Edit on GitHub
Contents
Rest
Notebook