“Machine Utilization Example” - Dashboards with role based access permission

In this file, data is pushed into the InfluxDB and two dashboards with different viewing permissions has been configured.

Download:

The example below uses an additional Docker image provided by Cybus that requires a suitable license. You can check the current capabilities and permissions of your Connectware license in the Cybus Portal (https://portal.cybus.io). If your license is not eligible to use the example Docker image, please contact Cybus Sales (sales@cybus.io).

description: >
    The generic Grafana Service

metadata:
    name: Generic Grafana Dashboard
    icon: https://www.cybus.io/wp-content/uploads/2017/10/for-whom3.svg
    provider: cybus
    homepage: https://www.cybus.io
    version: 1.2.1

definitions:
    SID: !ref Cybus::ServiceId
    CYBUS_MQTT_ROOT: 'services'

resources:
    #----------------------------------------------------------------------------
    # VOLUMES
    #----------------------------------------------------------------------------

    grafanaVolume:
        type: Cybus::Volume

    influxdbVolume:
        type: Cybus::Volume

    #----------------------------------------------------------------------------
    # FRONTENDS
    #----------------------------------------------------------------------------

    # Grafana
    grafanaURL:
        type: Cybus::IngressRoute
        properties:
            container: !ref genericGrafana
            type: http
            slug: grafana
            target:
                path: '/'
                port: 3000

    dashboard:
        type: Cybus::Link
        properties:
            name: Dashboard
            ingressRoute: !ref grafanaURL
            href: ''

    #----------------------------------------------------------------------------
    # Cybus Timeseris & Dashboard service containers
    #----------------------------------------------------------------------------

    influxdbPush:
        type: Cybus::Container
        properties:
            image: registry.cybus.io/cybus-services/influxdb-push:0.0.3
            environment:
                MQTT_HOST: !ref Cybus::MqttHost
                MQTT_USER: !ref Cybus::MqttUser
                MQTT_PORT: !ref Cybus::MqttPort
                MQTT_PASS: !ref Cybus::MqttPassword
                MQTT_ROOT_TOPIC: !sub 'services/#'
                INFLUX_HOST: !ref influxdb
                INFLUX_PORT: 8086
                INFLUX_DB: generic
                HTTP_ROOT: /

    influxdb:
        type: Cybus::Container
        properties:
            image: registry.cybus.io/cybus-services/influxdb:1.7.7-alpine
            ports:
                - 8086:8086/tcp
            volumes:
                - !sub '${influxdbVolume}:/var/lib/influxdb'
            environment:
                INFLUXDB_DB: generic

    genericGrafana:
        type: Cybus::Container
        properties:
            image: registry.cybus.io/cybus-services/generic-grafana:1.2.1
            volumes:
                - !sub '${grafanaVolume}:/var/lib/grafana'
            environment:
                GF_SERVER_ROOT_URL: !sub '/services/${SID}/grafana'
                GF_AUTH_ANONYMOUS_ENABLED: true
                INFLUX_DB: generic
                INFLUX_HOST: !ref influxdb
                INFLUX_PORT: 8086

Last updated

Logo

© Copyright 2024, Cybus GmbH