Skip to content

Commit

Permalink
added message when restart of CEP is complete
Browse files Browse the repository at this point in the history
  • Loading branch information
sagIoTPower committed Nov 22, 2023
1 parent 45cbd45 commit 39408d1
Show file tree
Hide file tree
Showing 7 changed files with 380 additions and 28 deletions.
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# cumulocity-analytics-management
Extends the standard cumulocity administration web application with a dialog to add Analytics Builder extensions. Currently the standard UI does not allow the upload of custom blocks via .zip files. This extension of the standard administration UI adds an dialog to add and a list of all loaded custom blocks.

## Content
- [Overview](#overview)
- [Installation](#installation)
- [Content](#content)
- [Build Instructions](#build-instructions)
- [User Guide](#user-guide)
- [Analytics Builder Block SDK](#analytics-builder-block-sdk)

## Overview

Extends the standard Cumulocity web application with a plugin to manage and add Analytics Builder extensions. Currently the standard UI does not allow the upload of custom blocks via .zip files. This extension of the standard Streaming-Analytics UI adds an plugin to add and a list of all loaded custom blocks.

![Extension installation](resources/images/extension-installation.png)
<!-- <br/>
<p align="center" style="text-indent:70px;">
<a>
<img width="70%" src="resources/images/extension-installation.png">
</a>
</p>
<br/> -->

In addition a table lists all installed blocks, with information if it is a custom block.

![Block list](resources/images/block-list.png)

## Installation

# Content
- [cumulocity-analytics-management](#cumulocity-analytics-management)
- [Content](#content)
- [Quickstart](#quickstart)
- [Build Instructions](#build-instructions)
- [User Guide](#user-guide)
- [Analytics Builder Block SDK](#analytics-builder-block-sdk)
The plugin is available as a community plugin and can be installed from the Administratio -> Extensions UI:

![Plugin installation](resources/images/plugin-installation.png)

# Quickstart
## Build Instructions

This guide will teach you how to add the modified administration application to your tenant.
To upload the latest application release into your tenant, just go to the [Releases](https://github.com/SoftwareAG/cumulocity-analytics-management/releases) and download the analytics-extension.zip package.
Expand All @@ -42,7 +42,6 @@ Finally, you should see the new application in your App-Switcher.
</p>
<br/> -->

# Build Instructions

**Prerequisites:**

Expand Down Expand Up @@ -78,9 +77,9 @@ git clone https://github.com/SoftwareAG/cumulocity-analytics-management.git

7. Deploy the app:
```npm run deploy```
# User Guide
## User Guide

You can upload blocks that were generated via the [Apama Analytics Builder block sdk](https://github.com/SoftwareAG/apama-analytics-builder-block-sdk) via the "add extension" button. Drop the .zip file there and the extension will be loaded. In order to use them you have to restart the streaming analytics engine. Click on the "Restart Streaming Analytics" button for that.
You can upload blocks that were generated via the [Apama Analytics Builder Block SDK](https://github.com/SoftwareAG/apama-analytics-builder-block-sdk) via the "Add extension" button. Drop the .zip file there and the extension will be loaded. In order to use them you have to restart the streaming analytics engine. Click on the "Restart Streaming Analytics" button and wait for the notification that the engine was restarted.

![Using Analytics Extension](resources/images/animated-using-plugin.gif)
<!-- <br/>
Expand All @@ -104,7 +103,7 @@ After the restart the Block will be available within the Steaming Analytics Appl
</p>
<br/> -->

# Analytics Builder Block SDK
## Analytics Builder Block SDK

Custom blocks can be generated via the [Apama Analytics Builder block sdk](https://github.com/SoftwareAG/apama-analytics-builder-block-sdk).
Find addtional information on how blocks can be developed. However in the release section is one example block included that can be used for test purposes.
Expand Down
263 changes: 263 additions & 0 deletions attic/apama.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
{
"activeVersionId": "1950132570",
"availability": "MARKET",
"contextPath": "cep",
"description": "",
"id": "3142",
"key": "apama-ctrl-1c-4g",
"manifest": {
"apiVersion": "2",
"billing": {
"metrics": [
{
"aggregation": {
"function": "LATEST"
},
"name": "number_extensions",
"type": "NUMBER"
},
{
"aggregation": {
"function": "LATEST"
},
"name": "number_epl_apps",
"type": "NUMBER"
},
{
"aggregation": {
"function": "LATEST"
},
"name": "number_epl_apps_active",
"type": "NUMBER"
},
{
"aggregation": {
"function": "LATEST"
},
"name": "number_analytics_builder_models",
"type": "NUMBER"
},
{
"aggregation": {
"function": "LATEST"
},
"name": "number_analytics_builder_models_active",
"type": "NUMBER"
},
{
"aggregation": {
"function": "LATEST"
},
"name": "number_smart_rules_active",
"type": "NUMBER"
},
{
"aggregation": {
"function": "LATEST"
},
"name": "number_smart_rules_active_onAlarmSendSms",
"type": "NUMBER"
},
{
"aggregation": {
"function": "LATEST"
},
"name": "number_smart_rules_active_onAlarmSendEmail",
"type": "NUMBER"
},
{
"aggregation": {
"function": "LATEST"
},
"name": "number_smart_rules_active_onAlarmEscalateAlarm",
"type": "NUMBER"
},
{
"aggregation": {
"function": "LATEST"
},
"name": "number_smart_rules_active_onAlarmDurationIncreaseAlarmSeverity",
"type": "NUMBER"
},
{
"aggregation": {
"function": "LATEST"
},
"name": "number_smart_rules_active_onGeofenceCreateAlarm",
"type": "NUMBER"
},
{
"aggregation": {
"function": "LATEST"
},
"name": "number_smart_rules_active_onGeofenceSendEmail",
"type": "NUMBER"
},
{
"aggregation": {
"function": "LATEST"
},
"name": "number_smart_rules_active_calculateEnergyConsumption",
"type": "NUMBER"
},
{
"aggregation": {
"function": "LATEST"
},
"name": "number_smart_rules_active_onMissingMeasurementsCreateAlarm",
"type": "NUMBER"
},
{
"aggregation": {
"function": "LATEST"
},
"name": "number_smart_rules_active_onAlarmExecuteOperation",
"type": "NUMBER"
},
{
"aggregation": {
"function": "LATEST"
},
"name": "number_smart_rules_active_explicitThresholdSmartRule",
"type": "NUMBER"
},
{
"aggregation": {
"function": "LATEST"
},
"name": "number_smart_rules_active_thresholdSmartRule",
"type": "NUMBER"
},
{
"aggregation": {
"function": "LATEST"
},
"name": "total_physicalMemoryMB",
"type": "NUMBER"
}
]
},
"billingMode": "RESOURCES",
"contextPath": "cep",
"description": "The per-tenant Streaming Analytics microservice lets you use Analytics Builder models, EPL apps and smart rules for real-time analytics.",
"isolation": "PER_TENANT",
"key": "apama-ctrl-1c-4g-key",
"livenessProbe": {
"failureThreshold": 3,
"httpGet": {
"path": "/health",
"port": 80
},
"initialDelaySeconds": 180,
"periodSeconds": 30,
"successThreshold": 1,
"timeoutSeconds": 120
},
"name": "apama-ctrl-1c-4g",
"noAppSwitcher": true,
"provider": {
"name": "Software AG"
},
"readinessProbe": {
"failureThreshold": 99,
"httpGet": {
"path": "/health",
"port": 80
},
"initialDelaySeconds": 2,
"periodSeconds": 2,
"successThreshold": 1,
"timeoutSeconds": 5
},
"requestedResources": {
"memory": "400Mi"
},
"requiredRoles": [
"ROLE_AUDIT_ADMIN",
"ROLE_AUDIT_READ",
"ROLE_BULK_OPERATION_ADMIN",
"ROLE_BULK_OPERATION_READ",
"ROLE_APPLICATION_MANAGEMENT_READ",
"ROLE_INVENTORY_READ",
"ROLE_INVENTORY_ADMIN",
"ROLE_INVENTORY_CREATE",
"ROLE_MEASUREMENT_READ",
"ROLE_MEASUREMENT_ADMIN",
"ROLE_EVENT_READ",
"ROLE_EVENT_ADMIN",
"ROLE_ALARM_READ",
"ROLE_ALARM_ADMIN",
"ROLE_DEVICE_CONTROL_READ",
"ROLE_DEVICE_CONTROL_ADMIN",
"ROLE_IDENTITY_READ",
"ROLE_IDENTITY_ADMIN",
"ROLE_CEP_MANAGEMENT_READ",
"ROLE_CEP_MANAGEMENT_ADMIN",
"ROLE_OPTION_MANAGEMENT_READ",
"ROLE_TENANT_MANAGEMENT_READ",
"ROLE_SMS_ADMIN",
"ROLE_USER_MANAGEMENT_READ",
"ROLE_USER_MANAGEMENT_OWN_READ",
"ROLE_MACHINE_LEARNING_READ"
],
"resources": {
"cpu": "1",
"memory": "4Gi"
},
"roles": [
"ROLE_SMARTRULE_READ",
"ROLE_SMARTRULE_ADMIN",
"ROLE_ANALYTICSBUILDER_READ",
"ROLE_EPLAPPS_READ",
"ROLE_MACHINE_LEARNING_READ"
],
"scale": "NONE",
"settingsCategory": null,
"type": "MICROSERVICE",
"version": "10.18.0.4.20230828-1241-e470f1562"
},
"name": "apama-ctrl-1c-4g",
"owner": {
"self": "https://t306817378.eu-latest.cumulocity.com/tenant/tenants/management",
"tenant": {
"id": "management"
}
},
"requiredRoles": [
"ROLE_AUDIT_ADMIN",
"ROLE_AUDIT_READ",
"ROLE_BULK_OPERATION_ADMIN",
"ROLE_BULK_OPERATION_READ",
"ROLE_APPLICATION_MANAGEMENT_READ",
"ROLE_INVENTORY_READ",
"ROLE_INVENTORY_ADMIN",
"ROLE_INVENTORY_CREATE",
"ROLE_MEASUREMENT_READ",
"ROLE_MEASUREMENT_ADMIN",
"ROLE_EVENT_READ",
"ROLE_EVENT_ADMIN",
"ROLE_ALARM_READ",
"ROLE_ALARM_ADMIN",
"ROLE_DEVICE_CONTROL_READ",
"ROLE_DEVICE_CONTROL_ADMIN",
"ROLE_IDENTITY_READ",
"ROLE_IDENTITY_ADMIN",
"ROLE_CEP_MANAGEMENT_READ",
"ROLE_CEP_MANAGEMENT_ADMIN",
"ROLE_OPTION_MANAGEMENT_READ",
"ROLE_TENANT_MANAGEMENT_READ",
"ROLE_SMS_ADMIN",
"ROLE_USER_MANAGEMENT_READ",
"ROLE_USER_MANAGEMENT_OWN_READ",
"ROLE_MACHINE_LEARNING_READ"
],
"roles": [
"ROLE_SMARTRULE_READ",
"ROLE_SMARTRULE_ADMIN",
"ROLE_ANALYTICSBUILDER_READ",
"ROLE_EPLAPPS_READ",
"ROLE_MACHINE_LEARNING_READ"
],
"self": "https://t306817378.eu-latest.cumulocity.com/application/applications/3142",
"type": "MICROSERVICE"
}
Binary file removed resources/images/animated-installation-plugin.gif
Binary file not shown.
Binary file added resources/images/plugin-installation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions src/analytics/manage/extension.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { ModalOptions } from 'ngx-bootstrap/modal';
export class AnalyticsExtensionComponent implements OnInit {
reloading: boolean = false;
reload$: BehaviorSubject<void> = new BehaviorSubject(null);
subscription: any;

extensions$: Observable<IManagedObject> = this.reload$.pipe(
tap(() => (this.reloading = true)),
Expand All @@ -33,6 +34,8 @@ export class AnalyticsExtensionComponent implements OnInit {

ngOnInit() {
this.loadExtensions();
this.initializeMonitoringService();

}

loadExtensions() {
Expand Down Expand Up @@ -61,4 +64,17 @@ export class AnalyticsExtensionComponent implements OnInit {
this.loadExtensions();
});
}

private async initializeMonitoringService(): Promise<void> {
this.subscription =
await this.analyticsService.subscribeMonitoringChannel();
}

ngOnDestroy(): void {
console.log("Stop subscription");
this.analyticsService.unsubscribeFromMonitoringChannel(
this.subscription
);
}

}
9 changes: 6 additions & 3 deletions src/shared/analytics.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,11 @@ export interface CEP_Block {
category: Category;
}

export const PATH_CEP_BASE = "service/cep/apamacorrelator";
export const PATH_CEP_BASE_EN = "service/cep/apamacorrelator/EN";
export const PATH_CEP_METADATA_EN = `${PATH_CEP_BASE}/EN/block-metadata.json`;
export const PATH_CEP_BASE = "service/cep";
export const PATH_CEP_CORRELATOR = `${PATH_CEP_BASE}/apamacorrelator`;
export const PATH_CEP_EN = `${PATH_CEP_CORRELATOR}/EN`;
export const PATH_CEP_METADATA_EN = `${PATH_CEP_CORRELATOR}/EN/block-metadata.json`;
export const PATH_CEP_DIAGNOSTICS = `${PATH_CEP_BASE}/diagnostics`;
export const PATH_CEP_STATUS = `${PATH_CEP_DIAGNOSTICS}/apamaCtrlStatus`;
// http://localhost:9000/cep/apamacorrelator/EN/block-metadata.json
// http://localhost:9000/service/cep/apamacorrelator/EN/core.json
Loading

0 comments on commit 39408d1

Please sign in to comment.