reports/
Report Type REST Endpoint
Description
Here we are describing the Report object type in relation to midPoints REST API. The Report objects are a part of the REST API web resources.
Operations And Examples
The Reports endpoint operations and examples.
In our examples we are authenticating with the credentials, name "administrator" and password "y0uR_P455woR*d" on a localhost instance running on port 8080. |
For some help regarding the REST examples please see this link:
Create Report Object
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" | GitHub
{
"report" : {
"name" : "All error audit records in 24h",
"description" : "Report made from all audit records.",
"assignment" : {
"@id" : 1,
"identifier" : "archetype",
"targetRef" : {
"oid" : "00000000-0000-0000-0000-000000000171",
"relation" : "org:default",
"type" : "c:ArchetypeType"
}
},
"archetypeRef" : {
"oid" : "00000000-0000-0000-0000-000000000171",
"relation" : "org:default",
"type" : "c:ArchetypeType"
},
"roleMembershipRef" : {
"oid" : "00000000-0000-0000-0000-000000000171",
"relation" : "org:default",
"type" : "c:ArchetypeType"
},
"objectCollection" : {
"collection" : {
"baseCollectionRef" : {
"collectionRef" : {
"oid" : "00000000-0000-0000-0001-000000000004",
"relation" : "org:default",
"type" : "c:ObjectCollectionType"
}
}
},
"parameter" : [ {
"@id" : 2,
"name" : "outcome",
"type" : "#OperationResultStatusType",
"display" : {
"label" : {
"orig" : "outcome",
"norm" : "outcome",
"translation" : {
"key" : "AuditEventRecordType.outcome"
}
}
}
}, {
"@id" : 3,
"name" : "eventType",
"type" : "#AuditEventTypeType",
"display" : {
"label" : {
"orig" : "eventType",
"norm" : "eventtype",
"translation" : {
"key" : "AuditEventRecordType.eventType"
}
}
}
}, {
"@id" : 4,
"name" : "eventStage",
"type" : "#AuditEventStageType",
"display" : {
"label" : {
"orig" : "eventStage",
"norm" : "eventstage",
"translation" : {
"key" : "AuditEventRecordType.eventStage"
}
}
}
}, {
"@id" : 5,
"name" : "from",
"type" : "#dateTime",
"display" : {
"label" : {
"orig" : "from",
"norm" : "from",
"translation" : {
"key" : "AuditPopupPanel.dateFrom"
}
}
}
}, {
"@id" : 6,
"name" : "to",
"type" : "#dateTime",
"display" : {
"label" : {
"orig" : "to",
"norm" : "to",
"translation" : {
"key" : "AuditPopupPanel.dateTo"
}
}
}
}, {
"@id" : 7,
"name" : "targetRef",
"type" : "c:ObjectReferenceType",
"display" : {
"label" : {
"orig" : "targetRef",
"norm" : "targetref",
"translation" : {
"key" : "AuditEventRecordType.targetRef"
}
}
}
}, {
"@id" : 8,
"name" : "initiatorRef",
"type" : "c:ObjectReferenceType",
"display" : {
"label" : {
"orig" : "initiatorRef",
"norm" : "initiatorref",
"translation" : {
"key" : "AuditEventRecordType.initiatorRef"
}
}
}
} ]
}
}
}
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.
Location: http://localhost:8080/midpoint/ws/rest/reports/4de173d5-4dff-4e4f-bfb8-47f951f26637
Get Reports Type Objects
Get operation for fetching a single specific object.
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.
Example Output of "Get Report object" example
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.
{
"report": {
"oid": "4de173d5-4dff-4e4f-bfb8-47f951f26637",
"version": "1",
"name": "All error audit records in 24h",
"description": "Report made from all audit records.",
"metadata": {},
"operationExecution": {},
"assignment": {
"@id": 1,
"identifier": "archetype",
"metadata": {},
"targetRef": {
"oid": "00000000-0000-0000-0000-000000000171",
"relation": "org:default",
"type": "c:ArchetypeType"
}
},
"iteration": 0,
"iterationToken": "",
"archetypeRef": {
"oid": "00000000-0000-0000-0000-000000000171",
"relation": "org:default",
"type": "c:ArchetypeType"
},
"roleMembershipRef": {
"@metadata": {},
"oid": "00000000-0000-0000-0000-000000000171",
"relation": "org:default",
"type": "c:ArchetypeType"
},
"objectCollection": {
"collection": {
"baseCollectionRef": {
"collectionRef": {
"oid": "00000000-0000-0000-0001-000000000004",
"relation": "org:default",
"type": "c:ObjectCollectionType"
}
}
},
"parameter": [
{
"@id": 2,
"name": "outcome",
"type": "#OperationResultStatusType",
"display": {
"label": {
"orig": "outcome",
"norm": "outcome",
"translation": {
"key": "AuditEventRecordType.outcome"
}
}
}
},
{
"@id": 3,
"name": "eventType",
"type": "#AuditEventTypeType",
"display": {
"label": {
"orig": "eventType",
"norm": "eventtype",
"translation": {
"key": "AuditEventRecordType.eventType"
}
}
}
},
{
"@id": 4,
"name": "eventStage",
"type": "#AuditEventStageType",
"display": {
"label": {
"orig": "eventStage",
"norm": "eventstage",
"translation": {
"key": "AuditEventRecordType.eventStage"
}
}
}
},
{
"@id": 5,
"name": "from",
"type": "#dateTime",
"display": {
"label": {
"orig": "from",
"norm": "from",
"translation": {
"key": "AuditPopupPanel.dateFrom"
}
}
}
},
{
"@id": 6,
"name": "to",
"type": "#dateTime",
"display": {
"label": {
"orig": "to",
"norm": "to",
"translation": {
"key": "AuditPopupPanel.dateTo"
}
}
}
},
{
"@id": 7,
"name": "targetRef",
"type": "c:ObjectReferenceType",
"display": {
"label": {
"orig": "targetRef",
"norm": "targetref",
"translation": {
"key": "AuditEventRecordType.targetRef"
}
}
}
},
{
"@id": 8,
"name": "initiatorRef",
"type": "c:ObjectReferenceType",
"display": {
"label": {
"orig": "initiatorRef",
"norm": "initiatorref",
"translation": {
"key": "AuditEventRecordType.initiatorRef"
}
}
}
}
]
}
}
}
Search for Report Type Objects
Search operation usable for fetching the full list of objects or a list based on filter.
curl --user administrator:y0uR_P455woR*d \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-X POST http://localhost:8080/midpoint/ws/rest/reports/search?options=resolveNames \
-v \
--data-binary @./samples/rest/query-all.json -v
Show data source example for "Search for all" | GitHub
{
"query" : ""
}
The response is an HTTP 200 code in case of success with a response body containing the queried items.
Example Output is a list of objects.
{
"@ns": "http://prism.evolveum.com/xml/ns/public/types-3",
"object": {
"@type": "http://midpoint.evolveum.com/xml/ns/public/common/api-types-3#ObjectListType",
"object": [
{
"@type": "c:ReportType",
"oid": "00000000-0000-0000-0000-000000000080",
"version": "1",
"name": "All audit records report",
"description": "Report made from all audit records.",
"metadata": {},
"operationExecution": {},
"assignment": {},
"iteration": 0,
"iterationToken": "",
"archetypeRef": {},
"roleMembershipRef": {},
"objectCollection": {}
}
]
}
}
Show data source example for "Search for all" | GitHub
{
"query" : ""
}
The response is an HTTP 200 code in case of success with a response body containing the queried items.
Example Output is a list of objects.
{
"@ns" : "http://prism.evolveum.com/xml/ns/public/types-3",
"object" : {
"@type" : "http://midpoint.evolveum.com/xml/ns/public/common/api-types-3#ObjectListType",
"object" : [ {
"@type" : "",
"oid" : "",
"version" : "",
"name" : "",
"metadata" : {},
"operationExecution": {},
"indestructible": ,
"iteration" : ,
"iterationToken" : "",
"archetypeRef": {},
"roleMembershipRef": {},
"activation": {}
}, {
"@type" : "",
"oid" : "",
"version" : "",
"name" : "",
"metadata" : {},
"operationExecution": {},
"indestructible": ,
"iteration" : ,
"iterationToken" : "",
"archetypeRef": {},
"roleMembershipRef": {},
"activation": {}
} ]
}
}
Modify report Type Objects
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
Delete Reports Type Objects
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.
Generate and Validate Operations for Reports Type Objects
Operations to generate or validate values.
JSON Example
Example output of information regarding a specific Report object. Some parts of the example might have been removed or simplified for the purpose of the example.
Show JSON Example
{
"report": {
"oid": "4de173d5-4dff-4e4f-bfb8-47f951f26637",
"version": "1",
"name": "All error audit records in 24h",
"description": "Report made from all audit records.",
"metadata": {},
"operationExecution": {},
"assignment": {
"@id": 1,
"identifier": "archetype",
"metadata": {},
"targetRef": {
"oid": "00000000-0000-0000-0000-000000000171",
"relation": "org:default",
"type": "c:ArchetypeType"
}
},
"iteration": 0,
"iterationToken": "",
"archetypeRef": {
"oid": "00000000-0000-0000-0000-000000000171",
"relation": "org:default",
"type": "c:ArchetypeType"
},
"roleMembershipRef": {
"@metadata": {},
"oid": "00000000-0000-0000-0000-000000000171",
"relation": "org:default",
"type": "c:ArchetypeType"
},
"objectCollection": {
"collection": {
"baseCollectionRef": {
"collectionRef": {
"oid": "00000000-0000-0000-0001-000000000004",
"relation": "org:default",
"type": "c:ObjectCollectionType"
}
}
},
"parameter": [
{
"@id": 2,
"name": "outcome",
"type": "#OperationResultStatusType",
"display": {
"label": {
"orig": "outcome",
"norm": "outcome",
"translation": {
"key": "AuditEventRecordType.outcome"
}
}
}
},
{
"@id": 3,
"name": "eventType",
"type": "#AuditEventTypeType",
"display": {
"label": {
"orig": "eventType",
"norm": "eventtype",
"translation": {
"key": "AuditEventRecordType.eventType"
}
}
}
},
{
"@id": 4,
"name": "eventStage",
"type": "#AuditEventStageType",
"display": {
"label": {
"orig": "eventStage",
"norm": "eventstage",
"translation": {
"key": "AuditEventRecordType.eventStage"
}
}
}
},
{
"@id": 5,
"name": "from",
"type": "#dateTime",
"display": {
"label": {
"orig": "from",
"norm": "from",
"translation": {
"key": "AuditPopupPanel.dateFrom"
}
}
}
},
{
"@id": 6,
"name": "to",
"type": "#dateTime",
"display": {
"label": {
"orig": "to",
"norm": "to",
"translation": {
"key": "AuditPopupPanel.dateTo"
}
}
}
},
{
"@id": 7,
"name": "targetRef",
"type": "c:ObjectReferenceType",
"display": {
"label": {
"orig": "targetRef",
"norm": "targetref",
"translation": {
"key": "AuditEventRecordType.targetRef"
}
}
}
},
{
"@id": 8,
"name": "initiatorRef",
"type": "c:ObjectReferenceType",
"display": {
"label": {
"orig": "initiatorRef",
"norm": "initiatorref",
"translation": {
"key": "AuditEventRecordType.initiatorRef"
}
}
}
}
]
}
}
}