Skip to content
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

Merged
merged 50 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
7009b55
Add API guide files and metadata
Lennonka Aug 12, 2024
fe45387
Run upstreamize script
Lennonka Aug 12, 2024
fb50ccf
Upstreamize manually
Lennonka Aug 12, 2024
6f49b49
Clean up sources files
Lennonka Aug 19, 2024
a5c528e
Change title
Lennonka Aug 19, 2024
bc59d7c
Remove templates
Lennonka Aug 19, 2024
6810256
fixup! Change title
Lennonka Aug 20, 2024
96c75e9
Hide feedback module for non-Satellite
Lennonka Aug 27, 2024
bec1136
Fix guide link
Lennonka Aug 27, 2024
b406a24
Apply suggestions from review
Lennonka Aug 27, 2024
8b0e523
Fix appendixes
Lennonka Aug 27, 2024
b13dfdf
Add all caps project attribute
Lennonka Aug 27, 2024
4abab7d
Fix 'by using'
Lennonka Aug 27, 2024
bb6c101
Remove 'json.tool' line
Lennonka Aug 27, 2024
124159e
Fix username and password examples
Lennonka Aug 27, 2024
7fe7f0f
Avoid insecure calls
Lennonka Aug 27, 2024
f58335f
Level up accessing API ref
Lennonka Aug 27, 2024
fc95caf
Fix formatting usernames and passwords
Lennonka Aug 27, 2024
345726c
Clean OAuth section
Lennonka Aug 27, 2024
b2dcb8e
Improve SSL auth section
Lennonka Aug 27, 2024
2ad1c58
Fix username example formatting
Lennonka Aug 28, 2024
b4779c5
Remove python note snippet
Lennonka Aug 28, 2024
f295aee
Deprecate calling API through SmartProxyServer
Lennonka Aug 28, 2024
ea212d4
Remove upgrade note
Lennonka Aug 28, 2024
8c3e757
Remove background stuff of Hammer
Lennonka Aug 28, 2024
9cf021e
Replace SAT with project-allcaps attribute
Lennonka Aug 28, 2024
da393a3
Refactor applying errata
Lennonka Aug 28, 2024
53d62f7
Fix spaces
Lennonka Aug 28, 2024
c20ab3f
Remove and replace Python 2 examples
Lennonka Aug 28, 2024
595e995
Fix branding for RHV
Lennonka Aug 28, 2024
e781702
Remove working with Pulp
Lennonka Aug 28, 2024
6f2ee59
Fix WebUI path
Lennonka Aug 28, 2024
eb61971
Hide document on stable
Lennonka Aug 28, 2024
9b678ee
Break line in copy command
Lennonka Aug 29, 2024
383f9e7
Fix ruby script header
Lennonka Aug 29, 2024
fb65447
Replace perm. matrix with creating a perm. table
Lennonka Sep 2, 2024
43728ed
Move assemblies and modules to common folder
Lennonka Sep 2, 2024
fa330d4
Fix Vale errors
Lennonka Sep 2, 2024
1aae3ae
Fix Vale error
Lennonka Sep 2, 2024
5c6d6b8
Apply suggestions from review
Lennonka Sep 3, 2024
4dc791f
Update guides/common/modules/proc_uploading-content-to-projectserver.…
Lennonka Sep 3, 2024
0c94fed
Apply suggestions from review
Lennonka Sep 5, 2024
363cd61
Use example FQDN instead of hostname command
Lennonka Sep 5, 2024
134953c
Reformat JSON data options
Lennonka Sep 5, 2024
8771f88
Remove duplicate explanation
Lennonka Sep 5, 2024
6c39251
Improve intro
Lennonka Sep 5, 2024
b7ac777
Reword a line
Lennonka Sep 5, 2024
73e3031
Replace SAT stuff
Lennonka Sep 5, 2024
f09008c
Add the bytes unit
Lennonka Sep 5, 2024
1cf4cf8
Apply suggestions from review
Lennonka Sep 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions guides/common/assembly_api-call-authentication.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
include::modules/con_api-call-authentication.adoc[]

include::modules/con_ssl-authentication-overview.adoc[leveloffset=+1]

include::modules/proc_configuring-ssl-authentication.adoc[leveloffset=+2]

include::modules/con_http-authentication-overview.adoc[leveloffset=+1]

include::modules/con_token-authentication-overview.adoc[leveloffset=+1]

include::modules/proc_creating-a-personal-access-token.adoc[leveloffset=+2]

include::modules/proc_revoking-a-personal-access-token.adoc[leveloffset=+2]

include::modules/con_oauth-authentication-overview.adoc[leveloffset=+1]

include::modules/proc_configuring-oauth.adoc[leveloffset=+2]

include::modules/ref_oauth-request-format.adoc[leveloffset=+2]
19 changes: 19 additions & 0 deletions guides/common/assembly_api-cheat-sheet.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
include::modules/con_api-cheat-sheet.adoc[]

include::modules/proc_working-with-hosts.adoc[leveloffset=+1]

include::modules/proc_working-with-lifecycle-environments.adoc[leveloffset=+1]

include::modules/proc_uploading-content-to-projectserver.adoc[leveloffset=+1]

include::modules/proc_applying-errata-to-hosts.adoc[leveloffset=+1]

include::modules/proc_using-extended-searches.adoc[leveloffset=+1]

include::modules/proc_using-searches-with-pagination-control.adoc[leveloffset=+1]

include::modules/proc_overriding-smart-class-parameters.adoc[leveloffset=+1]

include::modules/proc_modifying-a-smart-class-parameter-by-using-an-external-file.adoc[leveloffset=+1]

include::modules/proc_deleting-openscap-reports.adoc[leveloffset=+1]
7 changes: 7 additions & 0 deletions guides/common/assembly_api-requests-in-various-languages.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include::modules/con_api-requests-in-various-languages.adoc[]

include::modules/proc_calling-the-api-in-curl.adoc[leveloffset=+1]

include::modules/proc_calling-the-api-in-ruby.adoc[leveloffset=+1]

include::modules/proc_calling-the-api-in-python.adoc[leveloffset=+1]
15 changes: 15 additions & 0 deletions guides/common/assembly_api-syntax.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
include::modules/con_api-syntax.adoc[]

include::modules/con_api-request-composition.adoc[leveloffset=+1]

include::modules/proc_using-the-get-http-method.adoc[leveloffset=+2]

include::modules/proc_using-the-post-http-method.adoc[leveloffset=+2]

include::modules/proc_using-the-put-http-method.adoc[leveloffset=+2]

include::modules/proc_using-the-delete-http-method.adoc[leveloffset=+2]

include::modules/ref_json-response-format.adoc[leveloffset=+1]

include::modules/ref_relating-api-error-messages-to-the-api-reference.adoc[leveloffset=+1]
5 changes: 5 additions & 0 deletions guides/common/assembly_introduction-to-project-api.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include::modules/con_introduction-to-project-api.adoc[]

include::modules/con_overview-of-the-project-api.adoc[leveloffset=+1]

include::modules/con_project-api-compared-to-hammer-cli.adoc[leveloffset=+1]
2 changes: 2 additions & 0 deletions guides/common/attributes-base.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// URLs
:BaseFilenameURL: index-{build}.html
:AdministeringDocURL: {BaseURL}Administering_Project/{BaseFilenameURL}#
:APIDocURL: {BaseURL}Project_API/{BaseFilenameURL}#
:ConfiguringLoadBalancerDocURL: {BaseURL}Configuring_Load_Balancer/{BaseFilenameURL}#
:ContentManagementDocURL: {BaseURL}Managing_Content/{BaseFilenameURL}#
:HammerDocURL: {BaseURL}Hammer_CLI/{BaseFilenameURL}#
Expand Down Expand Up @@ -111,6 +112,7 @@
:postgresql-conf-dir: {postgresql-data-dir}
:postgresql-log-dir: {postgresql-data-dir}/log
:PIV: PIV
:project-allcaps: FOREMAN
:project-client-url: https://yum.theforeman.org/client/{ProjectVersion}
:project-client-name: {project-client-url}[Foreman Client]
:project-client-RHEL7-url: {project-client-url}/el7/x86_64/foreman-client-release.rpm
Expand Down
1 change: 1 addition & 0 deletions guides/common/attributes-orcharhino.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
:ProjectVersion: 6.10
:ProjectVersionPrevious: 6.9
:Project: orcharhino
:project-allcaps: ORCHARHINO
:project-context: {Project}
:ProjectFeed: https://orcharhino.com/feed/
:ProjectName: {Project}
Expand Down
3 changes: 2 additions & 1 deletion guides/common/attributes-satellite.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// - lib/foreman_theme_satellite/documentation.rb in RedHatSatellite/foreman_theme_satellite
// - downstream_filename_to_link.json in downstream
:AdministeringDocURL: {BaseURL}administering_red_hat_satellite/index#
:APIDocURL: {BaseURL}using_the_satellite_rest_api/index#
:ConfiguringLoadBalancerDocURL: {BaseURL}configuring_capsules_with_a_load_balancer/index#
:ContentManagementDocURL: {BaseURL}managing_content/index#
:InstallingServerDisconnectedDocURL: {BaseURL}installing_satellite_server_in_a_disconnected_network_environment/index#
Expand All @@ -35,7 +36,6 @@

// Not upstreamed
:ReleaseNotesDocURL: {BaseURL}release_notes/index#
:APIDocURL: {BaseURL}api_guide/index#
:ConfiguringVMSubscriptionsDocURL: {BaseURL}configuring_virtual_machine_subscriptions/index#
:ConversionsToolkitDocURL: {BaseURL}converting_hosts_to_rhel_by_using_satellite_conversions_toolkit/index#

Expand Down Expand Up @@ -101,6 +101,7 @@
:project-package-remove: satellite-maintain packages remove
:project-package-update: satellite-maintain packages update
:PIV: CAC
:project-allcaps: SATELLITE
:project-context: satellite
:project-change-hostname: satellite-change-hostname
:project-minimum-memory: 20 GB
Expand Down
2 changes: 1 addition & 1 deletion guides/common/attributes-titles.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

:AdministeringDocTitle: Administering {ProjectName}
:AdministeringAnsibleDocTitle: Managing {Project} with Ansible
:APIDocTitle: Using the {Project} REST API
:AppCentricDeploymentDocTitle: Deploying hosts by using application centric approach
:ConfiguringLoadBalancerDocTitle: Configuring {SmartProxies} with a load balancer
:ContentManagementDocTitle: Managing content
Expand Down Expand Up @@ -32,7 +33,6 @@
:UpgradingDisconnectedPreviousDocTitle: Upgrading disconnected {ProjectName} to {ProjectVersionPrevious}

// Not upstreamed
:APIDocTitle: API guide
:ConfiguringVMSubscriptionsDocTitle: Configuring virtual machine subscriptions
:ConversionsToolkitDocTitle: Converting hosts to RHEL by using Satellite conversions toolkit

Expand Down
5 changes: 5 additions & 0 deletions guides/common/modules/con_api-call-authentication.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[id="api-call-authentication"]
= API call authentication

Interaction with the {Project} API requires SSL authentication with {ProjectServer} CA certificate and authentication with valid {Project} user credentials.
You can use the following authentication methods.
37 changes: 37 additions & 0 deletions guides/common/modules/con_api-cheat-sheet.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[id="api-cheat-sheet"]
= API cheat sheet

You can review the following examples of how to use the {ProjectName} API to perform various tasks.
You can use the API on {ProjectServer} via HTTPS on port 443 or on {SmartProxyServer} via HTTPS on port 8443.

[IMPORTANT]
====
ifdef::foreman,katello[]
Calling the API through {SmartProxyServer} has been deprecated since {Project} 3.12.
endif::[]
ifdef::satellite[]
Calling the API through {SmartProxyServer} has been deprecated since {Project} 6.16.
endif::[]
ifdef::orcharhino[]
Calling the API through {SmartProxyServer} has been deprecated since {Project} XXX.
endif::[]
Migrate your integrations to call the API through {ProjectServer}.
====

You can address these different port requirements within the script itself.
For example, in Ruby, you can specify the {ProjectServer} and {SmartProxyServer} URLs as follows:

[options="nowrap", subs="+quotes,verbatim,attributes"]
----
url = 'https://_{foreman-example-com}_/api/v2/'
{smart-proxy-context}_url = 'https://_{smartproxy-example-com}_:8443/api/v2/'
ifdef::katello,orcharhino,satellite[]
katello_url = 'https://_{foreman-example-com}_/katello/api/v2/'
endif::[]
----

For the host that is registered to {ProjectServer} or {SmartProxyServer}, you can determine the correct port required to access the API from the `/etc/rhsm/rhsm.conf` file, in the port entry of the `[server]` section.
You can use these values to fully automate your scripts, removing any need to verify which ports to use.

The following examples use `curl` for sending API requests.
For more information, see xref:calling-the-api-in-curl[].
39 changes: 39 additions & 0 deletions guides/common/modules/con_api-request-composition.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[id="api-request-composition"]
= API request composition

The built-in API reference shows the API route, or path, preceded by an HTTP method:

----
HTTP_METHOD API_ROUTE
----

To work with the API, construct a command by using the `curl` command syntax and the API route from the reference document:
Lennonka marked this conversation as resolved.
Show resolved Hide resolved

[options="nowrap", subs="+quotes,attributes"]
----
$ curl --request _HTTP_METHOD_ \ #<1>
--insecure \ #<2>
--user _My_User_Name_:__My_Password__ \ #<3>
--data @_input_file_.json \ #<4>
--header "Accept:application/json" \ #<5>
--header "Content-Type:application/json" \ #<5>
--output _output_file_ #<6>
_API_ROUTE_ \ #<7>
| python3 -m json.tool #<8>
----

<1> To use `curl` for the API call, specify an HTTP method with the `--request` option.
For example, `--request POST`.
<2> Add the `--insecure` option to skip SSL peer certificate verification check.
{Team} recommends you to configure SSL authentication and use secured calls.
For more information, see xref:ssl-authentication-overview[].
<3> Provide {Project} user credentials with the `--user` option.
<4> For `POST` and `PUT` requests, use the `--data` option to pass JSON-formatted data.
For more information, see xref:sect-API_Guide-Passing_JSON_Data_with_the_API_Request[].
<5> When passing the JSON data with the `--data` option, you must specify the following headers with the `--header` option.
For more information, see xref:sect-API_Guide-Passing_JSON_Data_with_the_API_Request[].
<6> When downloading content from {ProjectServer}, specify the output file with the `--output` option.
<7> Use the API route in the following format: `https://_{foreman-example-com}_/katello/api/activation_keys`.
In {ProjectX}, version 2 of the API is the default.
Therefore, it is not necessary to use `v2` in the URL for API calls.
<8> Redirect the output to the Python `json.tool` module to make the output easier to read.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[id="api-requests-in-various-languages"]
= API requests in various languages

You can review the following examples of sending API requests to {ProjectName} from curl, Ruby, or Python.
9 changes: 9 additions & 0 deletions guides/common/modules/con_api-syntax.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[id="api-syntax"]
= API syntax

You can review the basic syntax of API requests and JSON responses.

[IMPORTANT]
====
Even though versions 1 and 2 of the {ProjectX} API are available, {Team} only supports version 2.
====
17 changes: 17 additions & 0 deletions guides/common/modules/con_http-authentication-overview.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[id="http-authentication-overview"]
= HTTP authentication overview

All requests to the {Project} API require a valid {Project} user name and password.
The API uses Basic HTTP authentication to encode these credentials and add to the `Authorization` header.
For more information about Basic authentication, see http://tools.ietf.org/html/rfc2617[RFC 2617 HTTP Authentication: Basic and Digest Access Authentication].
If a request does not include an appropriate `Authorization` header, the API returns a `401 Authorization Required` error.

[IMPORTANT]
====
Basic authentication involves potentially sensitive information, for example, it sends passwords as plain text.
The REST API requires HTTPS for transport-level encryption of plain text requests.
====

Some base64 libraries break encoded credentials into multiple lines and terminate each line with a newline character.
This invalidates the header and causes a faulty request.
The `Authorization` header requires the encoded credentials to be on a single line within the header.
6 changes: 6 additions & 0 deletions guides/common/modules/con_introduction-to-project-api.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[id="introduction-to-{project-context}-api"]
= Introduction to {Project} API

{ProjectName} provides a Representational State Transfer (REST) API.
The API provides software developers and system administrators with control over their {ProjectName} environment outside of the standard web interface.
The REST API is useful for developers and administrators who aim to integrate the functionality of {ProjectName} with custom scripts or external applications that access the API over HTTP.
15 changes: 15 additions & 0 deletions guides/common/modules/con_oauth-authentication-overview.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[id="oauth-authentication-overview"]
= OAuth authentication overview

As an alternative to Basic authentication, you can use limited OAuth 1.0a authentication.
This is sometimes referred to as _1-legged OAuth_.

To view OAuth settings, in the {ProjectWebUI}, navigate to *Administer* > *Settings* > *Authentication*.
The *OAuth consumer key* is the token to be used by all OAuth clients.

{Project} stores OAuth settings in the `/etc/foreman/settings.yaml` file.
Use the `{foreman-installer}` script to configure these settings.

[role="_additional-resources"]
.Additional resources
* https://oauth.net/core/1.0a/[OAuth Core 1.0 specification, Revision A]
15 changes: 15 additions & 0 deletions guides/common/modules/con_overview-of-the-project-api.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[id="overview-of-the-{project-context}-api_{context}"]
= Overview of the {Project} API

The benefits of using the REST API are:

* Broad client support {endash} any programming language, framework, or system with support for HTTP protocol can use the API.
* Self-descriptive {endash} client applications require minimal knowledge of the {ProjectName} infrastructure because a user discovers many details at runtime.
* Resource-based model {endash} the resource-based REST model provides a natural way to manage a virtualization platform.

You can use the REST API to perform the following tasks:

* Integrate with enterprise IT systems.
* Integrate with third-party applications.
* Perform automated maintenance or error checking tasks.
* Automate repetitive tasks with scripts.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[id="{project-context}-api-compared-to-hammer-cli_{context}"]
= {Project} API compared to Hammer CLI

For many tasks, you can use both Hammer and {Project} API.
You can use Hammer as a human-friendly interface to {Project} API.
For example, to test responses to API calls before applying them in a script, use the `--debug` option to inspect API calls that Hammer issues: `hammer --debug organization list`.
In contrast, scripts that use API commands communicate directly with the {Project} API.

For more information, see the link:{HammerDocURL}[_{HammerDocTitle}_].
14 changes: 14 additions & 0 deletions guides/common/modules/con_ssl-authentication-overview.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[id="ssl-authentication-overview"]
= SSL authentication overview

{ProjectName} uses HTTPS, which provides a degree of encryption and identity verification when communicating with {ProjectServer}.
{Project} {ProjectVersion} does not support non-SSL communications.

By default, {ProjectServer} uses a self-signed certificate.
This certificate acts as both the server certificate to verify the encryption key and the certificate authority (CA) to trust the identity of {ProjectServer}.

You can configure {ProjectServer} to use a custom SSL certificate.
For more information, see {InstallingServerDocURL}Configuring_Server_with_a_Custom_SSL_Certificate_{project-context}[Configuring {ProjectServer} with a custom SSL certificate] in _{InstallingServerDocTitle}_.
ifdef::satellite[]
For more information on disconnected {ProjectServer}, see {InstallingServerDisconnectedDocURL}Configuring_Server_with_a_Custom_SSL_Certificate_{project-context}[Configuring {ProjectServer} with a custom SSL certificate] in _{InstallingServerDisconnectedDocTitle}_.
endif::[]
5 changes: 5 additions & 0 deletions guides/common/modules/con_token-authentication-overview.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[id="token-authentication-overview"]
= Token authentication overview

{ProjectName} supports {PAT}s that you can use to authenticate API requests instead of using your password.
You can set an expiration date for your {PAT} and you can revoke it if you decide it should expire before the expiration date.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[id="accessing-the-built-in-api-reference"]
= Accessing the built-in API reference

You can access the full API reference on your {ProjectServer}.

.Procedure
* In your browser, access the following URL:
+
[options="nowrap", subs="+quotes,attributes"]
----
https://_{foreman-example-com}_/apidoc/v2.html
----
+
Replace _{foreman-example-com}_ with the FQDN of your {ProjectServer}.
49 changes: 49 additions & 0 deletions guides/common/modules/proc_applying-errata-to-hosts.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[id="applying-errata-to-hosts"]
= Applying errata to hosts

You can use the API to apply errata to a host, host group, or host collection.
The following is the basic syntax of a PUT request:

[options="nowrap", subs="+quotes,attributes"]
----
$ curl --header "Accept:application/json" \
--header "Content-Type:application/json" --request PUT \
--user _My_User_Name_:__My_Password__ \
maximiliankolb marked this conversation as resolved.
Show resolved Hide resolved
--data _My_JSON_Formatted_Data_ https://_{foreman-example-com}_
----

You can browse the built-in API doc to find a URL to use for applying errata.
You can use the {ProjectWebUI} to help discover the format for the search query.
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="exam-API_Guide-Applying_Errata_to_a_Host"]
maximiliankolb marked this conversation as resolved.
Show resolved Hide resolved
.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.

Example request:
[options="nowrap", subs="+quotes,attributes"]
----
$ curl --header "Accept:application/json" \
--header "Content-Type:application/json" --request PUT \
--user _My_User_Name_:__My_Password__ \
--data "{\"organization_id\":1,\"included\":{\"search\":\"_my-host_\"},\"content_type\":\"errata\",\"content\":[\"_RHBA-2016:1981_\"]}" \
https://_{foreman-example-com}_/api/v2/hosts/bulk/install_content
----

[id="exam-API_Guide-Applying_Errata_to_a_Host_Collection"]
maximiliankolb marked this conversation as resolved.
Show resolved Hide resolved
.Applying errata to a host collection

In this example, notice the level of escaping required to pass the search string `host_collection="my-collection"` as seen in the {ProjectWebUI}.
Example request:

[options="nowrap", subs="+quotes,attributes"]
----
$ curl --header "Accept:application/json" \
--header "Content-Type:application/json" --request PUT \
--user _My_User_Name_:__My_Password__ \
--data "{\"organization_id\":1,\"included\":{\"search\":\"host_collection=\\\"_my-collection_\\\"\"},\"content_type\":\"errata\",\"content\":[\"_RHBA-2016:1981_\"]}" \
https://_{foreman-example-com}_/api/v2/hosts/bulk/install_content
----
Loading
Loading