new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMiiAddCluster.java
private boolean checkManagedServerConfiguration(String managedServer) {
    ExecResult result = null;
    int adminServiceNodePort = getServiceNodePort(domainNamespace, adminServerPodName + "-external", "default");
    checkCluster = new StringBuffer("status=$(curl --user weblogic:welcome1 ");
    checkCluster.append("http://" + K8S_NODEPORT_HOST + ":" + adminServiceNodePort)
          .append("/management/tenant-monitoring/servers/")
          .append(managedServer)
          .append(" --silent --show-error ")
          .append(" -o /dev/null")
          .append(" -w %{http_code});")
          .append("echo ${status}");
    logger.info("checkManagedServerConfiguration: curl command {0}", new String(checkCluster));
    try {
      result = exec(new String(checkCluster), true);
    } catch (Exception ex) {
      logger.info("Exception in checkManagedServerConfiguration() {0}", ex);
      return false;
    }
    logger.info("checkManagedServerConfiguration: curl command returned {0}", result.toString());
    if (result.stdout().equals("200")) {
      return true;
    } else {
      return false;
    }
  }
/*
   * Verify the server MBEAN configuration through rest API.
   * @param managedServer name of the managed server
   * @returns true if MBEAN is found otherwise false
   **/
Verify the server MBEAN configuration through rest API.
@param managedServer name of the managed server
@returns true if MBEAN is found otherwise false
Verify the server MBEAN configuration through rest API . @param managedServer name of the managed server @returns true if MBEAN is found otherwise false
private boolean checkManagedServerConfiguration(String managedServer) {
    ExecResult result = null;
    int adminServiceNodePort = getServiceNodePort(domainNamespace, adminServerPodName + "-external", "default");
    checkCluster = new StringBuffer("status=$(curl --user weblogic:welcome1 ");
    checkCluster.append("http://" + K8S_NODEPORT_HOST + ":" + adminServiceNodePort)
          .append("/management/tenant-monitoring/servers/")
          .append(managedServer)
          .append(" --silent --show-error ")
          .append(" -o /dev/null")
          .append(" -w %{http_code});")
          .append("echo ${status}");
    logger.info("checkManagedServerConfiguration: curl command {0}", new String(checkCluster));
    try {
      result = exec(new String(checkCluster), true);
    } catch (Exception ex) {
      logger.info("Exception in checkManagedServerConfiguration() {0}", ex);
      return false;
    }
    logger.info("checkManagedServerConfiguration: curl command returned {0}", result.toString());
    if (result.stdout().equals("200")) {
      return true;
    } else {
      return false;
    }
  }
private boolean checkManagedServerConfiguration ( String managedServer ) { ExecResult result = null ; int adminServiceNodePort = getServiceNodePort ( domainNamespace , adminServerPodName + "-external" , "default" ) ; checkCluster = new StringBuffer ( "status=$(curl --user weblogic:welcome1 " ) ; checkCluster . append ( "http://" + K8S_NODEPORT_HOST + ":" + adminServiceNodePort ) . append ( "/management/tenant-monitoring/servers/" ) . append ( managedServer ) . append ( " --silent --show-error " ) . append ( " -o /dev/null" ) . append ( " -w %{http_code});" ) . append ( "echo ${status}" ) ; logger . info ( "checkManagedServerConfiguration: curl command {0}" , new String ( checkCluster ) ) ; try { result = exec ( new String ( checkCluster ) , true ) ; } catch ( Exception ex ) { logger . info ( "Exception in checkManagedServerConfiguration() {0}" , ex ) ; return false ; } logger . info ( "checkManagedServerConfiguration: curl command returned {0}" , result . toString ( ) ) ; if ( result . stdout ( ) . equals ( "200" ) ) { return true ; } else { return false ; } }
Verify the server MBEAN configuration through rest API.
Verify the server MBEAN configuration through rest API .