Remove deprecated Rest endpoints for hazelcast health 15/140115/1
authormpriyank <priyank.maheshwari@est.tech>
Thu, 30 Jan 2025 14:24:28 +0000 (14:24 +0000)
committermpriyank <priyank.maheshwari@est.tech>
Thu, 30 Jan 2025 14:27:14 +0000 (14:27 +0000)
- removing the hazelcast cluster rest health check endpoints

Issue-ID: CPS-2612
Change-Id: I01ad0e4b4d8ad99ce7a6e4e4dc0f0a8272d39227
Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cache/HazelcastCacheConfig.java
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/impl/cache/HazelcastCacheConfigSpec.groovy
docs/admin-guide.rst

index 5a6e1ce..1a7ef75 100644 (file)
@@ -25,7 +25,6 @@ import com.hazelcast.config.MapConfig;
 import com.hazelcast.config.NamedConfig;
 import com.hazelcast.config.NearCacheConfig;
 import com.hazelcast.config.QueueConfig;
-import com.hazelcast.config.RestEndpointGroup;
 import com.hazelcast.config.SetConfig;
 import com.hazelcast.core.Hazelcast;
 import com.hazelcast.core.HazelcastInstance;
@@ -61,7 +60,6 @@ public class HazelcastCacheConfig {
         config.setClusterName(clusterName);
         config.setClassLoader(Dataspace.class.getClassLoader());
         configureDataStructures(namedConfig, config);
-        exposeClusterInformation(config);
         updateDiscoveryMode(config);
         return config;
     }
@@ -130,13 +128,4 @@ public class HazelcastCacheConfig {
         }
     }
 
-    /*Note: Need to keep this for the meantime as Hazelcast community version 5.5 has marked RestApiConfig
-    for removal in future version and we have clients relying on these endpoints.
-    https://lf-onap.atlassian.net/browse/CPS-2599 created to address the issue. */
-    @SuppressWarnings("squid:S5738")
-    protected void exposeClusterInformation(final Config config) {
-        config.getNetworkConfig().getRestApiConfig().setEnabled(true)
-                .enableGroups(RestEndpointGroup.HEALTH_CHECK, RestEndpointGroup.CLUSTER_READ);
-    }
-
 }
index c08ff75..0026d7c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2023 Nordix Foundation
+ *  Copyright (C) 2023-2025 Nordix Foundation
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -20,8 +20,7 @@
 
 package org.onap.cps.ncmp.impl.cache
 
-import com.hazelcast.config.Config
-import com.hazelcast.config.RestEndpointGroup
+
 import com.hazelcast.core.Hazelcast
 import spock.lang.Specification
 
@@ -60,17 +59,4 @@ class HazelcastCacheConfigSpec extends Specification {
             'Set Config'   | HazelcastCacheConfig.createSetConfig('my set config')     || false           | false             | true
     }
 
-    def 'Verify Hazelcast Cluster Information'() {
-        given: 'a test configuration'
-            def testConfig = new Config()
-        when: 'cluster information is exposed'
-            objectUnderTest.exposeClusterInformation(testConfig)
-        then: 'REST api configs are enabled'
-            assert testConfig.networkConfig.restApiConfig.enabled
-        and: 'only health check and cluster read are enabled'
-            def enabledGroups = testConfig.networkConfig.restApiConfig.enabledGroups
-            assert enabledGroups.size() == 2
-            assert enabledGroups.containsAll([RestEndpointGroup.CLUSTER_READ, RestEndpointGroup.HEALTH_CHECK])
-    }
-
 }
index 156a5df..9009de2 100644 (file)
@@ -236,20 +236,6 @@ On demand heap dump and thread dump generation using the below endpoints.
     http://<cps-component-service-name>:8080/actuator/heapdump
     http://<cps-component-service-name>:8080/actuator/threaddump
 
-Hazelcast
----------
-.. note::
-   The below endpoints will be removed from hazelcast community version in the future release.
-
-Hazelcast cluster state and health check can be seen using the below endpoints
-
-.. code::
-
-    http://<cps-component-service-name>:<member-port>/hazelcast/health
-    http://<cps-component-service-name>:<member-port>/hazelcast/rest/management/cluster/state
-
-See also : :ref:`cps_common_distributed_datastructures`
-
 Naming Validation
 -----------------