Coder Social home page Coder Social logo

softwareag / cumulocity-clients-dotnet Goto Github PK

View Code? Open in Web Editor NEW
5.0 7.0 3.0 623 KB

A .Net solution project written in CSharp to work with Cumulocity IoT, generated using the Cumulocity IoT OpenAPI specification.

License: Apache License 2.0

C# 100.00%
cumulocity-iot iot-analytics c-sharp dotnet6

cumulocity-clients-dotnet's Issues

Add support for setting processing modes (e.g. transient, quiescent)

Add support for setting the Cumulocity processing mode on all PUT, POST and DELETE requests.

This is documented in the general section of the docs under "Processing mode".

Use-case

In order to save costs, some measurements are pushed to the platform using the TRANSIENT processing mode so that the measurements are visible in the UI however they are not persisted in the platform.

Feature details

  • Ability to set it on a per-request basis (using default headers would add this mode for all requests, which is often not desired)

NotificationSubscription.Context.MO does not work as intended

Hi,

when I try to subscribe using CreateSubscription from "NotificationSubscription.cs", the generated "NotificationSubscription" body as input parameter looks like this:

{
  "context": "MO",
  "source": {
    "id": "wonderfulID"
  },
  "subscription": "Subscription",
  "subscriptionFilter": {
    "api": [
      "events"
    ],
    "typeFilter": "c8y_LoriotUplinkRequest"
  }
}

It does not correctly convert the context, it seems that it does not use the "[EnumMember(Value = "mo")]" of enum "Context".
Anyway, when I change the enum "MO" to "mo" in "NotificationSubscription.cs"

[JsonConverter(typeof(JsonStringEnumConverter))]
public enum Context 
{
	[EnumMember(Value = "mo")]
	mo,
	[EnumMember(Value = "tenant")]
	tenant
}

it works:

{
  "context": "mo",
  "source": {
    "id": "wonderfulID"
  },
  "subscription": "Subscription",
  "subscriptionFilter": {
    "api": [
      "events"
    ],
    "typeFilter": "c8y_LoriotUplinkRequest"
  }
}

Main branch not buildable

Currently (29.11.2022), the main branch is not build able by default. I had to comment out 2 Files:

  • IInventoryApi.cs
  • InventoryApi.cs

I didn't check what the problem excaclty is, because I don't need these files, but can you please check?

Can't generate a measurement using MeasurementsAPI

I'm trying to create measurements via MeasurementsApi.CreateMeasurement, but I get an exception every time. I'm using this code to generate a measurement:

var measurement = new Measurement(
      new Measurement.Source("12345678"),
      DateTime.Now,
      "mytestType"
  );
  measurement.CustomFragments = new Dictionary<string, object>{
      {
          "myValue",
          new Dictionary<string, MeasurementValue>{
              {"nested", new MeasurementValue{value=1.234, unit="V"}}
          }
      }
  };

  var response = measurementsApi.CreateMeasurement(new MeasurementCollection<Measurement>(new List<Measurement> { measurement }));

I dug down the rabbit hole and found out, that it fails, because the Measurement class does not have the property "Item".
By using "CreateMeasurement" in the first lines it tries to convert the body to a "JsonNode". The "JsonNode" contains "Item" as default member.

Do I miss something or is it a bug? What's the best work arround currently?

No method for generating an access token

When I want to generate an access token, to access the inventory, I can't use the LoginTokenAPI. The class does not contain any method got generate the token. Is the class obsolete?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.