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

Feat/notification2 support #176

Merged
merged 3 commits into from
Oct 2, 2022
Merged

Feat/notification2 support #176

merged 3 commits into from
Oct 2, 2022

Conversation

reubenmiller
Copy link
Owner

@reubenmiller reubenmiller commented Oct 2, 2022

initial notification2 support

New c8y notification2 command to managed notification2 subscriptions and tokens

Preface

Notification2 needs to be enabled in a tenant before it can be used. In addition you will require the ROLE_NOTIFICATION_2_ADMIN role to access it.
Read the documentation to further understand the new messaging service.

Examples

# create a new subscription (you only need to do this once)
c8y notification2 subscriptions create --name registration --context tenant --apiFilter managedobjects

# list all subscriptions
c8y notification2 subscriptions list

# subscribe (this starts a client using a token automatically)
c8y notification2 subscriptions subscribe --name registration --consumer client01 --duration 10min

# Start listening to a subscription name registration but only include CREATE and UPDATE action types (ignoring DELETE)
c8y notification2 subscriptions subscribe --name registration --actionTypes CREATE --actionTypes UPDATE

# Or subscribe and use the results in other commands
c8y notification2 subscriptions subscribe --name registration --consumer client01 \
| c8y events create --text "New notification" --type "c8y_Notification"

@reubenmiller reubenmiller merged commit 2792e8e into v2 Oct 2, 2022
@reubenmiller reubenmiller deleted the feat/notification2-support branch October 2, 2022 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant