Skip to content

Commit

Permalink
REST docu changes, rewriting curl commands to multi liners
Browse files Browse the repository at this point in the history
  • Loading branch information
matusmacik committed Mar 4, 2024
1 parent f44596c commit 085b95b
Show file tree
Hide file tree
Showing 64 changed files with 312 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
.Create Access Certification Campaign
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/accessCertificationCampaigns --data-binary @pathToMidpointGit\samples\rest\.json -v
curl --user administrator:y0uR_P455woR*d \
-H "Content-Type: application/json" \
-X POST http://localhost:8080/midpoint/ws/rest/accessCertificationCampaigns \
-v \
--data-binary @./samples/rest/.json
----

.*Show* data source example for *"Create Access Certification Campaign"* | link:https://raw.githubusercontent.com/Evolveum/midpoint-samples/master/samples/rest/.json[GitHub]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
.Create a new Organizational Unit object in MidPoint with file data source
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/orgs --data-binary @pathToMidpointGit\samples\rest\org-project.json -v
curl --user administrator:y0uR_P455woR*d \
-H "Content-Type: application/json" \
-X POST http://localhost:8080/midpoint/ws/rest/orgs \
-v \
--data-binary @./samples/rest/org-project.json
----

.*Show* data source example for *"Create a new Organizational Unit object in MidPoint"* | link:https://raw.githubusercontent.com/Evolveum/midpoint-samples/master/samples/rest/org-project.json[GitHub]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
.Create a new Report regarding Error audit records in 24h
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/reports --data-binary @pathToMidpointGit\samples\rest\report-error-audit-records-24h.json -v
curl --user administrator:y0uR_P455woR*d \
-H "Content-Type: application/json" \
-X POST http://localhost:8080/midpoint/ws/rest/reports \
-v \
--data-binary @./samples/rest/report-error-audit-records-24h.json
----

.*Show* data source example for *"Create a new Report regarding Error audit records in 24h"* | link:https://raw.githubusercontent.com/Evolveum/midpoint-samples/master/samples/rest/report-error-audit-records-24h.json[GitHub]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/resources --data-binary @pathToMidpointGit\samples\rest\resource-csv.json -v
curl --user administrator:y0uR_P455woR*d \
-H "Content-Type: application/json" \
-X POST http://localhost:8080/midpoint/ws/rest/resources \
-v \
--data-binary @./samples/rest/resource-csv.json
----

.*Show* data source example for *"Create a new Resource object in MidPoint"* | link:https://raw.githubusercontent.com/Evolveum/midpoint-samples/master/samples/rest/resource-csv.json[GitHub]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
.Create a new Role object in MidPoint with file data source
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/roles --data-binary @@pathToMidpointGit\samples\rest\role-employee.json -v
curl --user administrator:y0uR_P455woR*d \
-H "Content-Type: application/json" \
-X POST http://localhost:8080/midpoint/ws/rest/roles \
-v \
--data-binary @./samples/rest/role-employee.json
----

.*Show* data source example for *"Create a new Role object in MidPoint"* | link:https://raw.githubusercontent.com/Evolveum/midpoint-samples/master/samples/rest/role-employee.json[GitHub]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
.Create a new Task object in MidPoint with file data source
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/tasks --data-binary @pathToMidpointGit\samples\rest\task-recompute-members-employee.json -v
curl --user administrator:y0uR_P455woR*d \
-H "Content-Type: application/json" \
-X POST http://localhost:8080/midpoint/ws/rest/tasks \
-v \
--data-binary @./samples/rest/task-recompute-members-employee.json
----

.*Show* data source example for *"Create a new Task object in MidPoint"* | link:https://raw.githubusercontent.com/Evolveum/midpoint-samples/master/samples/rest/task-recompute-members-employee.json[GitHub]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
.Create a new User object in MidPoint with file data source
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/users --data-binary @pathToMidpointGit\samples\rest\user-jack.json -v
curl --user administrator:y0uR_P455woR*d \
-H "Content-Type: application/json" \
-X POST http://localhost:8080/midpoint/ws/rest/users \
-v \
--data-binary @./samples/rest/user-jack.json
----

.*Show* data source example for *"Create a new User object in MidPoint"* | link:https://raw.githubusercontent.com/Evolveum/midpoint-samples/master/samples/rest/user-jack.json[GitHub]
Expand Down
4 changes: 3 additions & 1 deletion docs/interfaces/rest/operations/examples/raw/delete-acc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
.Delete a Resource type object
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -X DELETE http://localhost:8080/midpoint/ws/rest/accessCertificationCampaigns/3a0fb4a2-ffbd-4e72-bbff-47327df054c4 -v
curl --user administrator:y0uR_P455woR*d \
-v \
-X DELETE http://localhost:8080/midpoint/ws/rest/accessCertificationCampaigns/3a0fb4a2-ffbd-4e72-bbff-47327df054c4
----

The response is an HTTP 204 code in case of success *without* a response body.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
.Delete a Case type object
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -X DELETE http://localhost:8080/midpoint/ws/rest/cases/3091ccc5-f3f6-4a06-92b5-803afce1ce57 -v
curl --user administrator:y0uR_P455woR*d \
-v \
-X DELETE http://localhost:8080/midpoint/ws/rest/cases/3091ccc5-f3f6-4a06-92b5-803afce1ce57
----

The response is an HTTP 204 code in case of success *without* a response body.
4 changes: 3 additions & 1 deletion docs/interfaces/rest/operations/examples/raw/delete-ou.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
.Delete an Organizational Unit type object
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -X DELETE http://localhost:8080/midpoint/ws/rest/orgs/e5ae2f30-141c-4990-8387-4c8e7433132d -v
curl --user administrator:y0uR_P455woR*d \
-v \
-X DELETE http://localhost:8080/midpoint/ws/rest/orgs/e5ae2f30-141c-4990-8387-4c8e7433132d
----

The response is an HTTP 204 code in case of success *without* a response body.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
.Delete a Report type object
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -X DELETE http://localhost:8080/midpoint/ws/rest/reports/4de173d5-4dff-4e4f-bfb8-47f951f26637 -v
curl --user administrator:y0uR_P455woR*d \
-v \
-X DELETE http://localhost:8080/midpoint/ws/rest/reports/4de173d5-4dff-4e4f-bfb8-47f951f26637
----

The response is an HTTP 204 code in case of success *without* a response body.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
.Delete a Resource type object
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -X DELETE http://localhost:8080/midpoint/ws/rest/resources/ef2bc95b-76e0-59e2-86d6-9999cccccccc -v
curl --user administrator:y0uR_P455woR*d \
-v \
-X DELETE http://localhost:8080/midpoint/ws/rest/resources/ef2bc95b-76e0-59e2-86d6-9999cccccccc
----

The response is an HTTP 204 code in case of success *without* a response body.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
.Delete a Role type object
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -X DELETE http://localhost:8080/midpoint/ws/rest/roles/76fcec3e-7224-435e-8c9b-7532f081d8b0 -v
curl --user administrator:y0uR_P455woR*d \
-v \
-X DELETE http://localhost:8080/midpoint/ws/rest/roles/76fcec3e-7224-435e-8c9b-7532f081d8b0
----

The response is an HTTP 204 code in case of success *without* a response body.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
.Delete a Task type object
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -X DELETE http://localhost:8080/midpoint/ws/rest/tasks/6d13632c-6b75-4a33-9744-ec9523375f6b -v
curl --user administrator:y0uR_P455woR*d \
-v \
-X DELETE http://localhost:8080/midpoint/ws/rest/tasks/6d13632c-6b75-4a33-9744-ec9523375f6b
----

The response is an HTTP 204 code in case of success *without* a response body.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
.Delete a User type object
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -X DELETE http://localhost:8080/midpoint/ws/rest/users/e4b0c81e-7fc7-462d-a92c-b3e0b10b8b49 -v
curl --user administrator:y0uR_P455woR*d \
-v \
-X DELETE http://localhost:8080/midpoint/ws/rest/users/e4b0c81e-7fc7-462d-a92c-b3e0b10b8b49
----

The response is an HTTP 204 code in case of success *without* a response body.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
.Execute script with procedure call to recompute object on input
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Accept: application/json" -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/rpc/executeScript --data-binary @pathToMidpointGit\samples\rest\rpc-recompute-input-filter.json -v
curl --user administrator:y0uR_P455woR*d \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-X POST http://localhost:8080/midpoint/ws/rest/rpc/executeScript \
-v \
--data-binary @./samples/rest/rpc-recompute-input-filter.json
----

.*Show* data source example for *"Execute script with procedure call to recompute object on input"* | link:https://raw.githubusercontent.com/Evolveum/midpoint-samples/master/samples/rest/rpc-recompute-input-filter.json[GitHub]
Expand Down
5 changes: 4 additions & 1 deletion docs/interfaces/rest/operations/examples/raw/get-acc.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
:page-visibility: hidden
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Accept: application/json" -X GET http://localhost:8080/midpoint/ws/rest/accessCertificationCampaigns/3a0fb4a2-ffbd-4e72-bbff-47327df054c4?options=raw -v
curl --user administrator:y0uR_P455woR*d \
-H "Accept: application/json" \
-X GET http://localhost:8080/midpoint/ws/rest/accessCertificationCampaigns/3a0fb4a2-ffbd-4e72-bbff-47327df054c4?options=raw \
-v
----

The response is an HTTP 200 code in case of success with a response body containing the queried item.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
[source,bash]
.Get Case for Employee assignment
----
curl --user administrator:y0uR_P455woR*d -H "Accept: application/json" -X GET 'http://localhost:8080/midpoint/ws/rest/cases/3091ccc5-f3f6-4a06-92b5-803afce1ce57?options=raw&options=resolveNames' -v
curl --user administrator:y0uR_P455woR*d \
-H "Accept: application/json" \
-X GET 'http://localhost:8080/midpoint/ws/rest/cases/3091ccc5-f3f6-4a06-92b5-803afce1ce57?options=raw&options=resolveNames' \
-v
----

The response is an HTTP 200 code in case of success with a response body containing the queried item.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ Look for the *"targetName"* parameter in the output of the request.

[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Accept: application/json" -X GET http://localhost:8080/midpoint/ws/rest/users/00000000-0000-0000-0000-000000000002?options=resolveNames -v
curl --user administrator:y0uR_P455woR*d \
-H "Accept: application/json" \
-X GET http://localhost:8080/midpoint/ws/rest/users/00000000-0000-0000-0000-000000000002?options=resolveNames \
-v
----

.Example Output for "Get user with direct and indirect assignments"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
:page-visibility: hidden
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Accept: application/json" -X GET http://localhost:8080/midpoint/ws/rest/orgs/e5ae2f30-141c-4990-8387-4c8e7433132d?options=raw -v
curl --user administrator:y0uR_P455woR*d \
-H "Accept: application/json" \
-X GET http://localhost:8080/midpoint/ws/rest/orgs/e5ae2f30-141c-4990-8387-4c8e7433132d?options=raw \
-v
----

The response is an HTTP 200 code in case of success with a response body containing the queried item.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
:page-visibility: hidden
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Accept: application/json" -X GET http://localhost:8080/midpoint/ws/rest/reports/4de173d5-4dff-4e4f-bfb8-47f951f26637?options=raw -v
curl --user administrator:y0uR_P455woR*d \
-H "Accept: application/json" \
-X GET http://localhost:8080/midpoint/ws/rest/reports/4de173d5-4dff-4e4f-bfb8-47f951f26637?options=raw \
-v
----

The response is an HTTP 200 code in case of success with a response body containing the queried item.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
:page-visibility: hidden
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Accept: application/json" -X GET http://localhost:8080/midpoint/ws/rest/resources/ef2bc95b-76e0-59e2-86d6-9999cccccccc?options=raw -v
curl --user administrator:y0uR_P455woR*d \
-H "Accept: application/json" \
-X GET http://localhost:8080/midpoint/ws/rest/resources/ef2bc95b-76e0-59e2-86d6-9999cccccccc?options=raw \
-v
----

The response is an HTTP 200 code in case of success with a response body containing the queried item.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
:page-visibility: hidden
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Accept: application/json" -X GET http://localhost:8080/midpoint/ws/rest/roles/00000000-0000-0000-0000-000000000008?options=raw -v
curl --user administrator:y0uR_P455woR*d \
-H "Accept: application/json" \
-X GET http://localhost:8080/midpoint/ws/rest/roles/00000000-0000-0000-0000-000000000008?options=raw \
-v
----

The response is an HTTP 200 code in case of success with a response body containing the queried item.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
.Get Shadow owner
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Accept: application/json" -X GET http://localhost:8080/midpoint/ws/rest/shadows/062ac29f-f296-4824-aeab-9a0feb9e8bd3/owner -v
curl --user administrator:y0uR_P455woR*d \
-H "Accept: application/json" \
-X GET http://localhost:8080/midpoint/ws/rest/shadows/062ac29f-f296-4824-aeab-9a0feb9e8bd3/owner \
-v
----

The response is an HTTP 200 code in case of success with a response body containing the queried item.
Expand Down
5 changes: 4 additions & 1 deletion docs/interfaces/rest/operations/examples/raw/get-task.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
:page-visibility: hidden
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Accept: application/json" -X GET http://localhost:8080/midpoint/ws/rest/tasks/6d13632c-6b75-4a33-9744-ec9523375f6b?options=raw -v
curl --user administrator:y0uR_P455woR*d \
-H "Accept: application/json" \
-X GET http://localhost:8080/midpoint/ws/rest/tasks/6d13632c-6b75-4a33-9744-ec9523375f6b?options=raw \
-v
----

The response is an HTTP 200 code in case of success with a response body containing the queried item.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Accept: application/json" -X GET http://localhost:8080/midpoint/ws/rest/users/00000000-0000-0000-0000-000000000002?options=raw -v
curl --user administrator:y0uR_P455woR*d \
-H "Accept: application/json" \
-X GET http://localhost:8080/midpoint/ws/rest/users/00000000-0000-0000-0000-000000000002?options=raw \
-v
----


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
:page-visibility: hidden
[source,bash]
----
# Authenticating with the credentials "administrator" and password "5ecr3t" on a localhost instance running on port 8080
curl --user administrator:5ecr3t -H "Accept: application/xml" -X GET http://localhost:8080/midpoint/ws/rest/self?options=raw
curl --user administrator:5ecr3t \
-H "Accept: application/xml" \
-X GET http://localhost:8080/midpoint/ws/rest/self?options=raw \
-v
----
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
.Execute the import operation for a Resource object in MidPoint
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Accept: application/json" -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/resources/ef2bc95b-76e0-59e2-86d6-9999cccccccc/import/AccountObjectClass -v
curl --user administrator:y0uR_P455woR*d \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-X POST http://localhost:8080/midpoint/ws/rest/resources/ef2bc95b-76e0-59e2-86d6-9999cccccccc/import/AccountObjectClass \
-v
----


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
.Import shadow
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Accept: application/json" -X POST http://localhost:8080/midpoint/ws/rest/shadows/062ac29f-f296-4824-aeab-9a0feb9e8bd3/import -v
curl --user administrator:y0uR_P455woR*d \
-H "Accept: application/json" \
-X POST http://localhost:8080/midpoint/ws/rest/shadows/062ac29f-f296-4824-aeab-9a0feb9e8bd3/import \
-v
----

The response is an HTTP 200 code in case of success with a response body containing the queried item.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
:page-visibility: hidden
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Content-Type: application/json" -X PATCH http://localhost:8080/midpoint/ws/rest/accessCertificationCampaigns/3a0fb4a2-ffbd-4e72-bbff-47327df054c4 --data-binary @pathToMidpointGit\samples\rest\modify-attribute-gen.json -v
curl --user administrator:y0uR_P455woR*d \
-H "Content-Type: application/json" \
-X PATCH http://localhost:8080/midpoint/ws/rest/accessCertificationCampaigns/3a0fb4a2-ffbd-4e72-bbff-47327df054c4 \
-v \
--data-binary @./samples/rest/modify-attribute-gen.json
----
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
:page-visibility: hidden
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Content-Type: application/json" -X PATCH http://localhost:8080/midpoint/ws/rest/cases/3091ccc5-f3f6-4a06-92b5-803afce1ce57 --data-binary @pathToMidpointGit\samples\rest\modify-attribute-gen.json
curl --user administrator:y0uR_P455woR*d \
-H "Content-Type: application/json" \
-X PATCH http://localhost:8080/midpoint/ws/rest/cases/3091ccc5-f3f6-4a06-92b5-803afce1ce57 \
-v \
--data-binary @./samples/rest/modify-attribute-gen.json
----
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
:page-visibility: hidden
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Content-Type: application/json" -X PATCH http://localhost:8080/midpoint/ws/rest/orgs/e5ae2f30-141c-4990-8387-4c8e7433132d --data-binary @pathToMidpointGit\samples\rest\modify-attribute-gen.json
curl --user administrator:y0uR_P455woR*d \
-H "Content-Type: application/json" \
-X PATCH http://localhost:8080/midpoint/ws/rest/orgs/e5ae2f30-141c-4990-8387-4c8e7433132d \
-v \
--data-binary @./samples/rest/modify-attribute-gen.json
----
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
:page-visibility: hidden
[source,bash]
----
curl --user administrator:y0uR_P455woR*d -H "Content-Type: application/json" -X PATCH http://localhost:8080/midpoint/ws/rest/reports/4de173d5-4dff-4e4f-bfb8-47f951f26637 --data-binary @pathToMidpointGit\samples\rest\modify-attribute-gen.json -v
curl --user administrator:y0uR_P455woR*d \
-H "Content-Type: application/json" \
-X PATCH http://localhost:8080/midpoint/ws/rest/reports/4de173d5-4dff-4e4f-bfb8-47f951f26637 \
-v \
--data-binary @./samples/rest/modify-attribute-gen.json
----

0 comments on commit 085b95b

Please sign in to comment.