-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added docs and js example for REST API usage #104
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to document, though the example presumes familiarity with what I presume is Node.js.
Line 84 in f2ebf16
// Like: curl -u $auth -F FILE=@/tmp/f $jenkins/job/myjob/buildWithParameters |
Invoke-WebRequest
).
README.md
Outdated
## Usage with REST API | ||
|
||
You can pass file parameters to the REST API: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buildWithParameters
, especially with file uploads, seems to strain the definition of https://en.wikipedia.org/wiki/Representational_state_transfer#Architectural_constraints. https://www.jenkins.io/doc/book/using/remote-access-api/ does refer to a REST-like style though actually this refers to the read-only “export” system https://javadoc.jenkins.io/component/stapler/org/kohsuke/stapler/export/package-summary.html + https://javadoc.jenkins.io/hudson/model/Api.html. Nitpicking but maybe the wording can be relaxed to just say a “remote” or “HTTP” API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can certainly do that. Although since Jenkins itself seems to refer to buildWithParameters
as part of their REST API, it will probably be a good idea to at least have that name in a parenthetical note to help people to land in a successful conclusion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Left some minor suggestions.
Change file parameter name for consistency Co-authored-by: Jesse Glick <[email protected]>
Used a better name for the job URL variable Co-authored-by: Jesse Glick <[email protected]>
Tidy up the code example for bash Co-authored-by: Jesse Glick <[email protected]>
Co-authored-by: Jesse Glick <[email protected]>
Fixes #38.
Created documentation example showing usage for the REST API