/delft-fews-rest-api-csharp-dotnet-sdk

Delft-FEWS Web Service C# SDK is automatically generated by the [OpenAPI Generator]. For more information see: https://publicwiki.deltares.nl/x/fwNdBw

Primary LanguageC#MIT LicenseMIT

Org.OpenAPITools - the C# library for the Delft-FEWS Web Services REST API v1

Delft-FEWS Web Services REST API v1. For more information see: https://publicwiki.deltares.nl/x/fwNdBw

This C# SDK is automatically generated by the OpenAPI Generator project:

  • API version: v1-2023-05-03T00:04:18Z
  • SDK version: 1.0.0
  • Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen

Frameworks supported

  • .NET Core >=1.0
  • .NET Framework >=4.6
  • Mono/Xamarin >=vNext

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.

Installation

Generate the DLL using your preferred tool (e.g. dotnet build)

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

Usage

To use the API client with a HTTP proxy, setup a System.Net.WebProxy

Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;

Getting Started

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class Example
    {
        public static void Main()
        {

            Configuration config = new Configuration();
            config.BasePath = "https://fewsdocs.deltares.nl/FewsWebServices/rest/fewspiservice/v1";
            // Configure Bearer token for authorization: Bearer
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new ArchiveApi(config);
            var documentFormat = "PI_JSON";  // string | Supported Document Format: PI_JSON,  (optional) 
            var documentVersion = "documentVersion_example";  // string | Document Version. Latest version is: 1.33 (optional) 

            try
            {
                // Returns the available areas for the open archive, netcdf-storage and the archive database
                PiRestArchiveAreas result = apiInstance.ArchiveAreas(documentFormat, documentVersion);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling ArchiveApi.ArchiveAreas: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://fewsdocs.deltares.nl/FewsWebServices/rest/fewspiservice/v1

Class Method HTTP request Description
ArchiveApi ArchiveAreas GET /archive/areas Returns the available areas for the open archive, netcdf-storage and the archive database
ArchiveApi ArchiveAttributes GET /archive/attributes Get attributes with their values that are available in the archive
ArchiveApi ArchiveLocations GET /archive/locations Get locations that are available in the archive
ArchiveApi ArchiveModuleinstances GET /archive/moduleinstances Returns the available module instaces for the netcdf storage
ArchiveApi ArchiveNetcdfstorageforecasts GET /archive/netcdfstorageforecasts Get forecasts with its attributes from the external netcdf storage from the archive
ArchiveApi ArchiveParameters GET /archive/parameters Get parameters that are available in the archive
ArchiveApi ArchiveProducts GET /archive/products Returns a zip-file with the requested products or a binary file if only one file is requested, that are available in the archive filtered by the specified parameters
ArchiveApi ArchiveProductsId GET /archive/products/id Return a specific product from the archive
ArchiveApi ArchiveProductsmetadata GET /archive/productsmetadata Returns a list of metadata found in the archive, where the T0 falls between the startForecastTime and endForecastTime
ArchiveApi ArchiveSources GET /archive/sources Returns the available sources for the open archive, netcdf-storage and the archive database
ArchiveApi PostArchiveProducts POST /archive/products upload new products to the archive
DisplaygroupsApi DisplaygroupsNodes GET /displaygroups/nodes Get all displaygroups nodes and its plots
DisplaygroupsApi DisplaygroupsPlot GET /displaygroups/plot Get a plot image from a display group using the display group id and the display id of the plot
EmbeddedApi FiltersSelected GET /filters/selected Get the currently selected filter ids in the Operator Client or a Stand Alone
EmbeddedApi Lastupdatetime GET /lastupdatetime Get the last time the timeseries were updated in the Operator Client or a Stand Alone
EmbeddedApi LocationsSelected GET /locations/selected Get the currently selected location ids in the Operator Client or a Stand Alone
EmbeddedApi ParametersSelected GET /parameters/selected Get the currently selected parameter ids in the Operator Client or a Stand Alone
EmbeddedApi TimeseriesTopologyNode GET /timeseries/topology/node Get the time series for the selected topology node
EmbeddedApi TopologySelected GET /topology/selected Get the currently selected topology node id in the Operator Client or a Stand Alone
FiltersApi Filters GET /filters Get filters that are a subfilter of the default filter
FiltersApi FiltersActions GET /filters/actions Get the actions for a set of filters
GeneralApi Oas GET /oas The Open Api Specification
GeneralApi ResourcesImages GET /resources/images/{id} Get image resources from the Delft-FEWS IconFiles config folder
GeneralApi ResourcesStatic GET /resources/static/{id} Get static resources from the PiClientConfigFiles folder
GeneralApi Systemtime GET /systemtime Get the system time of the Web Service
GeneralApi Timezoneid GET /timezoneid The ID of Configured timezone in the FewsPiService
GeneralApi Version GET /version The version of the running web service
ImportstatusApi ImportStatus GET /import/status Get the status of the imports
LocationsApi Locations GET /locations Get locations that are available for the 'filterId' argument
ModifiersApi Modifiers GET /modifiers Get modifiers filtered by parameters like start time, end time and modifier type
ModifiersApi Postmodifiers POST /modifiers Write modifiers to the Delft-FEWS database
ModifiersApi Timeseriesmodifiers GET /timeseriesmodifiers Get timeseries modifiers filtered by parameters like start time, end time and modifier type
ModuleruntablesApi ModuleruntablesCurrent GET /moduleruntables/current Get the current module run table in CSV format by specifying a moduleInstanceId or taskRunId
ParametersApi Parameters GET /parameters Get parameters that are available for the 'filterId' argument
ParametersApi ParametersNodes GET /parameters/nodes Get all parameter nodes and its parameters that are available in the region config
ProcessdataApi Processdata GET /processdata Run workflow and make processed netcdf data available as an attachment of type application/octet-stream
QualifiersApi Qualifiers GET /qualifiers Get all configured qualifiers from the region config and optionally show all its attributes
RatingcurvesApi Ratingcurves GET /ratingcurves Get all configured rating curves from the region config and optionally filter by locationIds
RatingcurvesApi RatingcurvesDischargetostage POST /ratingcurves/dischargetostage Converts discharge values to stage values using a rating curve at a specific location
RatingcurvesApi RatingcurvesStagetodischarge POST /ratingcurves/stagetodischarge Converts stage values to discharge values using a rating curve at a specific location
SamplesApi Samples GET /samples Get samples filtered by parameters like filterId, sampleId, parameterId and creation time of a sample
StatesApi Warmstates GET /warmstates Get the warm state file for the specified module instance id and state time
StatesApi WarmstatesTimes GET /warmstates/times Get all the available warm state times for the specified module instance ids
TasksApi Moduleruntimes GET /moduleruntimes Get all expected and pending runtimes for workflows per module instance id
TasksApi Postruntask POST /runtask Runs a one-off task for a given workflowId
TasksApi Taskruns GET /taskruns Get all taskruns for a workflowId filtered by parameters like forecast time or taskrun status
TasksApi Taskrunstatus GET /taskrunstatus Track the status of a workflow using the taskId, typically used to determine if a taskrun is completed
TimeseriesApi EnsemblesMembers GET /ensembles/members Get all ensemble member ids for one or more ensemble Ids
TimeseriesApi Posttimeseries POST /timeseries Timeseries will be written that are part of the timeseries sets defined by the filters
TimeseriesApi Timeseries GET /timeseries Get timeseries that are part of the default filter
TimeseriesApi TimeseriesDisplaygroups GET /timeseries/displaygroups Timeseries are filtered by the plotId from the DisplayGroups
TimeseriesApi Timeseriesgrid GET /timeseries/grid Get the timeseries containing the data from a grid cell for a request period
TopologyApi TopologyActions GET /topology/actions Get the display group actions for a certain topology node
TopologyApi TopologyNodes GET /topology/nodes Returns the topology config of the fews system
WebocApi WebocConfig GET /weboc/config Get the Web OC Configuration
WorkflowsApi Workflows GET /workflows Get all default workflow xml files in one list that are available

Documentation for Models

Documentation for Authorization

Bearer

  • Type: Bearer Authentication