Commit 6ece7c73 authored by Javi Moreno's avatar Javi Moreno
Browse files

Merge remote-tracking branch 'origin/develop' into feat/monitoring-service

parents 87ddc7d8 8f83279b
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
//Example of topology
syntax = "proto3";
package automation;

@@ -40,7 +39,7 @@ message DeviceRoleState {
}

message DeviceDeletionResult {
  repeated bool deleted = 1;
  repeated string deleted = 1;
}

message Empty {}
@@ -51,5 +50,3 @@ enum ZtpDeviceState {
  ZTP_DEV_STATE_UPDATED  = 2;
  ZTP_DEV_STATE_DELETED  = 3;
}

+2 −2
Original line number Diff line number Diff line
# Define the host for the Context Service
quarkus.kubernetes.env.vars.context-service-host=context
quarkus.kubernetes.env.vars.context-service-host=ContextService

# Define the host for the Device Service
quarkus.kubernetes.env.vars.device-service-host=device
 No newline at end of file
quarkus.kubernetes.env.vars.device-service-host=DeviceService
 No newline at end of file
+3 −1
Original line number Diff line number Diff line
# How to run locally the automation service (tested in Ubuntu 20.04)
# Automation TeraFlow OS service 

The Automation service, also known as Zero-Touch Provisioning (ZTP), is tested on Ubuntu 20.04. Follow the instructions below to build, test, and run this service on your local environment.


## Compile code
+10 −1
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@ import eu.teraflow.automation.context.ContextService;
import eu.teraflow.automation.device.model.DeviceEvent;
import io.quarkus.runtime.StartupEvent;
import io.smallrye.mutiny.Multi;
import java.time.Duration;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
import javax.inject.Inject;
@@ -29,7 +30,15 @@ public class ContextSubscriber {
    }

    public void listenForDeviceEvents() {
        Multi<DeviceEvent> deviceEventsMulti = contextService.getDeviceEvents();

        Multi<DeviceEvent> deviceEventsMulti =
                contextService
                        .getDeviceEvents()
                        .onFailure()
                        .retry()
                        .withBackOff(Duration.ofSeconds(1))
                        .withJitter(0.2)
                        .atMost(10);

        deviceEventsMulti
                .onItem()
+1 −1
Original line number Diff line number Diff line
@@ -11,6 +11,6 @@ public class SimpleLivenessCheck implements HealthCheck {

    @Override
    public HealthCheckResponse call() {
        return HealthCheckResponse.up("Automation Service");
        return HealthCheckResponse.up("Automation Service is live");
    }
}
Loading