private QueryResponse CreateJob(Contracts.JobTypes.Sql.Model.SqlJob model) { var connectionString = model.ConnectionString; try { if (new EncryptionFeatureToggle().FeatureEnabled) { connectionString = AESGCM.SimpleEncrypt(connectionString, Convert.FromBase64String(ConfigurationManager.AppSettings["SchedulerEncryptionKey"])); } } catch (Exception ex) { Logger.Error("ConfigurationError creating SqlJob job.", ex); } var dataMap = new Dictionary <string, object> { { "connectionString", connectionString }, { "commandClass", model.CommandClass }, { "connectionClass", model.ConnectionClass }, { "commandStyle", model.CommandStyle }, { "providerAssemblyName", model.ProviderAssemblyName }, { "nonQueryCommand", model.NonQueryCommand }, { "dataAdapterClass", model.DataAdapterClass } }; return(base.CreateJob(model, typeof(SqlJob), dataMap, model.Description)); }
public QueryResponse Put([FromBody] Contracts.JobTypes.Sql.Model.SqlJob model) { Logger.DebugFormat("Entered SqlJobsController.Put(). Job Name = {0}", model.JobName); var authorizedJobGroups = _permissionsHelper.GetAuthorizedJobGroups().ToList(); if ((authorizedJobGroups.Contains(model.JobGroup) || authorizedJobGroups.Contains("*")) && model.JobGroup != "*") { return(CreateJob(model)); } throw new HttpResponseException(HttpStatusCode.Unauthorized); }
public QueryResponse Post([FromBody] Contracts.JobTypes.Sql.Model.SqlJob model) { Logger.DebugFormat("Entered SqlJobsController.Post(). Job Name = {0}", model.JobName); var dataMap = new Dictionary <string, object> { { "connectionString", model.ConnectionString }, { "commandClass", model.CommandClass }, { "connectionClass", model.ConnectionClass }, { "commandStyle", model.CommandStyle }, { "providerAssemblyName", model.ProviderAssemblyName }, { "nonQueryCommand", model.NonQueryCommand }, { "dataAdapterClass", model.DataAdapterClass } }; return(base.CreateJob(model, typeof(SqlJob), dataMap, model.Description)); }
public QueryResponse Put([FromBody] Contracts.JobTypes.Sql.Model.SqlJob model) { Logger.DebugFormat("Entered SqlJobsController.Put(). Job Name = {0}", model.JobName); return(CreateJob(model)); }