-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce API request and API response titles
- Loading branch information
1 parent
df5282e
commit bfbb81d
Showing
46 changed files
with
834 additions
and
828 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 12 additions & 4 deletions
16
guides/common/assembly_api-requests-in-various-languages.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[id="json-response-format"] | ||
= JSON response format | ||
|
||
Calls to the API return results in JSON format. | ||
The API call returns the result for a single-option response or for responses collections. |
6 changes: 6 additions & 0 deletions
6
guides/common/modules/con_retrieving-a-list-of-resources.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[id="retrieving-a-list-of-resources"] | ||
= Retrieving a list of resources | ||
|
||
This section outlines how to use `curl` with the {ProjectX} API to request information from {Project}. | ||
These examples include both requests and responses. | ||
Expect different results for each deployment. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[id="working-with-hosts"] | ||
= Working with hosts |
17 changes: 17 additions & 0 deletions
17
guides/common/modules/con_working-with-lifecycle-environments.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[id="working-with-lifecycle-environments"] | ||
= Working with lifecycle environments | ||
|
||
{Project} divides application life cycles into lifecycle environments, which represent each stage of the application life cycle. | ||
Lifecycle environments are linked to from an environment path. | ||
To create linked lifecycle environments with the API, use the `prior_id` parameter. | ||
|
||
You can find the built-in API reference for lifecycle environments at `https://_{foreman-example-com}_/apidoc/v2/lifecycle_environments.html`. | ||
The API routes include `/katello/api/environments` and `/katello/api/organizations/:organization_id/environments`. | ||
|
||
proc_listing-lifecycle-environments | ||
|
||
proc_creating-linked-lifecycle-environments | ||
|
||
proc_updating-a-lifecycle-environment | ||
|
||
proc_deleting-a-lifecycle-environment.adoc |
20 changes: 18 additions & 2 deletions
20
guides/common/modules/proc_applying-errata-to-a-host-collection.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,27 @@ | ||
[id="Applying_Errata_to_a_Host_Collection_{context}"] | ||
[id="applying-errata-to-a-host-collection"] | ||
= Applying errata to a host collection | ||
|
||
.Using `Remote Execution` | ||
You can use {Project} to apply errata to a host collection. | ||
|
||
[id="cli-applying-errata-to-a-host-collection"] | ||
.CLI procedure | ||
[options="nowrap", subs="+quotes,verbatim,attributes"] | ||
---- | ||
# hammer job-invocation create \ | ||
--feature katello_errata_install \ | ||
--inputs errata=_ERRATUM_ID1_,_ERRATUM_ID2_,... \ | ||
--search-query "host_collection = _HOST_COLLECTION_NAME_" | ||
---- | ||
|
||
[id="api-applying-errata-to-a-host-collection"] | ||
.API procedure | ||
[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 | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,5 +45,18 @@ Specifying organization IDs is not required. | |
You can modify the user details later by using the `hammer user update` command. | ||
|
||
.Additional resources | ||
|
||
* For more information about creating user accounts by using Hammer, enter `hammer user create --help`. | ||
|
||
[id="api-creating-a-user"] | ||
.API request | ||
[options="nowrap", subs="+quotes,attributes"] | ||
---- | ||
$ curl \ | ||
--header "Accept:application/json" \ | ||
--header "Content-Type:application/json" \ | ||
--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 | ||
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,39 +4,3 @@ | |
You can use `curl` to manipulate resources on your {ProjectServer}. | ||
API calls to {Project} require data in `json` format. | ||
For more information, see xref:passing-json-data-to-the-api-request[]. | ||
|
||
[id="api-creating-a-user"] | ||
.Creating a user | ||
|
||
This example creates a user by providing required information in the `--data` option. | ||
|
||
Example request: | ||
[options="nowrap", subs="+quotes,attributes"] | ||
---- | ||
$ curl \ | ||
--header "Accept:application/json" \ | ||
--header "Content-Type:application/json" \ | ||
--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 | ||
---- | ||
|
||
[id="api-modifying-a-user"] | ||
.Modifying a user | ||
|
||
This example modifies given name and login of the `test_user` that was created in xref:api-creating-a-user[]. | ||
|
||
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 "{\"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 | ||
---- |
Oops, something went wrong.