-
Notifications
You must be signed in to change notification settings - Fork 96
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
Upstreamize API guide #3212
Upstreamize API guide #3212
Conversation
70d7ab1
to
849002e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Now is the good time to address any changes in the content. Afterwards, I will move the assemblies and modules to |
a916347
to
f8b2dfa
Compare
Rebased. |
f8b2dfa
to
6cda27b
Compare
Dropped fake Hammer URL attribute. |
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.
26/52. Looks good so far; only minor suggestions.
guides/doc-Project_API/topics/con_overview-of-the-project-api.adoc
Outdated
Show resolved
Hide resolved
guides/doc-Project_API/topics/con_project-api-compared-to-hammer-cli.adoc
Outdated
Show resolved
Hide resolved
guides/doc-Project_API/topics/con_project-api-compared-to-hammer-cli.adoc
Outdated
Show resolved
Hide resolved
guides/doc-Project_API/topics/con_project-api-compared-to-hammer-cli.adoc
Outdated
Show resolved
Hide resolved
guides/doc-Project_API/topics/con_ssl-authentication-overview.adoc
Outdated
Show resolved
Hide resolved
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.
some more suggestions. I did not yet test any of the scripts, but I wonder in general: Can we move certain Python/Ruby/Bash scripts from foreman-documentation to foreman/foreman_maintain? I am unsure if it's a good idea to keep that much code in the docs git repo. (not blocking your PR; could be a future RFC/RFE)
51/52 done. API permissions matrix left.
[id="applying-errata-to-a-host-or-host-collection"] | ||
= Applying errata to a host or host collection | ||
|
||
You can use the API to apply errata to a host, host group, or host collection. |
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.
Intro does not match anchor/title/file name.
Maybe a generic title such as "Applying errata to hosts by using {Project} API"?
I also wonder: how should be name these files in general? I assume there's already a file "proc_applying-errata-to-hosts.doc" which houses the WebUI/Hammer CLI procedures.
- What's our (future!) convention with titles/file names/anchors?
- Should we add the API procedure to the "normal"/existing procedure? Aka. is it a good idea to split off procedure by means to interacting with Foreman?
cc @asteflova + @apinnick
FYI: not blocking your PR!
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.
* Should we add the API procedure to the "normal"/existing procedure? Aka. is it a good idea to split off procedure by means to interacting with Foreman?
That's a good point. I can imagine that a more thorough review of how to actually merge the new API modules with the existing guides will be required (what I can't imagine is who would have the capacity for it in the foreseeable future 🙃). For example, some time ago, I used the API guide's overview module and added it (with a few edits) to the Overview guide: https://docs.theforeman.org/nightly/Planning_for_Project/index-katello.html#API-Overview_planning This module will now effectively be duplicated but it works well within the Overview guide. There may be more modules like that that would fit well in the existing guides.
Adding the API procedures from the API guide to appear alongside the CLI and web UI procedures (and also Ansible procedures) seems like a good idea. It would take a lot of effort, though.
guides/doc-Project_API/topics/proc_applying-errata-to-a-host-or-host-collection.adoc
Outdated
Show resolved
Hide resolved
guides/doc-Project_API/topics/proc_applying-errata-to-a-host-or-host-collection.adoc
Outdated
Show resolved
Hide resolved
guides/doc-Project_API/topics/proc_applying-errata-to-a-host-or-host-collection.adoc
Outdated
Show resolved
Hide resolved
guides/doc-Project_API/topics/proc_applying-errata-to-a-host-or-host-collection.adoc
Outdated
Show resolved
Hide resolved
guides/doc-Project_API/topics/proc_using-the-put-http-method.adoc
Outdated
Show resolved
Hide resolved
guides/doc-Project_API/topics/proc_using-the-put-http-method.adoc
Outdated
Show resolved
Hide resolved
Re. API permission matrixWe can use a script similar to this to generate the table: https://github.com/theforeman/foreman-documentation/blob/master/guides/common/modules/proc_creating-a-complete-permission-table.adoc Or we can just link to it or include it instead 👀 cc @maximiliankolb @asteflova |
Small changes only Co-authored-by: Maximilian Kolb <[email protected]>
I fixed some Vale errors. The remaining ones look like false positives to me. Feel free to check. |
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.
31/49
almost all comments are mere suggestions and could also get applied in a follow-up PR
guides/common/modules/proc_uploading-content-to-projectserver.adoc
Outdated
Show resolved
Hide resolved
These API calls require that you pass data in `json` format with the API call. | ||
For more information, see xref:sect-API_Guide-Passing_JSON_Data_with_the_API_Request[]. | ||
|
||
[id="ex-API_Guide-Creating_a_New_User"] |
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.
[id="ex-API_Guide-Creating_a_New_User"] | |
[id="creating-a-user"] |
looking at this anchor, I wonder if it makes sense to prefix all those anchors with either "api-" or "api-example-"; or add a "-through-api" or "-by-using-{project-context}-api" suffix?
I lean towards a short and sweet "api-" prefix similar to CLI procedures. Then, when we eventually move (or not!) those examples to the "creating users" procedure, the anchors will align/not break.
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 like the idea of api-
prefix.
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 think these anchors aren't that important. Please, change them in a follow-up PR.
== Using apipie bindings with Ruby | ||
|
||
Apipie bindings are the Ruby bindings for apipie documented API calls. | ||
They fetch and cache the API definition from {Project} and then generate API calls on demand. |
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.
They fetch and cache the API definition from {Project} and then generate API calls on demand. | |
They fetch and cache the API definition from {Project} and then generate API calls on-demand. |
@apinnick I'm not sure what is correct in this case. Can you please weigh in?
Co-authored-by: Maximilian Kolb <[email protected]>
@maximiliankolb I hesitate to modify the IDs without checking xrefs. I'd prefer to change them in another PR. |
…adoc Co-authored-by: Maximilian Kolb <[email protected]>
By default, {Project} authorizes all OAuth API requests as the built-in anonymous API administrator account. | ||
Therefore, API responses include all {Project} data. | ||
However, you can also specify the {Project} user that makes the request and restrict access to data to that user. | ||
|
||
To enable OAuth user mapping, enter the following command: | ||
|
||
[options="nowrap", subs="+quotes,attributes"] | ||
---- | ||
# {foreman-installer} --foreman-oauth-map-users true | ||
---- |
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.
IIRC deploying a new content proxy relies on oauth and I'm not sure what enabling user mapping does to it, if anything. @ekohl could you please chime in?
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.
39/49. Will do the rest tomorrow. Let's do headings and minor formatting/emphasis in a follow-up PR.
guides/common/modules/proc_modifying-a-smart-class-parameter-by-using-an-external-file.adoc
Show resolved
Hide resolved
guides/common/modules/proc_modifying-a-smart-class-parameter-by-using-an-external-file.adoc
Outdated
Show resolved
Hide resolved
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.
41/49 done; will finish this tomorrow.
guides/common/modules/proc_overriding-smart-class-parameters.adoc
Outdated
Show resolved
Hide resolved
|
||
[id="proc-API_Guide-Uploading_Content_to_the_{Project}_Server"] | ||
.Procedure | ||
. Assign the package name to the variable `name`: |
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'd drop the trailing colon on 17; and similar on 25 and others.
Alternative suggestion but much more work: get rid of "Example request" everywhere. It's an API documentation; we're not wizards: of course it's an example.
Not blocking.
guides/common/modules/proc_uploading-content-to-projectserver.adoc
Outdated
Show resolved
Hide resolved
guides/common/modules/proc_uploading-content-to-projectserver.adoc
Outdated
Show resolved
Hide resolved
guides/common/modules/proc_uploading-content-to-projectserver.adoc
Outdated
Show resolved
Hide resolved
guides/common/modules/proc_working-with-lifecycle-environments.adoc
Outdated
Show resolved
Hide resolved
guides/common/modules/proc_working-with-lifecycle-environments.adoc
Outdated
Show resolved
Hide resolved
guides/common/modules/proc_working-with-lifecycle-environments.adoc
Outdated
Show resolved
Hide resolved
guides/common/modules/proc_working-with-lifecycle-environments.adoc
Outdated
Show resolved
Hide resolved
guides/common/modules/proc_working-with-lifecycle-environments.adoc
Outdated
Show resolved
Hide resolved
I would prefer further changes in subsequent PRs. |
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.
49/49 🎉
I found many minor cosmetic suggestions from anchors, cli argument orders, example values, emphasis, etc. None of this blocks, in my perspective, this PR. As discussed on Monday, it's been part of Satellite downstream docs as-is for a long time. Therefore, I propose to merge as is and then iterate.
@Lennonka I am OK if you decide on a per-thread basis to apply more changes or to keep it as is. My only concern is that we need to track all SME feedback from this PR.
I would be happy to start working on all those things next week.
guides/common/modules/proc_uploading-content-to-projectserver.adoc
Outdated
Show resolved
Hide resolved
Let's create some Issues :) |
Co-authored-by: Maximilian Kolb <[email protected]>
Thanks Lena! |
Offering the API guide to Foreman community.
Please cherry-pick my commits into: