Five Stars

Talend to execute Rundeck job

I trying to get Talend to execute a Rundeck job but i keep getting an error.  Rundeck needs just a POST url call such as

 

http://rundeckserver.verizon.com:4440/api/1/job/6afe78d2-1e03-4af9-b62c-bd9db324f74b/run?authtoken=eG9DrILU8syDFG0cQTeon52Icbpbvdj2r

 

When i use a tHttpRequest component and issues a post command with the URL i get an error that i cant seem to resolve.

 

Starting job StartRundeckJob at 08:23 06/07/2017.
[statistics] connecting to socket on port 4006
[statistics] connected
415 Unsupported Media Type
[statistics] disconnected
Job StartRundeckJob ended at 08:23 06/07/2017. [exit code=0]

 

Any ideas on this?

1 ACCEPTED SOLUTION

Accepted Solutions
Five Stars

Re: Talend to execute Rundeck job

Actually, this worked.   I found the tRestClient component under the ESB section of TOS DI.   It didnt require any further configuration aside from the URI.   I set the content type drop box to XML and the Accept type box to XML and it worked like a charm.  Thanks for your help.

3 REPLIES
Employee

Re: Talend to execute Rundeck job

Even though it is just a POST URL, it may probably be a REST service that accepts JSON and reply with JSON messages.  If that's the case, you should use the tRestClient component where you can set the accept and response content format, together with headers.

Five Stars

Re: Talend to execute Rundeck job

im using TOS for DI.  Is the tRestClient not part of this version?  Do i need to use the ESB version perhaps?

 

 

I tried the tRest component which does exist and i set the headers as:

"Content-Type"    "application/xml"

I also tried

"Content-Type"    "application/json"

 

Both manage to connect but get back a null in the body and a 415 error.   When i use the firefox webservice plugin to make the same request i am able to look at the raw transaction and it doesnt appear to include in header information, just the URI.   the Rundeck documentation seems to allow for both json and XML.   is my syntax incorrect in my header information maybe?

Five Stars

Re: Talend to execute Rundeck job

Actually, this worked.   I found the tRestClient component under the ESB section of TOS DI.   It didnt require any further configuration aside from the URI.   I set the content type drop box to XML and the Accept type box to XML and it worked like a charm.  Thanks for your help.