View on GitHub

amber-csharp-sdk

Boon Amber C# SDK

Logo

BoonAmber - the C# library for the Amber API Server

Boon Logic Amber API Server

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

Frameworks supported

Dependencies

Installation

Boon Amber is available via Nuget: https://www.nuget.org/packages/BoonAmber

dotnet add package BoonAmber --version 1.0.3

Alternatively the DLL can built from source using the dotnet cli:

dotnet build src/BoonAmber/BoonAmber.csproj

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

using BoonAmber.Api;
using BoonAmber.Client;
using BoonAmber.Model;

Getting Started

using System;
using System.Diagnostics;
using BoonAmber.Api;
using BoonAmber.Client;
using BoonAmber.Model;

namespace Example
{
    public class Example
    {
        public void main()
        {
            var apiInstance = new DefaultApi("default", "~/.Amber.license");

            try
            {
                // Try to get version
                var result = apiInstance.GetVersion();
                Console.WriteLine(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception when calling DefaultApi.GetVersion: " + e.Message );
            }
        }
    }
}

Documentation for API Endpoints

All URIs are relative to http://amber.boonlogic.com/v1

Class Method HTTP request Description
DefaultApi DeleteSensor DELETE /sensor Delete a sensor instance
DefaultApi GetAmberSummary GET /__summary Get the JSON block of the amber image
DefaultApi GetConfig GET /config Get the current configuration of a sensor instance
DefaultApi GetPretrain GET /pretrain Get status of pretrain operation
DefaultApi GetRootCause GET /rootCause Get root cause analysis information from a sensor
DefaultApi GetSensor GET /sensor Get basic information about a sensor instance
DefaultApi GetSensors GET /sensors List all sensors for this user
DefaultApi GetStatus GET /status Get analytic information from a sensor
DefaultApi GetVersion GET /version Retrieves API version information
DefaultApi PostConfig POST /config Apply configuration to a sensor instance
DefaultApi PostOauth2 POST /oauth2 Request a bearer token using Amber account credentials
DefaultApi PostOutage POST /outage Informs the server of an outage
DefaultApi PostPretrain POST /pretrain Pretrain a sensor using historical data
DefaultApi PostSensor POST /sensor Create a new a sensor instance
DefaultApi PostStream POST /stream Stream data to a sensor
DefaultApi PutConfig PUT /config Update configuration for a sensor instance
DefaultApi PutSensor PUT /sensor Update label for a sensor instance
DefaultApi PutStream PUT /stream Stream data to a sensor fusion vector

Documentation for Models

Documentation for Authorization

Amber License File

Place an .Amber.license in your home directory:

{
    "default": {
        "username": "AMBER-ACCOUNT-USERNAME",
        "password": "AMBER-ACCOUNT-PASSWORD",
        "server": "https://amber.boonlogic.com/v1"
    }
}

Use this license path when creating the API instance:

var apiInstance = new DefaultApi("default", "~/.Amber.license");

Amber License Environment Variables

Alternatively you can set the relevant Amber license environment variables:

export AMBER_USERNAME=AMBER-ACCOUNT-USERNAME
export AMBER_PASSWORD=AMBER-ACCOUNT-PASSWORD
export AMBER_SERVER=https://amber.boonlogic.com/v1

Then leave the license path empty when creating the API instance:

var apiInstance = new DefaultApi("", "");