File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
src/main/kotlin/com/delphix/yamlparser/sdk/repos Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,26 @@ class Job (
1313) {
1414 val resource: String = " /resources/json/delphix/job"
1515
16+ fun list (): List <JobObj > {
17+ var jobs = mutableListOf<JobObj >()
18+ val response = http.handleGet(" $resource " ).getJSONArray(" result" )
19+ for (i in 0 until response.length()) {
20+ val job = response.getJSONObject(i);
21+ jobs.add(JobObj .fromJson(job))
22+ }
23+ return jobs
24+ }
25+
26+ fun getWhereRunning (): List <JobObj > {
27+ var jobs = mutableListOf<JobObj >()
28+ val response = http.handleGet(" $resource ?jobState=RUNNING" ).getJSONArray(" result" )
29+ for (i in 0 until response.length()) {
30+ val job = response.getJSONObject(i);
31+ jobs.add(JobObj .fromJson(job))
32+ }
33+ return jobs
34+ }
35+
1636 fun get (ref : String ): JobObj {
1737 val response = http.handleGet(" $resource /$ref " )
1838 val job = JobObj .fromJson(response.getJSONObject(" result" ))
You can’t perform that action at this time.
0 commit comments