From 5506fd867367e73c8472ee80103243080f208760 Mon Sep 17 00:00:00 2001 From: Jorge Hernandez Date: Thu, 13 Dec 2018 10:10:43 -0600 Subject: Telemetry extension to manage Operational Policies This is work in progress to directly work with Operational Policies with the casablanca controller for now. It is part of prototyping efforts to enhance the management of control loops, but the functionality can be used in production environments. Change-Id: I4fcb748e162ed38ad4cc4ca22cc4e278fd4c4096 Issue-ID: POLICY-1383 Signed-off-by: Jorge Hernandez --- .../src/test/resources/op-http.properties | 5 ++ .../src/test/resources/op.drl | 29 +++++++ .../src/test/resources/op.kmodule | 26 +++++++ .../src/test/resources/op.pom | 45 +++++++++++ .../src/test/resources/settings.xml | 89 ++++++++++++++++++++++ .../src/test/resources/vCPE.yaml | 37 +++++++++ 6 files changed, 231 insertions(+) create mode 100644 controlloop/common/feature-controlloop-management/src/test/resources/op-http.properties create mode 100644 controlloop/common/feature-controlloop-management/src/test/resources/op.drl create mode 100644 controlloop/common/feature-controlloop-management/src/test/resources/op.kmodule create mode 100644 controlloop/common/feature-controlloop-management/src/test/resources/op.pom create mode 100644 controlloop/common/feature-controlloop-management/src/test/resources/settings.xml create mode 100644 controlloop/common/feature-controlloop-management/src/test/resources/vCPE.yaml (limited to 'controlloop/common/feature-controlloop-management/src/test/resources') diff --git a/controlloop/common/feature-controlloop-management/src/test/resources/op-http.properties b/controlloop/common/feature-controlloop-management/src/test/resources/op-http.properties new file mode 100644 index 000000000..b96c5d133 --- /dev/null +++ b/controlloop/common/feature-controlloop-management/src/test/resources/op-http.properties @@ -0,0 +1,5 @@ +http.client.services=op + +http.client.services.op.host=localhost +http.client.services.op.port=9696 +http.client.services.op.contextUriPath=policy/pdp/engine diff --git a/controlloop/common/feature-controlloop-management/src/test/resources/op.drl b/controlloop/common/feature-controlloop-management/src/test/resources/op.drl new file mode 100644 index 000000000..48ed09929 --- /dev/null +++ b/controlloop/common/feature-controlloop-management/src/test/resources/op.drl @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP + * ================================================================================ + * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.policy.drools.apps.controlloop.feature.management; + +import org.onap.policy.controlloop.params.ControlLoopParams; + +rule "PARAMS" +when + $params : ControlLoopParams() +then +end diff --git a/controlloop/common/feature-controlloop-management/src/test/resources/op.kmodule b/controlloop/common/feature-controlloop-management/src/test/resources/op.kmodule new file mode 100644 index 000000000..8b49eb6a0 --- /dev/null +++ b/controlloop/common/feature-controlloop-management/src/test/resources/op.kmodule @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/controlloop/common/feature-controlloop-management/src/test/resources/op.pom b/controlloop/common/feature-controlloop-management/src/test/resources/op.pom new file mode 100644 index 000000000..133387217 --- /dev/null +++ b/controlloop/common/feature-controlloop-management/src/test/resources/op.pom @@ -0,0 +1,45 @@ + + + + + + 4.0.0 + + + org.onap.policy.drools-applications.controlloop.common.model-impl + model-impl + 1.4.0-SNAPSHOT + + + org.onap.policy.drools.apps.test + op + 1.4.0-SNAPSHOT + + + + org.onap.policy.drools-applications.controlloop.common.model-impl + events + 1.4.0-SNAPSHOT + provided + + + \ No newline at end of file diff --git a/controlloop/common/feature-controlloop-management/src/test/resources/settings.xml b/controlloop/common/feature-controlloop-management/src/test/resources/settings.xml new file mode 100644 index 000000000..3d49366bb --- /dev/null +++ b/controlloop/common/feature-controlloop-management/src/test/resources/settings.xml @@ -0,0 +1,89 @@ + + + + + + + + + + onap-releases + + + onap-releases + onap-releases + https://nexus.onap.org/content/repositories/releases/ + + true + + + false + + + + + + + onap-staging + + + onap-staging + onap-staging + https://nexus.onap.org/content/repositories/staging/ + + true + always + + + false + + + + + + + onap-snapshots + + + onap-snapshots + onap-snapshots + https://nexus.onap.org/content/repositories/snapshots/ + + false + + + true + always + + + + + + + + onap-releases + onap-staging + onap-snapshots + + + diff --git a/controlloop/common/feature-controlloop-management/src/test/resources/vCPE.yaml b/controlloop/common/feature-controlloop-management/src/test/resources/vCPE.yaml new file mode 100644 index 000000000..9ab15c60e --- /dev/null +++ b/controlloop/common/feature-controlloop-management/src/test/resources/vCPE.yaml @@ -0,0 +1,37 @@ +# Copyright 2018 AT&T Intellectual Property. All rights reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +controlLoop: + version: 2.0.0 + controlLoopName: ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e + trigger_policy: unique-policy-id-1-restart + timeout: 3600 + abatement: false + +policies: +- id: unique-policy-id-1-restart + name: Restart the VM + description: + actor: APPC + recipe: Restart + target: + type: VM + retry: 3 + timeout: 1200 + success: final_success + failure: final_failure + failure_timeout: final_failure_timeout + failure_retries: final_failure_retries + failure_exception: final_failure_exception + failure_guard: final_failure_guard \ No newline at end of file -- cgit 1.2.3-korg