Skip to main content

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.

  1. Navigate to POST /EventRequest.
  2. Click Try it out.
  3. 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 DataModels table.
  • 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 DataModels table.
  • template: Event Frame template filter.
    • PI wildcards are supported: ? for a single character, * for multiple characters.
    • Use * to match all templates.
  • startTime: Earliest event lookup time.
    • Remove this field or set it to null to start from current time.
  • endTime: Latest event lookup time.
    • Remove this field or set it to null for continuous real-time scan.
  • requestType: Keep as StartScan.

After successful submission, the response returns the Event Request ID.

Retrieve Event Request Details

  1. Navigate to GET /EventRequest/{Id}.
  2. Click Try it out.
  3. Enter the Request ID from the previous step and click Execute.
  4. Copy the response output.

Submit the Event Request

  1. Navigate to PUT /EventRequest.
  2. Paste the output from GET /EventRequest/{Id}.
  3. Change state to "Submitted".
  4. Execute the request.

Troubleshooting

If errors occur (other than request formatting issues), first verify that the Event Frames Collector is running and correctly configured.

  1. On the Elevate VM, restart the Event Frames Collector service.
  2. 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:

  1. Run:
SELECT * FROM [dbo].[EventSources]

Record ServerId.

  1. 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.