Hi All,
I want to execute a job I created by rest api. But so far I am not able to do so. Please find the details below
-
I created a job using rest api without executing it:
curl -X POST "https://knime.server.com/knime/rest/v4/repository/Project1/Test/simple_restapi:jobs?timeout=-1&asyncLoading=true" -u user:pass -H "Content-Type: application/json"
Received the folowing output:
{
"@controls" : {
"self" : {
"href" : "https://knime.server.com/knime/rest/v4/jobs/2359c356-bfc5-48c0-84b9-0fc0116bdc38",
"method" : "GET"
},
"collection" : {
"href" : "https://knime.server.com/knime/rest/v4/repository/Project1/Test/simple_restapi:jobs",
"method" : "GET"
},
"edit" : {
"href" : "https://knime.server.com/knime/rest/v4/jobs/2359c356-bfc5-48c0-84b9-0fc0116bdc38",
"encoding" : "Json",
"method" : "PUT"
},
"knime:delete" : {
"href" : "https://knime.server.com/knime/rest/v4/jobs/2359c356-bfc5-48c0-84b9-0fc0116bdc38",
"method" : "DELETE"
},
"knime:workflow" : {
"href" : "https://knime.server.com/knime/rest/v4/repository/Project1/Test/simple_restapi",
"method" : "GET"
},
"knime:upload" : {
"href" : "https://knime.server.com/knime/rest/v4/repository/{path}:data?from-job=2359c356-bfc5-48c0-84b9-0fc0116bdc38",
"method" : "PUT",
"isHrefTemplate" : true
},
"knime:swap" : {
"href" : "https://knime.server.com/knime/rest/v4/jobs/2359c356-bfc5-48c0-84b9-0fc0116bdc38/swap",
"method" : "PUT",
"isHrefTemplate" : true
},
"knime:workflow-summary" : {
"href" : "https://knime.server.com/knime/rest/v4/jobs/2359c356-bfc5-48c0-84b9-0fc0116bdc38/workflow-summary{?format,includeExecutionInfo}",
"method" : "GET",
"output" : [ "application/json", "application/xml" ],
"isHrefTemplate" : true
}
},
"id" : "2359c356-bfc5-48c0-84b9-0fc0116bdc38",
"discardAfterSuccessfulExec" : false,
"discardAfterFailedExec" : false,
"configuration" : {
"knime.cred.knime.system.default" : {
"login" : "user",
"password" : "*************"
}
},
"executorID" : "<unknown>",
"createdVia" : "generic client",
"state" : "LOADING",
"name" : "simple_restapi 2021-04-07 17.08.12",
"properties" : {
"com.knime.enterprise.server.executor.requirements" : "",
"com.knime.enterprise.server.jobpool.size" : "0"
},
"owner" : "user",
"notifications" : { },
"workflow" : "/Project1/Test/simple_restapi",
"hasReport" : false,
"isSwapped" : false,
"createdAt" : "2021-04-07T17:08:12.820+02:00[Europe/Berlin]",
"isOutdated" : false,
"@namespaces" : {
"knime" : {
"name" : "http://www.knime.com/server/rels#"
}
}
}
- After I used the following rest api call to execute the workflow:
curl -X POST "https://knime.zf-world.com/knime/rest/v4/jobs/a02117cb-6c23-4c09-aeac-c096610512b7?async=false" -u user:pass
But did not receive any results back. I checked the job created in the AP, but it is not executed.
When I execute it in the Swagger UI I am getting 415 error.
What am I doing wrong here?
Regards,
Nithin