Click HERE to see how Saviynt Intelligence is transforming the industry. |
04/18/2024 04:39 AM - edited 04/18/2024 05:31 AM
Hello World,
So I was trying to create a newly fresh Job trigger in "Job Control Panel" and running it through Saviynt API,
But the API is not creating a Job "properly", by properly I meant,
Through API it is creating a Job but it is not able to fetch "connection" details even though I have given it.
Maybe either I am giving it the incorrect Request body or maybe saviynt is not able to fetch the "connection" details.
I am using Saviynt v23.5 and this documentation for API :
https://documenter.getpostman.com/view/20697337/2s93eZyBVM#intro
these are the list of API that I tried to create a Job :
Till now only "/runJobTrigger" has been the working one, other APIs are either giving "401 Unauthorized" or "405 Method not allowed" error even though I have given correct method and bearer token.
This is the body that I am giving in RequestBody for "/runJobTrigger" :
{
"valueMap":{
"CONNECTION":"connection_name",
"connectiontype":"DB",
"connectionid":35
},
"createJobIfDoesNotExist": "true",
"name":"test2",
"group":"GRAILS_JOBS",
"jobName":"AccountsImportFullJob",
"jobGroup":"DATABASE",
"cronExp":"0 15 10 * * ? 2099"
}
and output is :
{
"msg": "Starting Job",
"errorCode": "0",
"timestamp": "2024-04-18 11:11:24"
}
On UI this is the output :
and the logs are these :
{"log":"2024-04-18 11:24:29,212 [quartzScheduler_Worker-8] DEBUG jobs.AccountsImportFullJob - AccountsImportFullJob.execute - map : [org.grails.plugins.quartz.grailsJobName:AccountsImportFullJob, tabDetail:null, fireInstanceId:NON_CLUSTERED1713024973859, jobnamelabel:Accounts Import (Complete) from Database (AccountsImportFullJob), TABLENAME:ACCOUNTS, lastJobId:23894, updateUser:L200Trainee, jobtriggername:test2, fullorincremental:full]\n","stream":"stdout","time":"2024-04-18T11:24:29.212600507Z"}
Just to confirm if I am passing the correct Json RequestBody and correct parameters,
I tested it in 2 ways :
and the outcomes are :
Payload :-
Logs of a Successful Import job :-
{"log":"2024-04-18 11:18:10,072 [quartzScheduler_Worker-10] DEBUG jobs.AccountsImportFullJob - AccountsImportFullJob.execute - map : [org.grails.plugins.quartz.grailsJobName:AccountsImportFullJob, tabDetail:cronexpression::0 15 10 * * ? 2099, CONNECTION:connection_name, fireInstanceId:NON_CLUSTERED1713024973858, cronexpression:0 15 10 * * ? 2099, securitySystemKeysInTrigger:, jobnamelabel:Accounts Import (Complete) from Database (AccountsImportFullJob), TABLENAME:ACCOUNTS, lastJobId:23893, updateUser:L200Trainee, jobtriggername:DBImport, fullorincremental:full]\n","stream":"stdout","time":"2024-04-18T11:18:10.072389763Z"}
Please tell me if I need to change/Add any parameter in API RequestBody or is this a Saviynt Bug or Saviynt Does not allow us to create a Job using API ?
Solved! Go to Solution.
04/18/2024 07:59 PM
I have created using api and it works as expected
[
{
"triggers":[
{
"valueMap":{
"CONNECTION":"Saviynt",
"connectiontype":"DB",
"connectionid":6
},
"name": "rushiapi1",
"group": "GRAILS_JOBS",
"jobName": "AccountsImportFullJob",
"jobGroup": "DATABASE",
"cronExp": "0 33 14 * * ? 2060"
}
]
}
]a
04/19/2024 04:52 PM
Thank @rushikeshvartak , It worked, actually I was missing the authorization paramter to give in headers, I know such a silly mistake!