Skip to content

Commit

Permalink
REST documentation changes, operation pages and index additions
Browse files Browse the repository at this point in the history
  • Loading branch information
matusmacik committed Feb 21, 2024
1 parent 8c01b39 commit dee23a4
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
:page-visibility: hidden
[source,bash]
.Modification of an attribute for specific user
----
# Authenticating with the credentials "administrator" and password "y0uR_P455woR*d" on a localhost instance running on port 8080
curl --user administrator:y0uR_P455woR*d -H "Content-Type: application/json" -X PATCH http://localhost:8080/midpoint/ws/rest/users/00000000-0000-0000-0000-000000000002 --data-binary @pathToMidpointGit\samples\rest\modify-attribute-gen.json -v
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:page-visibility: hidden
//[source,bash]
// .Notify change operation in regard to passwords change
// ----
// # Authenticating with the credentials "administrator" and password "y0uR_P455woR*d" on a localhost instance running on port 8080
// curl --user administrator:y0uR_P455woR*d -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/notifyChange --data-binary @pathToMidpointGit\samples\rest\notify-change-modify-password.json -v
// ----
4 changes: 2 additions & 2 deletions docs/interfaces/rest/operations/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ a| * 202 Accepted
| -
a| * 202 Accepted

//TODO
| Notify change

| xref:/midpoint/reference/interfaces/rest/operations/notify-op-rest.adoc[Notify change]
| POST
| /notifyChange
| No
Expand Down
6 changes: 5 additions & 1 deletion docs/interfaces/rest/operations/modify-op-rest.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ payload in the body:
----

You might need to specify the accepted type of content in case
you are interested in a format different from xml (default)
you are interested in a format different from xml (default):

.Accept type header example, other media types are supported as well
[source, http]
Expand All @@ -74,6 +74,10 @@ include::../../rest/concepts/raw/outcome.adoc[]

== Examples

include::../../rest/operations/examples/raw/modify-attr-user.adoc[]
include::../../rest/operations/examples/raw/modify-attr.adoc[]


== See Also

- xref:/midpoint/reference/interfaces/rest/concepts/media-types-rest/[Supported Media Types]
Expand Down
1 change: 1 addition & 0 deletions docs/interfaces/rest/operations/notify-op-rest.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
:page-display-order: 200
:page-toc: top

//TODO
== Description

== Request
Expand Down
52 changes: 52 additions & 0 deletions docs/interfaces/rest/operations/resource-op-rest.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,71 @@
:page-toc: top

== Description
A set of operations which are specific for objects of the "Resource" type residing on the "resources" endpoint.


== Request

For the request you should use the HTTP POST method. The URI of the request itself depends on the type of operation.
There are TWO types of operation requests which are described on this page.

.*Test Resource* operation using HTTP POST
[source, http]
----
POST http://localhost:8080/midpoint/ws/rest/resources/{oid}/test
----

.*Import From Resource* operation using HTTP POST
[source, http]
----
POST http://localhost:8080/midpoint/ws/rest/resources/{oid}/import/{objectClass}
----

=== Headers

Regarding authorization type, the "Basic" Authorization header should be used.

.Authorization header example replace {Base64EncodedCredentials} with the encoded credentials
[source, http]
----
Authorization: Basic {Base64EncodedCredentials}
----

To specify the provided content type, please use the "Content-Type" header
payload in the body:

.Content type header example, other media types are supported as well
[source, http]
----
"Content-Type: application/json"
----

You might need to specify the accepted type of content in case
you are interested in a format different from xml (default):

.Accept type header example, other media types are supported as well
[source, http]
----
"Accept: application/json"
----

.For supported media types please refer to the following section of the documentation
xref:/midpoint/reference/interfaces/rest/concepts/media-types-rest/[Supported Media Types]

=== Body
The resource specific operations do not need to contain any specific payload data in the body of the
request.

=== Options
There are no supported operation options for this type of operation.

include::../../rest/concepts/raw/outcome.adoc[]

== Examples

include::../../rest/operations/examples/raw/test-resource.adoc[]
include::../../rest/operations/examples/raw/import-from-resource.adoc[]

== See Also

- xref:/midpoint/reference/interfaces/rest/concepts/media-types-rest/[Supported Media Types]
Expand Down
55 changes: 55 additions & 0 deletions docs/interfaces/rest/operations/script-execute-op-rest.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,73 @@

== Description

Remote procedure call (RPC) type of request which is specifically used for script execution. The script which should
be executed is a part of the request body.

== Request

For the request you need to use the HTTP POST method.

.*Execute Script* operation using HTTP POST
[source, http]
----
POST http://localhost:8080/midpoint/ws/rest/rpc/executeScript
----

=== Headers

Regarding authorization type, the "Basic" Authorization header should be used.

.Authorization header example replace {Base64EncodedCredentials} with the encoded credentials
[source, http]
----
Authorization: Basic {Base64EncodedCredentials}
----

To specify the provided content type, please use the "Content-Type" header
payload in the body:

.Content type header example, other media types are supported as well
[source, http]
----
"Content-Type: application/json"
----

You might need to specify the accepted type of content in case
you are interested in a format different from xml (default):

.Accept type header example, other media types are supported as well
[source, http]
----
"Accept: application/json"
----

.For supported media types please refer to the following section of the documentation
xref:/midpoint/reference/interfaces/rest/concepts/media-types-rest/[Supported Media Types]


=== Body

The body should contain a payload consisting of a ExecuteScriptType type of object containing.
Please have a look on the *examples* on this page for a sample of the object in the body.


=== Options
There are no supported operation options for this type of operation.

include::../../rest/concepts/raw/outcome.adoc[]

=== Responses In Case Of Success

- *200 OK*, ExecuteScriptResponseType returned in the body
- *201 Created*, Location set to point to the newly created Task object. Only applicable is asynchronous=true parameter is used.
- *240 Handled error*, OperationResult is returned in the body
- *250 Partial error*, OperationResult is returned in the body

== Examples

include::../../rest/operations/examples/raw/execute-script-rpc.adoc[]

== See Also

- xref:/midpoint/reference/interfaces/rest/concepts/media-types-rest/[Supported Media Types]
Expand Down

0 comments on commit dee23a4

Please sign in to comment.