User Access Report (v1)
Generates an access report of users in the system and writes the report to the filename provided. This report can then be downloaded using the download command.
This is an asynchronous job and uses the job status URI to determine if the operation is complete.
This API is version v1.
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?q={type:provisionreport,fileName:provreport.csv,format:simplified,usertype,serviceusers}
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-65 Tasks for User Access Report
Task | Request | REST Resource |
---|---|---|
User Access Report | POST |
|
Request
Supported Media Types: application/json
The following table summarizes the request parameters.
Table 12-66 Parameters
Name | Description | Type | Required | Default |
---|---|---|---|---|
api_version |
Specific API version | Path | Yes | None |
fileName |
File where report is to be populated | Query | Yes | None |
type |
Type of report being generated: provisionreport |
Query | Yes | None |
format |
The format of the csv file, classic or
simplified |
Query | No | classic |
usertype |
Wheter to generate the report only for Identity Domain Administrators,
IDAdmins or ServiceUsers |
Query | No | ServiceUsers |
Response
Supported Media Types: application/json
Table 12-67 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.
Example 1: Job is in Progress
{
"links": [
{
"rel": "self",
"href": "https://<BASE-URL>/interop/rest/{api_version}/reports?q={type=provisionreport,fileName=provreport.csv,format=simplified,usertype=serviceusers}",
"data": null,
"action": "POST"
},
{
"rel": "Job Status",
"href": "https://<BASE-URL>/interop/rest/v1/reports/3180399797144693",
"data": null,
"action": "GET"
}
],
"status": -1,
"details": null
}
Java Sample – ProvisionReport.java
Prerequisites: json.jar
Common Functions: See Common Helper Functions for Java
//
// BEGIN
//
public void provisionReport (String fileName, String type) throws Exception {
JSONObject params = new JSONObject();
params.put("fileName",java.net.URLEncoder.encode(fileName));
params.put("type",java.net.URLEncoder.encode(type));
params.put("format","simplified");
params.put("usertype","usertype","serviceusers"));
String urlString = String.format("%s/interop/rest/%s/reports?q=%s", serverUrl, lcmVersion, params.toString());
String response = executeRequest(urlString, "POST", params.toString(), "application/x-www-form-urlencoded");
getJobStatus(fetchPingUrlFromResponse(response, "Job Status"),"GET");
}
//
// END
//
cURL Sample – provisionreport.sh
Prerequisites: jq (http://stedolan.github.io/jq/download/linux64/jq)
Common Functions: See Common Helper Functions for cURL
funcProvisionReport () {
url=$SERVER_URL/interop/rest/$LCM_VERSION/reports/
param=$(echo "q={type:$reporttype,fileName:$fileName,format:$mode,usertype:$usertype}" | sed -f urlencode.sed)
url=$url?$param
funcExecuteRequest "POST" $url $param "application/json"
output='cat response.txt'
status='echo $output | jq '.status''
if [ $status == -1 ]; then
echo "copying snapshot in progress"
funcGetStatus "GET"
else
error='echo $output | jq '.details''
echo "Error occured. " $error
fi
funcRemoveTempFiles "respHeader.txt" "response.txt"
}
Groovy Sample – provisionreport.groovy
Prerequisites: json.jar
Common Functions: See CSS Common Helper Functions for Groovy
def provisionReport (fileName, type) {
def url;
JSONObject param = new JSONObject();
try {
param.put("fileName",fileName);
param.put("type",type);
param.put("format",mode);
param.put("usertype",usertype);
url = new URL(serverUrl + "/interop/rest/" + lcmVersion + "/reports?q=" + param.toString());
} catch (MalformedURLException e) {
println "Malformed URL. Please pass valid URL"
System.exit(0);
}
response = executeRequest(url, "POST", param.toString(), "application/x-www-form-urlencoded");
if (response != null) {
getJobStatus(fetchPingUrlFromResponse(response, "Job Status"),"GET");
}
}