internal static bool IsDevCluster(StandAloneInstallerJsonModelBase jsonConfig) { if (typeof(DevJsonModel).BaseType != jsonConfig.GetType()) { return(false); } Dictionary <string, string> fabricsettings = jsonConfig.GetFabricSystemSettings(); if (fabricsettings.ContainsKey(StringConstants.ParameterName.IsDevCluster) && string.Equals("true", fabricsettings[StringConstants.ParameterName.IsDevCluster], StringComparison.OrdinalIgnoreCase)) { return(true); } return(false); }
internal static StandAloneInstallerJsonModelBase GetJsonConfigFromString(string jsonString) { try { SFDeployerTrace.WriteNoise(StringResources.Info_BPAConvertingJsonToModel); StandAloneInstallerJsonModelBase result = DeserializeJsonConfig(typeof(StandAloneInstallerJsonModelGA), jsonString); var entry = StandAloneInstallerJsonModelBase.apiVersionTable.FirstOrDefault(p => p.Item1 == result.ApiVersion); if (entry != null) { Type modelType = entry.Item2; result = DeserializeJsonConfig(modelType, jsonString); if (DevJsonModel.IsDevCluster(result)) { result = DeserializeJsonConfig(typeof(DevJsonModel), jsonString); } return(result); } else { SFDeployerTrace.WriteWarning(string.Format("Json parsing: Unrecognized api version '{0}'", result.ApiVersion)); throw new NotSupportedException(result.ApiVersion + " is not supported!"); } } catch (Exception e) { var message = string.Format( CultureInfo.InvariantCulture, "{0}:{1}", StringResources.Error_SFJsonConfigInvalid, e.ToString()); SFDeployerTrace.WriteError(message); return(null); } }
internal virtual void ValidateModeDiff(StandAloneInstallerJsonModelBase orignialModel) { throw new System.NotImplementedException(); }