Group Assignment Audit Report
Generates a group assignment audit report. The report contains details on the users and groups that were added to or removed from Access Control groups in a given date range. This report is in CSV format. Each row of the report provides the user or group that was added or removed, the group to which the user or group was added or removed from, the Service Administrator who performed the action, and the date and time when the action was completed. The API writes the report to the filename provided, and the report can then be downloaded using the Download REST API.
This is an asynchronous job and uses the job status URI to determine if the operation is complete.
The presence of status -1 in the response indicates that the generation of Group Assignment Audit Report is in progress. Use the job status URI to determine whether the generation of the report is complete. Any non-zero status except -1 indicates failure of generating the report.
This API is version v2.
Required Roles
-
Service Administrator
-
Any predefined role and the Access Control - Manage application role
-
Any predefined role and the Access Control - View application role
REST Resource
POST /interop/rest/{api_version}/reports/groupaudit
Note:
Before using the REST resources, you must understand how to access the REST resources and other important concepts. See Implementation Best Practices for EPM Cloud REST APIs. Using this REST API requires prerequisites. See Prerequisites.
Table 12-94 Tasks for Group Assignment Audit Report
Task | Request | REST Resource |
---|---|---|
Group Assignment Audit Report | POST |
|
Group Assignment Audit Report Status | GET |
|
Request
Supported Media Type: application/json
The following table summarizes the request parameters.
Table 12-95 Parameters
Name | Description | Type | Required | Default |
---|---|---|---|---|
api_version |
Specific API version | Path | Yes | None |
filename |
The CSV file where the report is to be populated, such as
|
Payload | Yes | None |
from_date |
The start date for the report (in YYYY-MM-DD format) | Payload | Yes | None |
to_date |
The end date for the report (in YYYY-MM-DD format) | Payload | Yes | None |
Example Payload
{
fileName":"groupauditreport_test.csv",
"from_date":"2022-03-26",
"to_date":"2022-05-30"
}
Response
Supported Media Types: application/json
Table 12-96 Parameters
Parameters | Description |
---|---|
details |
In case of errors, details are published with the error string |
status |
See Migration Status Codes |
links |
Detailed information about the link |
href |
Links to API call |
action |
The HTTP call type |
rel |
Can be self and/or Job Status . If set to Job Status , you can use the href to get the status of the import operation
|
data |
Parameters as key value pairs passed in the request |
Example of Response Body
The following shows an example of the response body in JSON format.
{
"links": [
{
"rel": "self",
"href": "https://<BASE-URL>/interop/rest/{api_version}/reports/groupaudit",
"data": null,
"action": "POST"
},
{
"rel": "Job Status",
"href": "https://<BASE-URL>/interop/rest/v2/jobs/3180621025673301",
"data": null,
"action": "GET"
}
],
"status": -1,
"details": null
}
Java Sample Code
Prerequisites: json.jar
Common Functions: See CSS Common Helper Functions for Java
//
//BEGIN
//
public void groupAssignmentAuditReport(String fileName, String from_date, String to_date)
throws Exception {
JSONObject params = new JSONObject();
params.put("fileName", fileName);
params.put("from_date", from_date);
params.put("to_date", to_date);
String urlString = String.format("%s/interop/rest/%s/reports/groupaudit", serverUrl, apiVersion);
String response = executeRequest(urlString, "POST", params.toString(), "application/json");
getJobStatus(fetchPingUrlFromResponse(response, "Job Status"), "GET");
}
//
// END
//
Shell Script Sample Code
Prerequisites: jq (http://stedolan.github.io/jq/download/linux64/jq)
Common Functions: See CSS Common Helper Functions for cURL
funcgroupAssignmentAuditReport () {
url=$SERVER_URL/interop/rest/v2/reports/groupaudit
fileName="groupAssignmentAuditReport.csv"
from_date="2022-03-01"
to_date="2022-05-30"
param="{\"fileName\":\"$fileName\",\"from_date\":\"$from_date\",\"to_date\":\"$to_date\"}"
funcExecuteRequest "POST" $url "$param" "application/json"
output=$(cat response.txt)
status=$(echo $output | jq '.status')
echo "Status :$status"
if [ $status == -1 ]; then
echo "group assignment audit report generation in progress"
funcGetStatus "GET"
else
error='echo $output | jq '.details''
echo "Error occured. " $error
fi
funcRemoveTempFiles "respHeader.txt" "response.txt"
}
Groovy Sample Code
Common Functions: See CSS Common Helper Functions for Groovy
def groupAssignmentAuditReport (fileName, from_date, to_date) {
String scenario = "Group Assignment Audit Report";
def url;
def payload = new JsonBuilder()
payload fileName:fileName,
from_date:from_date,
to_date:to_date
url = new URL(serverUrl + "/interop/rest/v2/reports/groupaudit");
params=payload.toString();
response = executeRequest(url, "POST", params, "application/json");
if (response != null) {
getJobStatus(getUrlFromResponse(scenario, response, "Job Status"), "GET");
}
}