[ 
https://issues.apache.org/jira/browse/FLINK-14864?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chesnay Schepler closed FLINK-14864.
------------------------------------
    Resolution: Not A Problem

The program arguments be specified either as a query parameter (programArg, 
program-args) like so: {{/jars/foo/run?programArg=my,arguments}}, or as a JSON 
request as you have been doing.

For legacy reasons, these 2 methods have some differences.

You have been using the latter method, but were referring to the documentation 
for query parameters. The expected JSON body can be shown by clicking on 
"Request" in the 
[documentation|https://ci.apache.org/projects/flink/flink-docs-release-1.8/monitoring/rest_api.html#jars-jarid-run].

> Inconsistent REST Parameter Name: `programArg` vs `programArgs`
> ---------------------------------------------------------------
>
>                 Key: FLINK-14864
>                 URL: https://issues.apache.org/jira/browse/FLINK-14864
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / REST
>    Affects Versions: 1.8.1
>         Environment: Running 1.8.1 on an AWS EMR cluster. Making a POST 
> request with NodeJS (request library).
>            Reporter: Kelly Smith
>            Priority: Trivial
>
> The documentation specifies that you should provide a parameter called 
> `programArg`.
> *Repro*
> Send JSON as a POST body to */jars/:jarid/run* with `programArg` as a 
> parameter
> *Expected*
> Successfully starts the job passing in the values from `programArg`
> *Actual*
> **Returns error:
> ```
> {"errors":["Request did not match expected format JarRunRequestBody."]}
> ```
>  
> Digging into the source code, it appears that _JarRunRequestBody_ expects the 
> field to be plural: `programArgs`
> [https://github.com/apache/flink/blob/master/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/handlers/JarRequestBody.java#L44]
>  
> Changing the name of the parameter to `programArgs` results in the job being 
> successfully submitted with no error.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to