Commit c8ffa3de authored by kesnar's avatar kesnar
Browse files

feat: add recalculatePath as action to Policy

parent b6bfee3d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ enum PolicyRuleActionEnum {
  POLICYRULE_ACTION_SET_DEVICE_STATUS = 1;
  POLICYRULE_ACTION_ADD_SERVICE_CONFIGRULE = 2;
  POLICYRULE_ACTION_ADD_SERVICE_CONSTRAINT = 3;
  POLICY_RULE_ACTION_CALL_SERVICE_RPC = 4;
  POLICY_RULE_ACTION_RECALCULATE_PATH = 5;
}

// Action configuration

src/policy/mvnw

100644 → 100755
+0 −0

File mode changed from 100644 to 100755.

+1 −1
Original line number Diff line number Diff line
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
+1 −20
Original line number Diff line number Diff line
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,9 +20,6 @@ import context.ContextOuterClass.ServiceId;
import io.quarkus.grpc.GrpcService;
import io.smallrye.mutiny.Uni;
import javax.inject.Inject;
import org.eclipse.microprofile.metrics.MetricUnits;
import org.eclipse.microprofile.metrics.annotation.Counted;
import org.eclipse.microprofile.metrics.annotation.Timed;
import policy.Policy;
import policy.Policy.PolicyRuleBasic;
import policy.Policy.PolicyRuleDevice;
@@ -44,8 +41,6 @@ public class PolicyGatewayImpl implements PolicyGateway {
    }

    @Override
    @Counted(name = "policy_policyAddService_counter")
    @Timed(name = "policy_policyAddService_histogram", unit = MetricUnits.MILLISECONDS)
    public Uni<PolicyRuleState> policyAddService(PolicyRuleService request) {
        final var policyRuleService = serializer.deserialize(request);

@@ -56,8 +51,6 @@ public class PolicyGatewayImpl implements PolicyGateway {
    }

    @Override
    @Counted(name = "policy_policyUpdateService_counter")
    @Timed(name = "policy_policyUpdateService_histogram", unit = MetricUnits.MILLISECONDS)
    public Uni<PolicyRuleState> policyUpdateService(PolicyRuleService request) {
        final var policyRuleService = serializer.deserialize(request);

@@ -68,8 +61,6 @@ public class PolicyGatewayImpl implements PolicyGateway {
    }

    @Override
    @Counted(name = "policy_policyAddDevice_counter")
    @Timed(name = "policy_policyAddDevice_histogram", unit = MetricUnits.MILLISECONDS)
    public Uni<PolicyRuleState> policyAddDevice(PolicyRuleDevice request) {
        final var policyRuleDevice = serializer.deserialize(request);

@@ -80,8 +71,6 @@ public class PolicyGatewayImpl implements PolicyGateway {
    }

    @Override
    @Counted(name = "policy_policyUpdateDevice_counter")
    @Timed(name = "policy_policyUpdateDevice_histogram", unit = MetricUnits.MILLISECONDS)
    public Uni<PolicyRuleState> policyUpdateDevice(PolicyRuleDevice request) {
        final var policyRuleDevice = serializer.deserialize(request);

@@ -92,8 +81,6 @@ public class PolicyGatewayImpl implements PolicyGateway {
    }

    @Override
    @Counted(name = "policy_policyDelete_counter")
    @Timed(name = "policy_policyDelete_histogram", unit = MetricUnits.MILLISECONDS)
    public Uni<PolicyRuleState> policyDelete(PolicyRuleId request) {
        final var policyRuleId = serializer.deserialize(request);

@@ -101,8 +88,6 @@ public class PolicyGatewayImpl implements PolicyGateway {
    }

    @Override
    @Counted(name = "policy_getPolicyService_counter")
    @Timed(name = "policy_getPolicyService_histogram", unit = MetricUnits.MILLISECONDS)
    public Uni<PolicyRuleService> getPolicyService(PolicyRuleId request) {
        final var policyRuleBasic = PolicyRuleBasic.newBuilder().setPolicyRuleId(request).build();

@@ -111,8 +96,6 @@ public class PolicyGatewayImpl implements PolicyGateway {
    }

    @Override
    @Counted(name = "policy_getPolicyDevice_counter")
    @Timed(name = "policy_getPolicyDevice_histogram", unit = MetricUnits.MILLISECONDS)
    public Uni<PolicyRuleDevice> getPolicyDevice(PolicyRuleId request) {
        final var policyRuleBasic = PolicyRuleBasic.newBuilder().setPolicyRuleId(request).build();

@@ -121,8 +104,6 @@ public class PolicyGatewayImpl implements PolicyGateway {
    }

    @Override
    @Counted(name = "policy_getPolicyByServiceId_counter")
    @Timed(name = "policy_getPolicyByServiceId_histogram", unit = MetricUnits.MILLISECONDS)
    public Uni<PolicyRuleServiceList> getPolicyByServiceId(ServiceId request) {
        return Uni.createFrom().item(() -> Policy.PolicyRuleServiceList.newBuilder().build());
    }
+1 −1
Original line number Diff line number Diff line
/*
* Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
* Copyright 2021-2023 H2020 TeraFlow (https://www.teraflow-h2020.eu/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Loading