Table of Contents

Building a GQI data source that fetches satellites

In this tutorial, you will learn how you can create a GQI data source that can be used to add ad hoc data to a dashboard or low-code app.

Expected duration: 15 minutes.

Tip

See also: Kata #4: Build your first GQI on DataMiner Dojo Video

Note

This tutorial uses DataMiner version 10.3.0.

Prerequisites

Overview

Step 1: Get a quick start from the catalog

  1. Go to https://catalog.dataminer.services/details/package/5406

  2. Deploy the catalog item to your DataMiner Agent by clicking the Deploy button.

Step 2: Open the data source in Visual Studio

  1. Open Visual Studio and select Extensions > DIS > DMA > Connect to connect DIS to your DMA.

  2. Select Extensions > DIS > DMA > Import Automation Script.

  3. Select Satellites - GQIDS and click Import.

  4. Go to the C# code of the imported Automation script by clicking the C# icon.

    C# icon

Note

If certain types cannot be found in the file, verify if the Skyline.DataMiner.Dev.Automation NuGet package has the correct version. Go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution. Select Skyline.DataMiner.Dev.Automation, and verify whether the version installed for the current project is at least 10.2.4.

Step 3: Complete the data source

  1. Add the IGQIDataSource interface to the SatellitesDataSource class. Do this by removing the comments (//) in front of IGQIDataSource.

  2. Implement the GetColumns method to provide GQI with all the columns of the data source.

        public GQIColumn[] GetColumns()
        {
            return new GQIColumn[] {
                new GQIStringColumn("Name"),
                new GQIDoubleColumn("Latitude"),
                new GQIDoubleColumn("Longitude")
            };
        }
    
  3. Implement the GetNextPage method to provide GQI with the actual data. Each row is one satellite.

        public GQIPage GetNextPage(GetNextPageInputArgs args)
        {
            var satellites = _satellitesHelper.GetSatellites().Take(100);
            var rows = new List<GQIRow>();
            foreach (var satellite in satellites) {
                var cells = new GQICell[] {
                    new GQICell(){ Value = satellite.Name },
                    new GQICell(){ Value = satellite.Latitude},
                    new GQICell() { Value = satellite.Longitude}
                };
                var row = new GQIRow(cells);
                rows.Add(row);
            }
    
            return new GQIPage(rows.ToArray());
        }
    

    By implementing both methods provided by the IGQIDataSource interface, you have now successfully finished the data source.

  4. To publish your changes, go to the XML file and click Publish in the top left corner.

    Publish option

Step 4: Use the data source

  1. Open the Dashboards app and create a new dashboard.

  2. In the data pane on the right, go to Queries and click the "+" icon to create a query.

    + icon to create query

  3. Select Get ad hoc data and select Satellites as Data source option.

  4. Drag the query to the dashboard.

  5. Select a table visualization for the component.

    The satellites should now be displayed in the table.