Skip to content

EmersonDeltaV/deltav-edge-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Edge Client SDK

Table of Contents

About

This repository contains a C# Edge REST API Client SDK implemented via HttpClient to simplify Edge REST API consumption. The currently available Edge endpoints covered in this SDK are Authentication, Graph, History, and Alarm and Events.

Getting Started

Prerequisites

Before working with this SDK, please ensure that you have setup the following with your Edge installation:

1. A working and reachable Edge REST API endpoint
2. Authorized Credentials for your Edge REST API endpoint

For more information, please consult the Edge Environment User Guide.

Usage

Authentication

DeltaV.EdgeClient.Authentication

NuGet Version NuGet Downloads

var handler = new HttpClientHandler();
var client = new HttpClient(handler);

var edgeUrl = "https://localhost/"; //add your Edge REST API IP here
var user = "user"; //add your REST API username here
var pass = "pass"; //add your REST API password here

client.BaseAddress = new Uri(edgeUrl);
var token = await client.RequestClientTokenAsync(new Emerson.EdgeClient.Authentication.Models.Credentials()
{
    Username = user,
    Password = pass
});

client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token.AccessToken);

Graph

DeltaV.EdgeClient.Graph

NuGet Version NuGet Downloads

var client = GetAuthenticatedClient(); //see Authentication sample.

var entity = await client.GetGraphByEntityIdAsync(entityId, propertyList, relationshipList);

History

Emerson.EdgeClient.History

NuGet Version NuGet Downloads

var client = GetAuthenticatedClient(); //see Authentication sample.

var history = await client.GetHistoryByIdAsync(entityId, field);

Alarm and Events

Emerson.EdgeClient.AE

NuGet Version NuGet Downloads

var client = GetAuthenticatedClient(); //see Authentication sample.

var history = await client.GetAeAsync(pageSize, pageNumber);

Sample Clients

Check out our sample code here to learn more.

Authors

  • Lawrence Benitez
  • Peter Balanag
  • Gershon Young
  • Carlo Tamayo

About

C# Edge REST API Client SDK implemented via HttpClient to simplify Edge REST API consumption

Topics

Resources

License

Stars

Watchers

Forks

Languages