Bulk Uploader SDS DotNet Sample
August 1, 2024 ยท View on GitHub
Version: 1.1.5
Developed against DotNet 6.0.
About this sample
This sample uses SDS Cdsclients to send values, streams, types and dataviews. This simple sample sends SDS JSON messages that are saved pre-formed as files named sdsType.json, sdsStream.json, sdsdata{streamID}.json, dataview.json. It sends the files in that order. If there are metadata or tag files it will send that for the streams.
It does only basic error checking to make sure the message was accepted by the endpoint. The primary function of this sample is for easy bulk loading of data for other samples (particularly ML based samples where the amount of data is prohibitive to include in the sample itself). Included in the SampleCollections are the data sets including an editable appsettings.json.
Requirements
The .NET Core CLI is referenced in this sample, and should be installed to run the sample from the command line.
Configuration
This sample needs an OMF client credential created. For details on creating those see AVEVA Learning Channel.
Configure the sample using the file appsettings.placeholder.json. Before editing, rename this file to appsettings.json. This repository's .gitignore rules should prevent the file from ever being checked in to any fork or branch, to ensure credentials are not compromised.
Resourcecan usually be left as default, but should be the host specified at the beginning of the URL in the Cds API ConsoleTenantIdshould be the ID that comes after/Tenants/in the same URLNamespaceIdshould be the name of the Cds Namespace to send the data toClientIdshould be the ID of a Client Credentials Client.ClientSecretshould be the secret from the Client Credentials Client that was specifiedDataViewis the path to the dataview json file.Typeis the path to the type json file.Metadatais the path and start to the file name of the stream metadata json file. A streamId is appended to this to find the json file. (note streams must be sent too)Tagsis the path and start to the file name of the stream tags json file. A streamId is appended to this to find the json file. (note streams must be sent too)Datais the path and start to the file name of the stream data json file. A streamId is appended to this to find the json file. (note streams must be sent too)DataOnlyis a boolean to indicate there are data files and to infer the stream name from the file name, of what comes between sdsdata and the file extension .json
Running the Sample
- Clone the GitHub repository
- Open the folder with your favorite IDE
- Update
appsettings.jsonwith your credentials dotnet restoredotnet run
Running the Automated Test
From the command line, run
dotnet restore
dotnet test
For the main Cds bulk uploads samples page ReadMe
For the main Cds samples page ReadMe
For the AVEVA Samples landing page ReadMe