Possible to support /wfapi

Bug #1879629 reported by Xiaopeng Liu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python Jenkins
New
Undecided
Unassigned

Bug Description

##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Feature Idea

##### Jenkinsapi VERSION

##### Jenkins VERSION

##### SUMMARY
As some mentioned in #764, user input is part of the job.
Something I've done to automated Jenkins user input via /wfapi for our slack interaction.
Refer to : http://<jenkins_host>/<job>/<id>/wfapi/

To approve, post to http://<jenkins_host>/<job>/<id>/wfapi/inputSubmit?inputId=<input_id> with payload data if you have more parameters accepts by input, e.g.
```
{'parameter': [
            {
                'name': 'adname',
                'value': ad_account_mapping[d['user']['id']]
            },
            {
                'name': 'approved_by_slack_id',
                'value': d['user']['id']
            },
            {
                'name': 'slack_response_url',
                'value': d['response_url']
            }
            ]}
```

To deny, post to http://<jenkins_host>/<job>/<id>/input/<input_id>/abort

##### EXPECTED RESULTS
<!--- What did you expect to happen when running the steps above? -->
I'd liket to have some function wrapped here, so that I do not need to make a http request every time...

##### ACTUAL RESULTS
<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->

##### USEFUL INFORMATION
<!---
For bugs, show exactly how to reproduce the problem.
For new features, show how the feature would be used.
-->

<!--- Paste example code and full stacktrace below -->
```
headers = {'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8'}
        build_url = approval_result+'wfapi/inputSubmit'
        querystring = {"inputId":"testid"}
        payload = {'json':json.dumps({'parameter': [
            {
                'name': 'p1',
                'value': 'v1'
            },
            {
                'name': 'p2',
                'value': ''v2'
            }
            ]})}
        resp = requests.post(build_url, headers=headers, auth=('jenkins-user', 'jenkins-token'), data=payload, params=querystring)
```

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.