Skip to content

Commit

Permalink
Apply feedback by Lena
Browse files Browse the repository at this point in the history
  • Loading branch information
maximiliankolb committed Oct 17, 2024
1 parent 876cf37 commit 469d109
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ include::modules/proc_calling-the-api-in-python.adoc[leveloffset=+1]

include::modules/proc_creating-objects-by-using-python.adoc[leveloffset=+2]

include::modules/proc_requesting-information-from-the-api-by-using-python.adoc[leveloffset=+2]
include::modules/proc_retrieving-resource-information-by-using-python.adoc[leveloffset=+2]
2 changes: 1 addition & 1 deletion guides/common/modules/proc_applying-errata-to-hosts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Navigate to *Hosts* > *Host Collections* and select a host collection.
Go to *Collection Actions* > *Errata Installation* and notice the search query box contents.
For example, for a Host Collection called _my-collection_, the search box contains `host_collection="my-collection"`.

[id="api-appyling-errata-to-a-host"]
[id="api-applying-errata-to-a-host"]
.Applying errata to a host

This example uses the API URL for bulk actions `/katello/api/hosts/bulk/install_content` to show the format required for a simple search.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ $ curl \
--request POST \
--user _My_User_Name_:__My_Password__ \
--data "{\"firstname\":\"_Test Name_\",\"mail\":\"[email protected]_\",\"login\":\"_test_user_\",\"password\":\"_password123_\",\"auth_source_id\":__1__}" \
https://_{foreman-example-com}_/api/users | python3 -m json.tool
https://_{foreman-example-com}_/api/users \
| python3 -m json.tool
----

[id="api-modifying-a-user"]
Expand All @@ -36,5 +37,6 @@ $ curl \
--request PUT \
--user _My_User_Name_:__My_Password__ \
--data "{\"firstname\":\"_New Test Name_\",\"mail\":\"[email protected]_\",\"login\":\"_new_test_user_\",\"password\":\"_password123_\",\"auth_source_id\":__1__}" \
https://_{foreman-example-com}_/api/users/_8_ | python3 -m json.tool
https://_{foreman-example-com}_/api/users/_8_ \
| python3 -m json.tool
----
3 changes: 2 additions & 1 deletion guides/common/modules/proc_deleting-openscap-reports.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Example request:
----
$ curl \
--user _My_User_Name_:__My_Password__ \
https://_{foreman-example-com}_/api/v2/compliance/arf_reports/ | python3 -m json.tool
https://_{foreman-example-com}_/api/v2/compliance/arf_reports/ \
| python3 -m json.tool
----
+
Example response:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Example request:
$ curl \
--request GET \
--user _My_User_Name_:__My_Password__ \
https://_{foreman-example-com}_/api/users | python3 -m json.tool
https://_{foreman-example-com}_/api/users \
| python3 -m json.tool
----

Example response:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[id="requesting-information-from-the-api-by-using-python"]
= Requesting information from the API by using Python
[id="retrieving-resource-information-by-using-python"]
= Retrieving resource information by using Python

This is an example script that uses Python for various API requests.

Expand Down
3 changes: 2 additions & 1 deletion guides/common/modules/proc_using-the-get-http-method.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ This example requests the number of registered {Project} hosts.
$ curl \
--request GET \
--user _My_User_Name_:__My_Password__ \
https://_{foreman-example-com}_/api/hosts | python3 -m json.tool
https://_{foreman-example-com}_/api/hosts \
| python3 -m json.tool
----

.Example response
Expand Down
3 changes: 2 additions & 1 deletion guides/common/modules/proc_working-with-hosts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ Example request:
$ curl \
--request GET \
--user _My_User_Name_:__My_Password__ \
https://_{foreman-example-com}_/api/v2/hosts | python3 -m json.tool
https://_{foreman-example-com}_/api/v2/hosts \
| python3 -m json.tool
----

Example response:
Expand Down
6 changes: 4 additions & 2 deletions guides/common/modules/ref_json-response-format.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Example request:
$ curl \
--request GET \
--user _My_User_Name_:__My_Password__ \
https://_{foreman-example-com}_/api/domains/23 | python3 -m json.tool
https://_{foreman-example-com}_/api/domains/23 \
| python3 -m json.tool
----

Example response:
Expand Down Expand Up @@ -46,7 +47,8 @@ Example request:
$ curl \
--request GET \
--user _My_User_Name_:__My_Password__ \
https://_{foreman-example-com}_/api/domains | python3 -m json.tool
https://_{foreman-example-com}_/api/domains \
| python3 -m json.tool
----

Example response:
Expand Down
3 changes: 2 additions & 1 deletion guides/common/modules/snip_managing-packages-api.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ curl https://_{foreman-example-com}_/api/job_invocations \
-H "content-type: application/json" \
-X POST \
-d @_Path_To_My_API_Request_Body_ \
-u _My_Username_:__My_Password__ | python3 -m json.tool
-u _My_Username_:__My_Password__ \
| python3 -m json.tool
----

.Verification
Expand Down

0 comments on commit 469d109

Please sign in to comment.