-
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
469d109
commit 6b74008
Showing
42 changed files
with
801 additions
and
747 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,18 @@ | ||
[id="working-with-hosts"] | ||
= Working with hosts | ||
|
||
proc_listing-hosts | ||
|
||
proc_requesting-information-for-a-host | ||
|
||
proc_listing-host-facts | ||
|
||
proc_searching-for-hosts-with-matching-patterns | ||
|
||
proc_searching-for-hosts-in-an-environment | ||
|
||
proc_searching-for-hosts-with-a-specific-fact-value | ||
|
||
proc_deleting-a-host | ||
|
||
proc_downloading-a-full-host-boot-disk-image |
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 |
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 | ||
---- |
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
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,15 @@ | ||
[id="deleting-a-host"] | ||
= Deleting a host | ||
|
||
This request deletes a host with a name _host1.example.com_. | ||
|
||
[id="api-deleting-a-host"] | ||
.API request | ||
[options="nowrap", subs="+quotes,attributes"] | ||
---- | ||
$ curl \ | ||
--request DELETE \ | ||
--user _My_User_Name_:__My_Password__ \ | ||
https://_{foreman-example-com}_/api/v2/hosts/_host1.example.com_ \ | ||
| python3 -m json.tool | ||
---- |
15 changes: 15 additions & 0 deletions
15
guides/common/modules/proc_deleting-a-lifecycle-environment.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,15 @@ | ||
[id="deleting-a-lifecycle-environment"] | ||
= Deleting a lifecycle environment | ||
|
||
You can delete a lifecycle environment provided it has no successor. | ||
Therefore, delete them in reverse order by using a command in the following format: | ||
|
||
[id="api-deleting-a-lifecycle-environment"] | ||
.API request | ||
[options="nowrap", subs="+quotes,attributes"] | ||
---- | ||
$ curl \ | ||
--request DELETE \ | ||
--user _My_User_Name_:__My_Password__ \ | ||
https://_{foreman-example-com}_/katello/api/environments/_:id_ | ||
---- |
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
Oops, something went wrong.