We have a tool that uses the API to read the tables used for the time trace data. Adding the History Database... the data as expected gets moved to the History DB. Is there a way to access the history database from the API/App Server?
-Josh
We have a tool that uses the API to read the tables used for the time trace data. Adding the History Database... the data as expected gets moved to the History DB. Is there a way to access the history database from the API/App Server?
-Josh
When you say API/App Server, do you refer to the REST API or if it is possible to access the historical data using the object layer?
REST API. Do we have to install a second instance pointed to the History DB? Is that possible?
I have never seen that someone has installed an application server against a History DB installation. So it would be a first one for you to try. Theoretically, you should be able to access the History DB tables then but again, I have never tried or seen that before.
For the object layer, there are methods and functions available to access and retrieve historical objects. But if you want to access the data using the REST API you would need to wrap that in calls to scripts that return a single value, potentially a JSON.
What is your use-case for using the REST API to access the historical data from the History DB?
We present the Time Trace data on a customer focused web application.
What methods are you referring to? What would be the best way to retrieve all the time trace data for a single person record? Currently I read 4 or 5 different tables and piece a picture together.
Then my last post is everything I've got. Create custom scripts that fetch the data according to your use-case and return a JSON formatted result. This would be my solution.
At first glance seems a second API/App server instance works. Thanks.
At first glance seems a second API/App server instance works. Thanks.
Okay. A sample for using the object layer in a script to access the changes from TimeTrace for an object would be the following function:
Public Function SDK_GetHistory(ByVal objectKey As String, Optional BackTo As DateTime = Nothing) As String ' Resolve history source Dim source = Session.Resolve(Of History.IHistorySource)() ' Fetch an enumerator over all change infos in descending date order (based on objectkey) Dim changes = source.GetChangesAsync(New DbObjectKey(objectKey), BackTo, History.HistoryMode.WithNewValues Or History.HistoryMode.WithFkDisplays).Result ' Initialize StringBuilder Dim strChanges As StringBuilder = New StringBuilder(512) strChanges.AppendLine("Changed at;Changed by;Operation;ColumnName;OldValue;NewValue;OldValueDisplay;NewValueDisplay") ' Iterate over each change For Each change In changes ' Iterate over every changed column For Each column In change.Changes ' Do something with the data. strChanges.AppendLine(String.Format("{0};{1};{2};{3};{4};{5};{6};{7}", change.ChangeTime.ToString, change.User, change.ChangeType.ToString, column.Columnname, column.OldValue, column.OldDisplay, column.NewValue, column.NewDisplay)) Next Next Return strChanges.ToString End Function
Nice! Is there a document on how to make scripts available to the REST API/App Server/Swagger? I know its possible... just not sure on permissions etc.
You will find the explanation about the permissions needed (program functions in this case) in the following thread https://www.quest.com/community/one-identity/identity-manager/f/identity-manager-forum/21567/calling-scripts-via-application-server-restful-api-using-common_startscripts-permission-not-working
What other methods are available besides GetChangesAsync? Is there GetDeletesAsync? Etc?
There is no such method, but the returned list of changes of IObjectChangeInfo contain a ChangeType property that adheres to the enumeration with the same name.
Take a look at the file OneIM_QBM_ObjectLayer.chm in the folder Documentation\en-US of your One Identity Manager installation. Search for IHistorySource interface and VI.DB.History namespace to find more information.