Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification2.0 and refactoring #198

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ jobs:
GH_TOKEN: ${{ github.token }}
GITHUB_URL: ${{ github.server_url }}
HUSKY: 0
run: semantic-release
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
4 changes: 2 additions & 2 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"branches": ["main"],
"branches": ["main","notification2.0"],
"tagFormat": "v${version}",
"plugins": [
[
Expand Down Expand Up @@ -36,7 +36,7 @@
[
"@semantic-release/npm",
{
"npmPublish": false,
"npmPublish": true,
"pkgRoot": "node-red-contrib-c8y-client"
}
],
Expand Down
3 changes: 2 additions & 1 deletion cumulocity.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"ROLE_MEASUREMENT_READ",
"ROLE_MEASUREMENT_ADMIN",
"ROLE_OPTION_MANAGEMENT_READ",
"ROLE_OPTION_MANAGEMENT_ADMIN"
"ROLE_OPTION_MANAGEMENT_ADMIN",
"ROLE_NOTIFICATION_2_ADMIN"
],
"roles": [
"ROLE_NODE_RED_ADMIN",
Expand Down
38 changes: 35 additions & 3 deletions node-red-contrib-c8y-client/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Cumulocity nodes for Node-RED
# node-red-contrib-c8y-client

This package provides nodes to connect to Cumulocity IoT Platform. They can be used inside the Node-Red Cumulocity Micorservice or standalone.

## Authentication

All nodes can be configured with Cumulocity IoT credentials either via a configuration node or environment variables. In case of running inside of Cumulocity as a microservice the environment variables are automatically injected on runtime and enabeling the Use Env checkbox in the configuration dialog will use those values.

C8Y_TENANT=c8ytenantid
C8Y_USER=c8yusername
C8Y_PASSWORD=c8ypwd
C8Y_APPLICATION_KEY=optional (when set requests are not treated as a device call)

# Concept

Blocks are designed to handle most authentiction and configuration for Cumulocity IoT.
The intention of those nodes is not to cover all Cumulocity API [https://cumulocity.com/api/core/](https://cumulocity.com/api/core/)
Most requests can be done using the call-endpoint node. Please look at the examples how to prepare requests using a function node and execute them using the call-endpoint node.
In addition Realtime (UI-like) and Notificaiton (Notification 2.0) nodes enable you to get realtime events from cumulocity.
For more information have a look at the node-help inside node-red.

## Dev

You can install the package after checkout like that:

cd ~.node-red
npm install <full path to git repo>/cumulocity-node-red/@c8y/node-red-client

This will create a link in the node-red node-modules dir.
To test and restart node-red on file changes in development you can use nodemon in the node-red-client dir of the repo like that:

nodemon --watch ./ -e js,html,json --exec "node-red"

To test Use Env switch you can edit env.list.default to your values and source the file like . ./env.list.default


This package provides a few nodes which are using the microservice credentials to connect to Cumulocity.
There are multiple nodes to subscribe for realtime updates of the different Cumulocity APIs and a single node to execute requests to some endpoint of the tenant.

Loading