Setting Up Event Frames Ingestion via API
This article provides a step-by-step guide to set up Event Frames ingestion.
Access the Swagger UI
The Swagger UI is hosted on the Tag Controller Function App.
To access it, append /api/swagger/ui to the Tag Controller URL. Example:
https://func-tagcontroller-customer.azurewebsites.net/api/swagger/ui
Create the Event Request
Creating an Event Request is similar to creating a History Upload Request, but specific to Event Frames.
- Navigate to
POST /EventRequest. - Click Try it out.
- Update the payload values and submit.
Example payload:
{
"serverName": "--string--",
"database": "--string--",
"template": "--string--",
"startTime": "2023-05-01T00:00:00Z",
"endTime": "---end-time---",
"requestType": "StartScan"
}
Use the following value guidance:
serverName: AF Server name. It must match what is configured in Fusion.- You can find it in the top-level hierarchy of Fusion Data Trender or in the ADX
DataModelstable.
- You can find it in the top-level hierarchy of Fusion Data Trender or in the ADX
database: AF Database name. It must also match Fusion configuration.- You can find it in the second-level hierarchy of Fusion Data Trender or in the ADX
DataModelstable.
- You can find it in the second-level hierarchy of Fusion Data Trender or in the ADX
template: Event Frame template filter.- PI wildcards are supported:
?for a single character,*for multiple characters. - Use
*to match all templates.
- PI wildcards are supported:
startTime: Earliest event lookup time.- Remove this field or set it to
nullto start from current time.
- Remove this field or set it to
endTime: Latest event lookup time.- Remove this field or set it to
nullfor continuous real-time scan.
- Remove this field or set it to
requestType: Keep asStartScan.
After successful submission, the response returns the Event Request ID.
Retrieve Event Request Details
- Navigate to
GET /EventRequest/{Id}. - Click Try it out.
- Enter the Request ID from the previous step and click Execute.
- Copy the response output.
Submit the Event Request
- Navigate to
PUT /EventRequest. - Paste the output from
GET /EventRequest/{Id}. - Change state to
"Submitted". - Execute the request.
Troubleshooting
If errors occur (other than request formatting issues), first verify that the Event Frames Collector is running and correctly configured.
- On the Elevate VM, restart the Event Frames Collector service.
- If it does not start, verify the service credentials.
Error: "No matching event server and source found."
If this error appears, verify that serverName and database are correct.
In the Tag Controller database query editor:
- Run:
SELECT * FROM [dbo].[EventSources]
Record ServerId.
- Run:
SELECT * FROM [dbo].[Servers]
Find the matching ServerId. The Name value is the server name required for the request.
Additional checks:
- Review Event Frames Collector logs on the Elevate VM.
- Verify a regular Data Request UI request (single tag) works.
- Check Application Insights for errors.
- Confirm the service account can access PI System Explorer:
- On the Elevate VM, right-click PI System Explorer, select Run as, and enter the service account credentials.
Issue: Request Stuck in "Processing"
Check Application Insights with:
traces | where cloud_RoleName == 'your tag controller name'
In one known scenario, the error was:
No collector found for event request 168 on server after filtering by server.
For this case, add a server alias in the Tag Controller database:
UPDATE [dbo].[Servers]
SET Aliases = 'MyCurrentAFServer'
WHERE ServerId = TheServerId
Then create a new request using the server name shown in the Trender hierarchy.