Skip to content

Commit

Permalink
Merge branch 'docs/cleanup-4.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
matusmacik committed Feb 9, 2024
2 parents 93eaceb + 75a4b44 commit c3b39c1
Show file tree
Hide file tree
Showing 14 changed files with 136 additions and 62 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
:page-visibility: hidden

.Create a new Role object in MidPoint with file data source
[source,bash]
----
# 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/users --data-binary @pathToMidpointGit\samples\rest\role-employee.json -v
----

.*Show* data source example for *"Create a new User object in MidPoint"* | link:https://raw.githubusercontent.com/Evolveum/midpoint-samples/master/samples/rest/role-employee.json[GitHub]
[%collapsible]
====
[source, json]
----
----
====
The response is an HTTP 201 code in case of success *without* a response body.
Also, the response contains a *Location Header* pointing to the location of the created
user.
.Example location header
[source, bash]
----
----
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
.Create a new User object in MidPoint with file data source
[source,bash]
----
# Authenticating with the credentials "administrator" and password "5ecr3t" on a localhost instance running on port 8080
curl --user administrator:5ecr3t -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/users --data-binary @pathToMidpointGit\samples\rest\user-jack.json -v
# 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/users --data-binary @pathToMidpointGit\samples\rest\user-jack.json -v
----

.*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: 2 additions & 2 deletions docs/interfaces/rest/operations/examples/raw/delete-user.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.Delete a User type object
[source,bash]
----
# Authenticating with the credentials "administrator" and password "5ecr3t" on a localhost instance running on port 8080
curl --user administrator:5ecr3t -X DELETE http://localhost:8080/midpoint/ws/rest/users/e4b0c81e-7fc7-462d-a92c-b3e0b10b8b49 -v
# Authenticating with the credentials "administrator" and password "y0uR_P455woR*d" on a localhost instance running on port 8080
curl --user administrator:y0uR_P455woR*d -X DELETE http://localhost:8080/midpoint/ws/rest/users/e4b0c81e-7fc7-462d-a92c-b3e0b10b8b49 -v
----

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
@@ -0,0 +1,17 @@
:page-visibility: hidden
[source,bash]
----
# 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 "Accept: application/json" -X GET http://localhost:8080/midpoint/ws/rest/roles/00000000-0000-0000-0000-000000000008?options=raw
----

The response is an HTTP 200 code in case of success with a response body containing the queried item.

.Example Output of *"Get Role"* example
[%collapsible]
====
[source, json]
----
----
====
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
: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/json" -X GET http://localhost:8080/midpoint/ws/rest/users/00000000-0000-0000-0000-000000000002?options=raw
# 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 "Accept: application/json" -X GET http://localhost:8080/midpoint/ws/rest/users/00000000-0000-0000-0000-000000000002?options=raw
----
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
: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 "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
# 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
----
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.Create a new User object in MidPoint with file data source
[source,bash]
----
# Authenticating with the credentials "administrator" and password "5ecr3t" on a localhost instance running on port 8080
curl --user administrator:5ecr3t -H "Content-Type: application/xml" -X PATCH http://localhost:8080/midpoint/ws/rest/users/00000000-0000-0000-0000-000000000002 --data-binary @pathToMidpointGit\samples\rest\modify-user-assign-role-eu.xml
# 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/xml" -X PATCH http://localhost:8080/midpoint/ws/rest/users/00000000-0000-0000-0000-000000000002 --data-binary @pathToMidpointGit\samples\rest\modify-user-assign-role-eu.xml
----

.*Show* data source example for *"Create a new User object in MidPoint"* | link:https://raw.githubusercontent.com/Evolveum/midpoint-samples/master/samples/rest/modify-user-assign-role-eu.xml[GitHub]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:page-visibility: hidden
.Search for all users
[source,bash]
----
# 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 "Accept: application/json" -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/roles/search --data-binary @pathToMidpointGit\samples\rest\query-all.json -v
----
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
.Search for all users
[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/json" -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/users/search --data-binary @pathToMidpointGit\samples\rest\query-all.json -v
# 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 "Accept: application/json" -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/users/search --data-binary @pathToMidpointGit\samples\rest\query-all.json -v
----
46 changes: 14 additions & 32 deletions docs/interfaces/rest/operations/examples/raw/search-all.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,45 +26,27 @@ The response is an HTTP 200 code in case of success with a response body contain
"oid" : "",
"version" : "",
"name" : "",
"metadata" : {
"requestTimestamp" : "",
"requestorRef" : {
"oid" : "",
"relation" : "",
"type" : ""
},
"createTimestamp" : "",
"creatorRef" : {
"oid" : "",
"relation" : "",
"type" : ""
},
"createChannel" : ""
},
"metadata" : {},
"operationExecution": {},
"indestructible": ,
"iteration" : ,
"iterationToken" : ""
"iterationToken" : "",
"archetypeRef": {},
"roleMembershipRef": {},
"activation": {}
}, {
"@type" : "",
"oid" : "",
"version" : "",
"name" : "",
"metadata" : {
"requestTimestamp" : "",
"requestorRef" : {
"oid" : "",
"relation" : "",
"type" : ""
},
"createTimestamp" : "",
"creatorRef" : {
"oid" : "",
"relation" : "",
"type" : ""
},
"createChannel" : ""
},
"metadata" : {},
"operationExecution": {},
"indestructible": ,
"iteration" : ,
"iterationToken" : ""
"iterationToken" : "",
"archetypeRef": {},
"roleMembershipRef": {},
"activation": {}
} ]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
.Generate a password for user
[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/json" -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/users/e297a878-89da-43fa-b67a-d0316975388a/generate --data-binary @pathToMidpointGit\samples\rest\policy-items-password-generate.json
# 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 "Accept: application/json" -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/users/e297a878-89da-43fa-b67a-d0316975388a/generate --data-binary @pathToMidpointGit\samples\rest\policy-items-password-generate.json
----

.*Show* data source example for *"Generate a password for user"* | link:https://raw.githubusercontent.com/Evolveum/midpoint-samples/master/samples/rest/policy-items-password-generate.json[GitHub]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ page.
.Execute password reset for user
[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/json" -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/users/e297a878-89da-43fa-b67a-d0316975388a/credential --data-binary @pathToMidpointGit\samples\rest\user-pwd-reset.json
# 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 "Accept: application/json" -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/users/e297a878-89da-43fa-b67a-d0316975388a/credential --data-binary @pathToMidpointGit\samples\rest\user-pwd-reset.json
----

.*Show* data source example for *"Execute password reset for user"* | link:https://raw.githubusercontent.com/Evolveum/midpoint-samples/master/samples/rest/user-pwd-reset.json[GitHub]
Expand Down
46 changes: 44 additions & 2 deletions docs/interfaces/rest/resource-types/roles.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
:page-display-order: 300
:page-toc: top

== Description
== Role Type REST Endpoint

Here we are describing the Role object type in relation to midPoints REST API. The
Role objects are a part of the REST API web resources.
Expand All @@ -14,16 +14,58 @@ Role objects are a part of the REST API web resources.
roles/
----

== Applicable Operations
== Operations And Examples

The Role web resource is a part of the Create-Read-Update-Delete (CRUD) web resources
present in midPoint. This is apparent in the operations which are available for this type of object.


=== Create Role Objects

include::../operations/examples/raw/create-role-emloyee.adoc[]

- xref:/midpoint/reference/interfaces/rest/operations/create-op-rest/[Create Operation]

=== Get Role Objects

Get operation for fetching a single specific object.

.Get Default Administrator User with REST

include::../operations/examples/raw/get-role-end-user.adoc[]

- xref:/midpoint/reference/interfaces/rest/operations/get-op-rest/[Get Operation]

=== Search for Role Objects

Search operation usable for fetching the full list of objects or a list based on filter.

include::../operations/examples/raw/search-all-roles.adoc[]

include::../operations/examples/raw/search-all.adoc[]

- xref:/midpoint/reference/interfaces/rest/operations/search-op-rest/[Search Operation]

=== Modify Role Objects

include::../operations/examples/raw/modify-attr-role-employee.adoc[]

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

- xref:/midpoint/reference/interfaces/rest/operations/modify-op-rest/[Modify Operation]

=== Delete Role Objects

include::../operations/examples/raw/delete-role.adoc[]

- xref:/midpoint/reference/interfaces/rest/operations/delete-op-rest/[Delete Operation]

=== Generate and Validate Operations for Role Objects

Operations to generate or validate values, here we have an example of a simple password generate use-case.

include::../operations/examples/raw/user-pwd-generate.adoc[]

- xref:/midpoint/reference/interfaces/rest/operations/generate-and-validate-concrete-op-rest/[Generate and Validate Operations]

== JSON Example
Expand Down
23 changes: 11 additions & 12 deletions docs/interfaces/rest/resource-types/users.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@ users/
The User web resource is a part of the Create-Read-Update-Delete (CRUD) web resources
present in midPoint. This is apparent in the operations which are available for this type of object.

[cols="a"]
|===
|.Create

Object creation.
=== Create User Object

include::../operations/examples/raw/create-user-jack.adoc[]

- xref:/midpoint/reference/interfaces/rest/operations/create-op-rest/[Create Operation]

|.Get
=== Get User Object

Get operation for fetching a single specific object.

Expand All @@ -39,7 +36,7 @@ include::../operations/examples/raw/get-user-administrator.adoc[]

- xref:/midpoint/reference/interfaces/rest/operations/get-op-rest/[Get Operation]

|.Search
=== Search for User Objects

Search operation usable for fetching the full list of objects or a list based on filter.

Expand All @@ -49,37 +46,39 @@ include::../operations/examples/raw/search-all.adoc[]

- xref:/midpoint/reference/interfaces/rest/operations/search-op-rest/[Search Operation]

|.Modify
=== Modify User Objects

Object Modification.

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

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

- xref:/midpoint/reference/interfaces/rest/operations/modify-op-rest/[Modify Operation]
|.Delete

=== Delete User Objects

Object deletion.

include::../operations/examples/raw/delete-user.adoc[]

- xref:/midpoint/reference/interfaces/rest/operations/delete-op-rest/[Delete Operation]
|.User specific

=== User Object Specific Operations

A set of operations specific for the User REST objects. i.e. password reset and others.

include::../operations/examples/raw/user-pwd-reset.adoc[]

- xref:/midpoint/reference/interfaces/rest/operations/user-specific-op-rest/[User specific Operations]
|.Generate and Validate

=== Generate and Validate operations for User Objects

Operations to generate or validate values, here we have an example of a simple password generate use-case.

include::../operations/examples/raw/user-pwd-generate.adoc[]

- xref:/midpoint/reference/interfaces/rest/operations/generate-and-validate-concrete-op-rest/[Generate and Validate Operations]
|===

== Common Use-case Examples

1. xref:/midpoint/reference/interfaces/rest/operations/examples/create-user/[Create User]
Expand Down

0 comments on commit c3b39c1

Please sign in to comment.