log_error("Failed to validate configs from user (validate only), error=" . $result["error"]); print json_encode($result); return; } } else { $result = validateAndPersistConfigsFromUser($dbAccessor, $logger, $clusterName, $finalProperties); if ($result['result'] != 0) { $logger->log_error("Failed to validate configs from user (validate and persist), error=" . $result["error"]); print json_encode($result); return; } } $jsonOutput = array(); $jsonOutput['clusterName'] = $clusterName; // Update the state of the cluster. $result = 0; $error = ""; $state = "CONFIGURATION_IN_PROGRESS"; $displayName = "Configuration in progress"; $context = array ( 'stage' => "CONFIGURE_SERVICES" ); $retval = updateClusterState($clusterName, $state, $displayName, $context); if ($retval['result'] != 0) { $result = $retval['result']; $error = $retval['error']; } print (json_encode(array("result" => $result, "error" => $error, "response" => $jsonOutput))); ?>