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 6823833 + 33f8ecd commit 34d289d
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 13 deletions.
8 changes: 5 additions & 3 deletions docs/interfaces/rest/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
:page-alias: { "parent" : "/midpoint/features/current/" }
:page-upkeep-status: orange
:page-toc: top
:page-keywords: [ 'rest', 'restful', 'api', 'web', 'service', 'interface', 'ui', 'operations' ]


//TODO ask about the version

Expand All @@ -27,11 +29,11 @@ access and interact with the data present in your midPoint instance.
The REST api gives you a feature rich toolset with which you can operate over different
*web resources*, these are represented as specific endpoints to which you send your operation request.

There are many possibilities which we provide in regard to the web resources you can access. So many
There are many possibilities which we provide in regard to the endpoints you can access. So many
that we have a dedicated page for them.

.To display a *list of the types of resources* please have a look at:
xref:/midpoint/reference/interfaces/rest/resource-types/[Web Resource Types]
.To display a *list of REST endpoints* please have a look at:
xref:/midpoint/reference/interfaces/rest/resource-types/[REST Endpoints]

.For a *more technical description* of our REST api please have a look here:
xref:/midpoint/reference/interfaces/rest/concepts/[Concepts]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@
[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
curl --user administrator:y0uR_P455woR*d -H "Content-Type: application/json" -X POST http://localhost:8080/midpoint/ws/rest/roles --data-binary @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]
.*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]
[%collapsible]
====
[source, json]
----
{
"role": {
"name": "employee",
"displayName": "Basic Employee"
}
}
----
====
Expand All @@ -23,5 +28,5 @@ user.
.Example location header
[source, bash]
----
Location: http://localhost:8080/midpoint/ws/rest/roles/76fcec3e-7224-435e-8c9b-7532f081d8b0
----
9 changes: 9 additions & 0 deletions docs/interfaces/rest/operations/examples/raw/delete-role.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
:page-visibility: hidden
.Delete a User type object
[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 -X DELETE http://localhost:8080/midpoint/ws/rest/roles/76fcec3e-7224-435e-8c9b-7532f081d8b0 -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
Expand Up @@ -2,16 +2,35 @@
[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
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.

.Example Output of *"Get Role"* example
[%collapsible]
====
The example is *simplified*, some properties were removed to keep the example output "short". This example *does
not* contain all possible properties of this object type.
[source, json]
----
{
"role": {
"oid": "00000000-0000-0000-0000-000000000008",
"version": "1",
"name": "End user",
"description": "Role authorizing end users to log in, change their passwords and review assigned accounts. Note: This role definition is just an example. It should be tailored for each specific deployment.",
"metadata": {
},
"operationExecution": {
},
"iteration": 0,
"iterationToken": "",
"activation": {
},
"authorization": [],
"adminGuiConfiguration": {}
}
}
----
====
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
: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 "Content-Type: application/json" -X PATCH http://localhost:8080/midpoint/ws/rest/roles/76fcec3e-7224-435e-8c9b-7532f081d8b0 --data-binary @pathToMidpointGit\samples\rest\modify-attribute-gen.json
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
:page-visibility: hidden

.*Show* data source example for *"Generate identifier for object"* | link:https://raw.githubusercontent.com/Evolveum/midpoint-samples/master/samples/rest/policy-items-identifier-generate.json[GitHub]
[%collapsible]
====
[source, json]
----
{
"policyItemsDefinition": {
"policyItemDefinition": {
"target": {
"path": "identifier"
},
"execute": "true"
}
}
}
----
====
The response is an HTTP 200 code in case of success with a response body.
.*Show* example output for *"Generate identifier for object"*
[%collapsible]
====
[source, json]
----
{
"@ns" : "http://prism.evolveum.com/xml/ns/public/types-3",
"object" : {
"@type" : "http://midpoint.evolveum.com/xml/ns/public/common/api-types-3#PolicyItemsDefinitionType",
"policyItemDefinition" : [ {
"target" : {
"path" : "identifier"
},
"value" : {
"@type" : "xsd:string",
"@value" : "s2cMJrD5^21"
},
"execute" : true
} ]
}
}
----
====
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:page-visibility: hidden
.Generate identifier for Role type object
[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/ae660563-11e6-41e1-8920-82725cc77021/generate --data-binary @pathToMidpointGit\samples\rest\policy-items-identifier-generate.json -v
----
8 changes: 5 additions & 3 deletions docs/interfaces/rest/resource-types/roles.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ present in midPoint. This is apparent in the operations which are available for

=== Create Role Objects

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

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

Expand Down Expand Up @@ -62,9 +62,11 @@ include::../operations/examples/raw/delete-role.adoc[]

=== 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.
Operations to generate or validate values, here we have an example of a simple identifier generate use-case.

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion docs/interfaces/rest/resource-types/users.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
= User Type REST Endpoint
:page-nav-title: User Type
:page-nav-title: User
:page-display-order: 200
:page-toc: top

Expand Down

0 comments on commit 34d289d

Please sign in to comment.