Issue in using import jobs api

23 views
Skip to first unread message

Ranjeeth karthik selvan

unread,
Sep 16, 2016, 10:57:51 AM9/16/16
to rundeck-discuss
Hi

I am facing issue in importing the rundeck job via rundeck api java client. Following is the code snippet which I am trying to use

rundeck.importJobs("test.xml", FileType.XML );


It throws the following exception. 


Exception in thread "main" org.rundeck.api.RundeckApiException: Invalid HTTP response 'HTTP/1.1 405 Method Not Allowed' for https://<rundeck-server>/api/9/jobs/import?format=xml

at org.rundeck.api.ApiCall.execute(ApiCall.java:266)

at org.rundeck.api.ApiCall.execute(ApiCall.java:199)

at org.rundeck.api.ApiCall.post(ApiCall.java:168)

at org.rundeck.api.RundeckClient.importJobs(RundeckClient.java:646)

at org.rundeck.api.RundeckClient.importJobs(RundeckClient.java:565)

at org.rundeck.api.RundeckClient.importJobs(RundeckClient.java:520)


I am seeing the following response when I try to access the api(api/9/jobs/import) via browser


HTTP ERROR 405

Problem accessing /grails/scheduledExecution/apiJobsImport.dispatch. Reason:

    METHOD_NOT_ALLOWED


Powered by Jetty://



Rundeck version is 1.6.1

Rundeck api java client - 9.0



Kindly assist in getting this issue resolved


Regards

Ranjeeth


Reply all
Reply to author
Forward
0 new messages