Skyline.DataMiner.SDM.UserDefinedApi.Runtime 1.0.1

Prefix Reserved
dotnet add package Skyline.DataMiner.SDM.UserDefinedApi.Runtime --version 1.0.1
                    
NuGet\Install-Package Skyline.DataMiner.SDM.UserDefinedApi.Runtime -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Skyline.DataMiner.SDM.UserDefinedApi.Runtime" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Skyline.DataMiner.SDM.UserDefinedApi.Runtime" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Skyline.DataMiner.SDM.UserDefinedApi.Runtime" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Skyline.DataMiner.SDM.UserDefinedApi.Runtime --version 1.0.1
                    
#r "nuget: Skyline.DataMiner.SDM.UserDefinedApi.Runtime, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Skyline.DataMiner.SDM.UserDefinedApi.Runtime@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Skyline.DataMiner.SDM.UserDefinedApi.Runtime&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Skyline.DataMiner.SDM.UserDefinedApi.Runtime&version=1.0.1
                    
Install as a Cake Tool

Skyline.DataMiner.SDM.UserDefinedApi.Runtime

About

Runtime components for building User-Defined APIs in DataMiner. This package contains the core classes, attributes, and infrastructure needed to handle API requests, routing, and responses at runtime.

Note: This is the runtime package. For the complete SDK experience including automatic OpenAPI generation and packaging, use the main Skyline.DataMiner.SDM.UserDefinedApi package instead.

What's Included

Core Components

  • ControllerBase: Base class for API controllers with built-in response helpers
  • UserDefinedApi: Main entry point for processing API requests
  • ApiController & Route Attributes: Familiar ASP.NET Core-style routing decorators
  • HTTP Method Attributes: [HttpGet], [HttpPost], [HttpPut], [HttpDelete], etc.

Dependency Injection

  • IServiceCollection Extensions: Configure services with familiar DI patterns
  • IAccessor<T>: Access DataMiner engine and request context
  • Built-in service resolution in controllers

Request/Response Handling

  • Parameter Binding: [FromBody], [FromQuery] attributes
  • Response Types: IActionResult, ObjectResult, StatusCodeResult
  • Content Negotiation: Automatic JSON serialization with configurable formatters

Data Querying

  • OData Support: Built-in OData query parsing and filtering
  • Filter Translation: Convert OData filters to DataMiner filter elements
  • Query Operators: Support for eq, ne, gt, lt, and, or, etc.

Usage Examples

Creating a Controller

using Skyline.DataMiner.SDM.UserDefinedApi;

[ApiController]
[Route("api/resources")]
public class ResourceController : ControllerBase
{
    private readonly IEngine _engine;

    public ResourceController(IAccessor<IEngine> engineAccessor)
    {
        _engine = engineAccessor.Value;
    }

    [HttpGet]
    public IActionResult GetAll()
    {
        var resources = FetchResources();
        return Ok(resources);
        }

    [HttpGet]
    public IActionResult GetById(string id)
    {
        var resource = FetchResourceById(id);
        if (resource == null)
            return NotFound();

        return Ok(resource);
    }

    [HttpPost]
    public IActionResult Create([FromBody] Resource resource)
    {
        if (resource == null)
            return BadRequest("Resource cannot be null");

        var created = CreateResource(resource);
        return StatusCode(201, created);
    }
}

Handling API Requests

using Skyline.DataMiner.Automation;
using Skyline.DataMiner.SDM.UserDefinedApi;

public class Script
{
    private static IUserDefinedApi _api;

    [AutomationEntryPoint(AutomationEntryPointType.Types.OnApiTrigger)]
    public ApiTriggerOutput OnApiTrigger(IEngine engine, ApiTriggerInput requestData)
    {
        if(_api is null)
        {
            var builder = UserDefinedApi.CreateBuilder();

            // Optional: Configure services
            builder.ConfigureServices(services =>
            {
                services.AddSingleton<IMyService, MyService>();
            });

            _api = builder.Build();
        }

        return _api.Run(engine, requestData);
    }
}

Using OData Filtering

[HttpGet]
public IActionResult GetTickets([FromQuery] string filter)
{
    var translator = new ODataSdmTranslator<Ticket>();
    var filter = translator.TranslateFilter(filter);
    var tickets = _ticketRepository.Read(filter);

    // OData filter examples:
    // $filter=Severity eq 'High'

    return Ok(tickets);
}

Dependency Injection

public class MyController : ControllerBase
{
    private readonly IEngine _engine;
    private readonly ILogger<MyController> _logger;
    private readonly IMyService _myService;

    public MyController(
        IAccessor<IEngine> engineAccessor,
        ILogger<MyController> logger,
        IMyService myService)
    {
        _engine = engineAccessor.Value;
        _logger = logger;
        _myService = myService;
    }
}

Response Helpers

// Success responses
return Ok(data);                           // 200 OK
return StatusCode(201, created);           // 201 Created with body
return StatusCode(204);                    // 204 No Content

// Error responses
return BadRequest("Invalid input");         // 400 Bad Request
return NotFound();                          // 404 Not Found
return StatusCode(500, "Server error");     // Custom status code
  • Skyline.DataMiner.SDM.UserDefinedApi: Complete SDK with build-time tooling
  • Skyline.DataMiner.Dev.Utils.SDM.Abstractions: Common abstractions and interfaces

About DataMiner

DataMiner is a transformational platform that provides vendor-independent control and monitoring of devices and services. Out of the box and by design, it addresses key challenges such as security, complexity, multi-cloud, and much more. It has a pronounced open architecture and powerful capabilities enabling users to evolve easily and continuously.

The foundation of DataMiner is its powerful and versatile data acquisition and control layer. With DataMiner, there are no restrictions to what data users can access. Data sources may reside on premises, in the cloud, or in a hybrid setup.

A unique catalog of 7000+ connectors already exists. In addition, you can leverage DataMiner Development Packages to build your own connectors (also known as "protocols" or "drivers").

Note See also: About DataMiner.

About Skyline Communications

At Skyline Communications, we deal in world-class solutions that are deployed by leading companies around the globe. Check out our proven track record and see how we make our customers' lives easier by empowering them to take their operations to the next level.

Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Skyline.DataMiner.SDM.UserDefinedApi.Runtime:

Package Downloads
Skyline.DataMiner.SDM.UserDefinedApi

Contains classes and generators that are commonly used when creating User-Defined Api's.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 45 3/2/2026