From 515147480c8807219dc4cdff1cd7e178757196ba Mon Sep 17 00:00:00 2001 From: jhh Date: Tue, 1 Mar 2022 10:54:33 -0600 Subject: Add controllers and remote servers healthchecks Issue-ID: POLICY-3977 Signed-off-by: jhh Change-Id: I4fd4db29f99989a2ef11b08f66f28535bfd15a36 Signed-off-by: jhh --- feature-healthcheck/src/test/resources/echo.drl | 35 ++++++++++++++ .../src/test/resources/echo.kmodule | 26 ++++++++++ feature-healthcheck/src/test/resources/echo.pom | 31 ++++++++++++ .../test/resources/feature-healthcheck.properties | 55 ++++++++++++++++++++++ 4 files changed, 147 insertions(+) create mode 100644 feature-healthcheck/src/test/resources/echo.drl create mode 100644 feature-healthcheck/src/test/resources/echo.kmodule create mode 100644 feature-healthcheck/src/test/resources/echo.pom create mode 100644 feature-healthcheck/src/test/resources/feature-healthcheck.properties (limited to 'feature-healthcheck/src/test/resources') diff --git a/feature-healthcheck/src/test/resources/echo.drl b/feature-healthcheck/src/test/resources/echo.drl new file mode 100644 index 00000000..54847da9 --- /dev/null +++ b/feature-healthcheck/src/test/resources/echo.drl @@ -0,0 +1,35 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP + * ================================================================================ + * Copyright (C) 2022 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.healthcheck; + +rule "INIT" +lock-on-active +when +then + insert(new String("I am up")); +end + +rule "ECHO" +when + $o : Object(); +then + System.out.println("ECHO: " + $o.toString()); +end diff --git a/feature-healthcheck/src/test/resources/echo.kmodule b/feature-healthcheck/src/test/resources/echo.kmodule new file mode 100644 index 00000000..7a1acc70 --- /dev/null +++ b/feature-healthcheck/src/test/resources/echo.kmodule @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/feature-healthcheck/src/test/resources/echo.pom b/feature-healthcheck/src/test/resources/echo.pom new file mode 100644 index 00000000..2f84f4bd --- /dev/null +++ b/feature-healthcheck/src/test/resources/echo.pom @@ -0,0 +1,31 @@ + + + + + + 4.0.0 + + org.onap.policy.drools.healthcheck + echo + + 1.0.0 + diff --git a/feature-healthcheck/src/test/resources/feature-healthcheck.properties b/feature-healthcheck/src/test/resources/feature-healthcheck.properties new file mode 100644 index 00000000..63a71b6e --- /dev/null +++ b/feature-healthcheck/src/test/resources/feature-healthcheck.properties @@ -0,0 +1,55 @@ +# +# ============LICENSE_START======================================================= +# ONAP +# ================================================================================ +# Copyright (C) 2022 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========================================================= +# + +http.server.services=HEALTHCHECK,LIVENESS + +http.server.services.HEALTHCHECK.host=localhost +http.server.services.HEALTHCHECK.userName=username +http.server.services.HEALTHCHECK.password=password +http.server.services.HEALTHCHECK.restClasses=org.onap.policy.drools.healthcheck.RestMockHealthCheck +http.server.services.HEALTHCHECK.filterClasses=org.onap.policy.drools.healthcheck.TestAafHealthCheckFilter +http.server.services.HEALTHCHECK.port=7777 + +http.server.services.LIVENESS.host=localhost +http.server.services.LIVENESS.port=7776 +http.server.services.LIVENESS.restClasses=org.onap.policy.drools.healthcheck.RestMockHealthCheck + +http.client.services=HEALTHCHECK,LIVENESS,UNAUTH,STUCK + +http.client.services.HEALTHCHECK.host=localhost +http.client.services.HEALTHCHECK.port=7777 +http.client.services.HEALTHCHECK.contextUriPath=healthcheck/test +http.client.services.HEALTHCHECK.userName=username +http.client.services.HEALTHCHECK.password=password + +http.client.services.LIVENESS.host=localhost +http.client.services.LIVENESS.port=7776 +http.client.services.LIVENESS.contextUriPath=healthcheck/test + +http.client.services.UNAUTH.host=localhost +http.client.services.UNAUTH.port=7777 +http.client.services.UNAUTH.contextUriPath=healthcheck/test + +http.client.services.STUCK.host=localhost +http.client.services.STUCK.port=7776 +http.client.services.STUCK.contextUriPath=healthcheck/stuck + +liveness.controllers=* +liveness.controllers.timeout=5 -- cgit 1.2.3-korg