Skip to content

AVEVA/sample-adh-bulk_upload-dotnet

Repository files navigation

Bulk Uploader SDS DotNet Sample

Version: 1.1.5

Build Status

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.

  1. Resource can usually be left as default, but should be the host specified at the beginning of the URL in the Cds API Console
  2. TenantId should be the ID that comes after /Tenants/ in the same URL
  3. NamespaceId should be the name of the Cds Namespace to send the data to
  4. ClientId should be the ID of a Client Credentials Client.
  5. ClientSecret should be the secret from the Client Credentials Client that was specified
  6. DataView is the path to the dataview json file.
  7. Type is the path to the type json file.
  8. Metadata is 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)
  9. Tags is 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)
  10. Data is 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)
  11. DataOnly is 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

  1. Clone the GitHub repository
  2. Open the folder with your favorite IDE
  3. Update appsettings.json with your credentials
  4. dotnet restore
  5. dotnet 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

About

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages