softwareag / cumulocity-clients-dotnet Goto Github PK
View Code? Open in Web Editor NEWA .Net solution project written in CSharp to work with Cumulocity IoT, generated using the Cumulocity IoT OpenAPI specification.
License: Apache License 2.0
A .Net solution project written in CSharp to work with Cumulocity IoT, generated using the Cumulocity IoT OpenAPI specification.
License: Apache License 2.0
Urls are build e.g. this way:
var uriBuilder = new UriBuilder(new Uri($"{client?.BaseAddress?.AbsoluteUri}/identity/externalIds/{type}/{externalId}"));
but the client?.BaseAddress?.AbsoluteUri has already a slash appendix.
The uri looks like this:
https://example.de:443//identity/externalIds/example_type/1
Note the doubly slashes
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
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"
}
}
Currently (29.11.2022), the main branch is not build able by default. I had to comment out 2 Files:
I didn't check what the problem excaclty is, because I don't need these files, but can you please check?
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?
There are currently 303 warnings raised!
Hi,
the JPN of Api is not correct, it has to be:
[JsonPropertyName("apis")]
public List<string>? Api { get; set; }
There is also a bug in the docu, which I issed there.
Kind Regards
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.