-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/support-4.8' into support-4.8
- Loading branch information
Showing
20 changed files
with
147 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
=== Response | ||
|
||
[%autowidth] | ||
|=== | ||
| Error code | Meaning | ||
|
||
| 1xx | ||
| Information. | ||
Stay tuned, operation is in progress. | ||
|
||
| 2xx | ||
a| Success. | ||
Operation finished successfully. | ||
There are two custom codes: | ||
|
||
* 250 for partial error which means that during processing some error occurred but some changes was executed. | ||
* 240 for handled error which means that there was originally error, but midPoint was able to fix this using its xref:/midpoint/reference/synchronization/consistency/[consistency mechanism.] | ||
In this two cases, midPoint returns the xref:/midpoint/architecture/concepts/operation-result/[OperationResult] where there details of executed operations can be found. | ||
|
||
| 3xx | ||
a| Redirection or "in progress". | ||
This is returned mostly to indicate two cases: | ||
|
||
* Operation has finished, but the results are not in this resource. | ||
Redirection is issues to point the client to the results. | ||
Typical example is creation of an object with POST to a collection web resource. | ||
In this case a new object is created, new URI is assigned and the client is redirected to this URI. | ||
Retrieving that URI provides created object and 200 status code, indicating that the operation is finished. | ||
* Operation is in progress (asynchronous operation). | ||
In this case midPoint API redirects the client to a task object that can be used to track progress of the operation. | ||
| 4xx | ||
| Client errors. | ||
The client has sent request that cannot be processed. | ||
This indicates usual situation that are well handled by the midPoint code. | ||
Maybe the client request to create conflicting object, delete non-existent object, modification that violates the schema and so on. | ||
The xref:/midpoint/architecture/concepts/operation-result/[OperationResult] structure is usually provided in the response to provide more details about the situation. | ||
|
||
|
||
| 5xx | ||
| Server errors. | ||
Situations that the server cannot handle and where the cause is unknown. | ||
This usually means bugs in the code, insufficient resources such as RAM or disk space, unforeseen failures in the infrastructure and so on. | ||
The xref:/midpoint/architecture/concepts/operation-result/[OperationResult] structure might or might not be provided in this case. | ||
Some errors are so severe that the structured error information might not be available. | ||
|
||
|
||
|=== | ||
|
||
Status codes and the indication of errors and asynchronous processing applies uniformly to all midPoint web resources (both RESTful and RPC). | ||
|
||
// TODO refactoring this to specific example chapters | ||
|
||
|
||
|
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
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,35 @@ | ||
= Create object | ||
:page-nav-title: Create object | ||
:page-display-order: 500 | ||
:page-toc: top | ||
|
||
== Description | ||
Example of creating an midPoint object representing some identity data in the | ||
form of a new User type object | ||
|
||
include::../examples/raw/curl-authenticatoin-intro-note.adoc[] | ||
|
||
.Authentication methods used to work with the REST api | ||
xref:/midpoint/reference/interfaces/rest/concepts/authentication/#_basic_authentication[Authentication methods] | ||
|
||
== Example | ||
//TODO | ||
.Create a new User object in MidPoint with file data source | ||
[source,bash] | ||
---- | ||
curl --user administrator:5ecr3t -H "Content-Type: application/xml" -X POST http://localhost:8080/midpoint/ws/rest/users --data-binary @pathToMidpointGit\samples\rest\rest-user.xml -v | ||
---- | ||
|
||
.*Show* data source example for *"Create a new User object in MidPoint" | ||
[%collapsible] | ||
==== | ||
[source, xml] | ||
---- | ||
include::https://raw.githubusercontent.com/Evolveum/midpoint-samples/master/samples/rest/user-.xml[] | ||
---- | ||
==== | ||
|
||
== See Also | ||
|
||
- xref:/midpoint/reference/interfaces/rest/concepts/media-types-rest/[Supported Media Types] | ||
- xref:/midpoint/reference/interfaces/rest/concepts/authentication/[Authentication] |
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
13 changes: 13 additions & 0 deletions
13
docs/interfaces/rest/operations/examples/raw/curl-authenticatoin-intro-note.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,13 @@ | ||
For the purpose of the sample we are using the CURL tool as it is a well maintained, well | ||
tested, and it's widely accessible. | ||
|
||
The body of the request will contain data from an external configuration file, | ||
the data will be inserted into the request via native Curl commands. | ||
|
||
[NOTE] | ||
==== | ||
If you are using file as a source for the data in the REST call with *curl*, please, don't forget to use '*@*' before the path to your file. | ||
Sometimes the newlines are not correctly handled during the transfer. | ||
(See bug:MID-5229[].) If that occurs, please use `--data-binary` instead of `-d`. | ||
==== |
1 change: 1 addition & 0 deletions
1
docs/interfaces/rest/operations/examples/raw/get-user-administrator.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 @@ | ||
curl --user administrator:5ecr3t -H "Accept: application/json" -X GET http://localhost:8080/midpoint/ws/rest/users/00000000-0000-0000-0000-000000000002?options=raw |
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
|
||
=== Options | ||
|
||
=== Response | ||
include::../../rest/concepts/raw/outcome.adoc[] | ||
|
||
== Examples | ||
|
||
|
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
|
||
=== Options | ||
|
||
=== Response | ||
include::../../rest/concepts/raw/outcome.adoc[] | ||
|
||
== Examples | ||
|
||
|
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
|
||
=== Options | ||
|
||
=== Response | ||
include::../../rest/concepts/raw/outcome.adoc[] | ||
|
||
== Examples | ||
|
||
|
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
|
||
=== Options | ||
|
||
=== Response | ||
include::../../rest/concepts/raw/outcome.adoc[] | ||
|
||
== Examples | ||
|
||
|
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
|
||
=== Options | ||
|
||
=== Response | ||
include::../../rest/concepts/raw/outcome.adoc[] | ||
|
||
== Examples | ||
|
||
|
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
|
||
=== Options | ||
|
||
=== Response | ||
include::../../rest/concepts/raw/outcome.adoc[] | ||
|
||
== Examples | ||
|
||
|
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
|
||
=== Options | ||
|
||
=== Response | ||
include::../../rest/concepts/raw/outcome.adoc[] | ||
|
||
== Examples | ||
|
||
|
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
|
||
=== Options | ||
|
||
=== Response | ||
include::../../rest/concepts/raw/outcome.adoc[] | ||
|
||
== Examples | ||
|
||
|
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
|
||
=== Options | ||
|
||
=== Response | ||
include::../../rest/concepts/raw/outcome.adoc[] | ||
|
||
== Examples | ||
|
||
|
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
|
||
=== Options | ||
|
||
=== Response | ||
include::../../rest/concepts/raw/outcome.adoc[] | ||
|
||
== Examples | ||
|
||
|
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