diff --git a/src/Microsoft.SqlTools.ServiceLayer/Admin/AdminService.cs b/src/Microsoft.SqlTools.ServiceLayer/Admin/AdminService.cs
index 56a2bc78..6a774c94 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Admin/AdminService.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Admin/AdminService.cs
@@ -7,12 +7,13 @@ using System;
using System.Collections.Concurrent;
using System.Threading.Tasks;
using System.Xml;
+using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlTools.Hosting.Protocol;
using Microsoft.SqlTools.ServiceLayer.Admin.Contracts;
using Microsoft.SqlTools.ServiceLayer.Connection;
using Microsoft.SqlTools.ServiceLayer.Hosting;
+using Microsoft.SqlTools.ServiceLayer.Management;
using Microsoft.SqlTools.ServiceLayer.Utility;
-using Microsoft.SqlServer.Management.Smo;
namespace Microsoft.SqlTools.ServiceLayer.Admin
{
@@ -189,51 +190,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Admin
}
}
- ///
- /// Create a data container object
- ///
- /// connection info
- /// flag indicating whether to create taskhelper for existing database or not
- internal static CDataContainer CreateDataContainer(ConnectionInfo connInfo, bool databaseExists = false)
- {
- XmlDocument xmlDoc = CreateDataContainerDocument(connInfo, databaseExists);
- CDataContainer dataContainer;
-
- // add alternate port to server name property if provided
- var connectionDetails = connInfo.ConnectionDetails;
- string serverName = !connectionDetails.Port.HasValue
- ? connectionDetails.ServerName
- : string.Format("{0},{1}", connectionDetails.ServerName, connectionDetails.Port.Value);
-
- // check if the connection is using SQL Auth or Integrated Auth
- //TODO: ConnectionQueue try to get an existing connection (ConnectionQueue)
- if (string.Equals(connectionDetails.AuthenticationType, "SqlLogin", StringComparison.OrdinalIgnoreCase))
- {
- var passwordSecureString = BuildSecureStringFromPassword(connectionDetails.Password);
- dataContainer = new CDataContainer(
- CDataContainer.ServerType.SQL,
- serverName,
- false,
- connectionDetails.UserName,
- passwordSecureString,
- connectionDetails.DatabaseName,
- xmlDoc.InnerXml);
- }
- else
- {
- dataContainer = new CDataContainer(
- CDataContainer.ServerType.SQL,
- serverName,
- true,
- null,
- null,
- connectionDetails.DatabaseName,
- xmlDoc.InnerXml);
- }
-
- return dataContainer;
- }
-
///
/// Create database task helper
///
@@ -242,65 +198,11 @@ namespace Microsoft.SqlTools.ServiceLayer.Admin
///
internal static DatabaseTaskHelper CreateDatabaseTaskHelper(ConnectionInfo connInfo, bool databaseExists = false)
{
- var dataContainer = CreateDataContainer(connInfo, databaseExists);
+ var dataContainer = CDataContainer.CreateDataContainer(connInfo, databaseExists);
var taskHelper = new DatabaseTaskHelper(dataContainer);
return taskHelper;
}
- internal static System.Security.SecureString BuildSecureStringFromPassword(string password) {
- var passwordSecureString = new System.Security.SecureString();
- if (password != null) {
- foreach (char c in password) {
- passwordSecureString.AppendChar(c);
- }
- }
- return passwordSecureString;
- }
-
- ///
- /// Create data container document
- ///
- /// connection info
- /// flag indicating whether to create document for existing database or not
- ///
- private static XmlDocument CreateDataContainerDocument(ConnectionInfo connInfo, bool databaseExists)
- {
- string xml = string.Empty;
-
- if (!databaseExists)
- {
- xml =
- string.Format(@"
-
- {0}
- {0} (SQLServer, user = {1})
- sql
- Server[@Name='{0}']
- Database
- ",
- connInfo.ConnectionDetails.ServerName.ToUpper(),
- connInfo.ConnectionDetails.UserName);
- }
- else
- {
- xml =
- string.Format(@"
-
- {0}
- {0} (SQLServer, user = {1})
- sql
- Server[@Name='{0}']
- {2}
- ",
- connInfo.ConnectionDetails.ServerName.ToUpper(),
- connInfo.ConnectionDetails.UserName,
- connInfo.ConnectionDetails.DatabaseName);
- }
- var xmlDoc = new XmlDocument();
- xmlDoc.LoadXml(xml);
- return xmlDoc;
- }
-
///
/// Handles a create login request
///
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/AzureSqlDbHelper.cs b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/AzureSqlDbHelper.cs
index aaa3a8f2..585cf1e6 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/AzureSqlDbHelper.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/AzureSqlDbHelper.cs
@@ -9,8 +9,9 @@ using System.Collections.Generic;
using System.Globalization;
using Microsoft.SqlServer.Diagnostics.STrace;
using Microsoft.SqlServer.Management.Common;
+using Microsoft.SqlTools.ServiceLayer.Management;
using Microsoft.Win32;
-using SizeUnits = Microsoft.SqlTools.ServiceLayer.Admin.DbSize.SizeUnits;
+using SizeUnits = Microsoft.SqlTools.ServiceLayer.Management.DbSize.SizeUnits;
namespace Microsoft.SqlTools.ServiceLayer.Admin
{
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/CreateDatabaseObjects.cs b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/CreateDatabaseObjects.cs
index 73d24c0d..2c3f5a35 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/CreateDatabaseObjects.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/CreateDatabaseObjects.cs
@@ -20,6 +20,7 @@ using System.Globalization;
using System.Data.SqlClient;
using System.Collections.Generic;
using AzureEdition = Microsoft.SqlTools.ServiceLayer.Admin.AzureSqlDbHelper.AzureEdition;
+using Microsoft.SqlTools.ServiceLayer.Management;
namespace Microsoft.SqlTools.ServiceLayer.Admin
{
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype.cs b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype.cs
index 13ad867c..693d8076 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype.cs
@@ -17,6 +17,7 @@ using System.Data.SqlClient;
using System.Collections.Generic;
using System.Diagnostics;
using AzureEdition = Microsoft.SqlTools.ServiceLayer.Admin.AzureSqlDbHelper.AzureEdition;
+using Microsoft.SqlTools.ServiceLayer.Management;
namespace Microsoft.SqlTools.ServiceLayer.Admin
{
@@ -117,8 +118,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Admin
///
public DatabaseData(CDataContainer context)
{
- this.name = String.Empty;
- this.owner = String.Empty;
+ this.name = string.Empty;
+ this.owner = string.Empty;
this.restrictAccess = DatabaseUserAccess.Multiple;
this.isReadOnly = false;
this.databaseState = DatabaseStatus.Normal;
@@ -176,7 +177,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Admin
this.targetRecoveryTime = 0;
-
ResourceManager manager = new ResourceManager("Microsoft.SqlTools.ServiceLayer.Localization.SR", typeof(DatabasePrototype).GetAssembly());
//in katmai var decimal going to be true by default
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype100.cs b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype100.cs
index f5178e72..a3efb6f3 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype100.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype100.cs
@@ -10,6 +10,7 @@ using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Sdk.Sfc;
using Microsoft.SqlServer.Management.Diagnostics;
+using Microsoft.SqlTools.ServiceLayer.Management;
namespace Microsoft.SqlTools.ServiceLayer.Admin
{
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype110.cs b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype110.cs
index bfbb9b12..830ed761 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype110.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype110.cs
@@ -7,6 +7,7 @@ using System.ComponentModel;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Sdk.Sfc;
+using Microsoft.SqlTools.ServiceLayer.Management;
namespace Microsoft.SqlTools.ServiceLayer.Admin
{
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype80.cs b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype80.cs
index 7f272827..821ace63 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype80.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype80.cs
@@ -10,6 +10,7 @@ using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Sdk.Sfc;
using Microsoft.SqlServer.Management.Diagnostics;
using System.Collections.Generic;
+using Microsoft.SqlTools.ServiceLayer.Management;
namespace Microsoft.SqlTools.ServiceLayer.Admin
{
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype80SP3.cs b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype80SP3.cs
index c1fc9b80..7e1bb28a 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype80SP3.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype80SP3.cs
@@ -5,6 +5,7 @@
using System.ComponentModel;
using Microsoft.SqlServer.Management.Sdk.Sfc;
+using Microsoft.SqlTools.ServiceLayer.Management;
namespace Microsoft.SqlTools.ServiceLayer.Admin
{
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype90.cs b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype90.cs
index 9a2774ab..e7860e3e 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype90.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype90.cs
@@ -10,6 +10,7 @@ using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Sdk.Sfc;
using Microsoft.SqlServer.Management.Diagnostics;
using System.Collections.Generic;
+using Microsoft.SqlTools.ServiceLayer.Management;
namespace Microsoft.SqlTools.ServiceLayer.Admin
{
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype90EnterpriseSP2.cs b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype90EnterpriseSP2.cs
index 23a63f6f..4a268626 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype90EnterpriseSP2.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototype90EnterpriseSP2.cs
@@ -6,6 +6,7 @@
using System.ComponentModel;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Sdk.Sfc;
+using Microsoft.SqlTools.ServiceLayer.Management;
namespace Microsoft.SqlTools.ServiceLayer.Admin
{
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototypeAzure.cs b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototypeAzure.cs
index 8f1ddd76..b11fe25e 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototypeAzure.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabasePrototypeAzure.cs
@@ -11,6 +11,7 @@ using System.Linq;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Sdk.Sfc;
using Microsoft.SqlServer.Management.Smo;
+using Microsoft.SqlTools.ServiceLayer.Management;
using AzureEdition = Microsoft.SqlTools.ServiceLayer.Admin.AzureSqlDbHelper.AzureEdition;
namespace Microsoft.SqlTools.ServiceLayer.Admin
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabaseTaskHelper.cs b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabaseTaskHelper.cs
index 9730b0f0..709249a8 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabaseTaskHelper.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Admin/Database/DatabaseTaskHelper.cs
@@ -6,6 +6,7 @@
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlTools.ServiceLayer.Admin.Contracts;
+using Microsoft.SqlTools.ServiceLayer.Management;
using Microsoft.SqlTools.Utility;
using System;
using System.Collections;
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Agent/AgentService.cs b/src/Microsoft.SqlTools.ServiceLayer/Agent/AgentService.cs
index 26f4214b..f4bbbdf2 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Agent/AgentService.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Agent/AgentService.cs
@@ -6,9 +6,11 @@
using System;
using System.Collections.Generic;
using System.Data;
+using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using System.Xml;
using Microsoft.SqlServer.Management.Common;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Smo.Agent;
@@ -326,7 +328,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
Tuple result = await ConfigureAgentJobStep(
parameters.OwnerUri,
parameters.Step,
- ConfigAction.Create);
+ ConfigAction.Create,
+ RunType.RunNow);
await requestContext.SendResult(new CreateAgentJobStepResult()
{
@@ -337,14 +340,32 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
internal async Task HandleUpdateAgentJobStepRequest(UpdateAgentJobStepParams parameters, RequestContext requestContext)
{
- UpdateAgentJobStepResult result = new UpdateAgentJobStepResult();
- await requestContext.SendResult(result);
+ Tuple result = await ConfigureAgentJobStep(
+ parameters.OwnerUri,
+ parameters.Step,
+ ConfigAction.Update,
+ RunType.RunNow);
+
+ await requestContext.SendResult(new UpdateAgentJobStepResult()
+ {
+ Success = result.Item1,
+ ErrorMessage = result.Item2
+ });
}
internal async Task HandleDeleteAgentJobStepRequest(DeleteAgentJobStepParams parameters, RequestContext requestContext)
{
- ResultStatus result = new ResultStatus();
- await requestContext.SendResult(result);
+ Tuple result = await ConfigureAgentJobStep(
+ parameters.OwnerUri,
+ parameters.Step,
+ ConfigAction.Drop,
+ RunType.RunNow);
+
+ await requestContext.SendResult(new ResultStatus()
+ {
+ Success = result.Item1,
+ ErrorMessage = result.Item2
+ });
}
internal async Task> ConfigureAgentJob(
@@ -362,10 +383,19 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
ownerUri,
out connInfo);
- CDataContainer dataContainer = AdminService.CreateDataContainer(connInfo, databaseExists: true);
+ CDataContainer dataContainer = CDataContainer.CreateDataContainer(
+ connInfo,
+ databaseExists: true);
+
+ XmlDocument jobDoc = CreateJobXmlDocument(
+ dataContainer.Server.Name.ToUpper(),
+ jobInfo.Name);
+
+ dataContainer.Init(jobDoc.InnerXml);
+
STParameters param = new STParameters(dataContainer.Document);
param.SetParam("job", string.Empty);
- param.SetParam("jobid", jobInfo.JobId);
+ param.SetParam("jobid", string.Empty);
var jobData = new JobData(dataContainer, jobInfo);
using (JobActions jobActions = new JobActions(dataContainer, jobData, configAction))
@@ -386,13 +416,14 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
internal async Task> ConfigureAgentJobStep(
string ownerUri,
AgentJobStepInfo stepInfo,
- ConfigAction configAction)
+ ConfigAction configAction,
+ RunType runType)
{
return await Task>.Run(() =>
{
try
{
- if (string.IsNullOrWhiteSpace(stepInfo.JobId))
+ if (string.IsNullOrWhiteSpace(stepInfo.JobName))
{
return new Tuple(false, "JobId cannot be null");
}
@@ -402,17 +433,25 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
ownerUri,
out connInfo);
- CDataContainer dataContainer = AdminService.CreateDataContainer(connInfo, databaseExists: true);
+ CDataContainer dataContainer = CDataContainer.CreateDataContainer(
+ connInfo,
+ databaseExists: true);
+
+ XmlDocument jobDoc = CreateJobXmlDocument(
+ dataContainer.Server.Name.ToUpper(),
+ stepInfo.JobName);
+
+ dataContainer.Init(jobDoc.InnerXml);
+
STParameters param = new STParameters(dataContainer.Document);
param.SetParam("job", string.Empty);
- param.SetParam("jobid", stepInfo.JobId);
- param.SetParam("script", stepInfo.Script);
- param.SetParam("scriptName", stepInfo.ScriptName);
+ param.SetParam("jobid", string.Empty);
var jobData = new JobData(dataContainer);
- using (var jobStep = new JobStepsActions(dataContainer, jobData))
+ using (var jobStep = new JobStepsActions(dataContainer, jobData, stepInfo, configAction))
{
- jobStep.CreateJobStep();
+ var executionHandler = new ExecutonHandler(jobStep);
+ executionHandler.RunNow(runType, this);
}
return new Tuple(true, string.Empty);
@@ -425,6 +464,38 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
});
}
+ public XmlDocument CreateJobXmlDocument(string svrName, string jobName)
+ {
+ // XML element strings
+ const string XmlFormDescElementName = "formdescription";
+ const string XmlParamsElementName = "params";
+ const string XmlJobElementName = "job";
+ const string XmlUrnElementName = "urn";
+ const string UrnFormatStr = "Server[@Name='{0}']/JobServer[@Name='{0}']/Job[@Name='{1}']";
+
+ // Write out XML.
+ StringWriter textWriter = new StringWriter();
+ XmlTextWriter xmlWriter = new XmlTextWriter(textWriter);
+
+ xmlWriter.WriteStartElement(XmlFormDescElementName);
+ xmlWriter.WriteStartElement(XmlParamsElementName);
+
+ xmlWriter.WriteElementString(XmlJobElementName, jobName);
+ xmlWriter.WriteElementString(XmlUrnElementName, string.Format(UrnFormatStr, svrName, jobName));
+
+ xmlWriter.WriteEndElement();
+ xmlWriter.WriteEndElement();
+
+ xmlWriter.Close();
+
+ // Create an XML document.
+ XmlDocument doc = new XmlDocument();
+ XmlTextReader rdr = new XmlTextReader(new System.IO.StringReader(textWriter.ToString()));
+ rdr.MoveToContent();
+ doc.LoadXml(rdr.ReadOuterXml());
+ return doc;
+ }
+
#endregion // "Jobs Handlers"
#region "Alert Handlers"
@@ -446,7 +517,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
if (connInfo != null)
{
- CDataContainer dataContainer = AdminService.CreateDataContainer(connInfo, databaseExists: true);
+ CDataContainer dataContainer = CDataContainer.CreateDataContainer(connInfo, databaseExists: true);
AlertCollection alerts = dataContainer.Server.JobServer.Alerts;
}
@@ -502,7 +573,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
{
if (connInfo != null && ValidateAgentAlertInfo(alert))
{
- CDataContainer dataContainer = AdminService.CreateDataContainer(connInfo, databaseExists: true);
+ CDataContainer dataContainer = CDataContainer.CreateDataContainer(connInfo, databaseExists: true);
STParameters param = new STParameters(dataContainer.Document);
param.SetParam("alert", alert.JobName);
@@ -531,7 +602,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
AgentAlertInfo alert = parameters.Alert;
if (connInfo != null && ValidateAgentAlertInfo(alert))
{
- CDataContainer dataContainer = AdminService.CreateDataContainer(connInfo, databaseExists: true);
+ CDataContainer dataContainer = CDataContainer.CreateDataContainer(connInfo, databaseExists: true);
STParameters param = new STParameters(dataContainer.Document);
param.SetParam("alert", alert.JobName);
@@ -572,7 +643,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
out connInfo);
AgentOperatorInfo operatorInfo = parameters.Operator;
- CDataContainer dataContainer = AdminService.CreateDataContainer(connInfo, databaseExists: true);
+ CDataContainer dataContainer = CDataContainer.CreateDataContainer(connInfo, databaseExists: true);
STParameters param = new STParameters(dataContainer.Document);
param.SetParam("operator", operatorInfo.Name);
@@ -662,7 +733,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
ownerUri,
out connInfo);
- CDataContainer dataContainer = AdminService.CreateDataContainer(connInfo, databaseExists: true);
+ CDataContainer dataContainer = CDataContainer.CreateDataContainer(connInfo, databaseExists: true);
STParameters param = new STParameters(dataContainer.Document);
param.SetParam("proxyaccount", accountName);
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Agent/Contracts/AgentJobStepInfo.cs b/src/Microsoft.SqlTools.ServiceLayer/Agent/Contracts/AgentJobStepInfo.cs
index e2ea9821..12bebc0b 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Agent/Contracts/AgentJobStepInfo.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Agent/Contracts/AgentJobStepInfo.cs
@@ -13,6 +13,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent.Contracts
{
public string JobId { get; set; }
+ public string JobName { get; set; }
+
public string Script { get; set; }
public string ScriptName { get; set; }
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobActions.cs b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobActions.cs
index 2fe116c2..89c03423 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobActions.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobActions.cs
@@ -49,13 +49,23 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
protected override bool DoPreProcessExecution(RunType runType, out ExecutionMode executionResult)
{
base.DoPreProcessExecution(runType, out executionResult);
- this.data.ApplyChanges(creating: true);
- if (!IsScripting(runType))
- {
- this.DataContainer.SqlDialogSubject = this.data.Job;
- }
+ if (this.configAction == ConfigAction.Drop)
+ {
+ if (this.data.Job != null)
+ {
+ this.data.Job.DropIfExists();
+ }
+ }
+ else
+ {
+ this.data.ApplyChanges(creating: this.configAction == ConfigAction.Create);
+ if (!IsScripting(runType))
+ {
+ this.DataContainer.SqlDialogSubject = this.data.Job;
+ }
+ }
return false;
- }
+ }
}
}
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobAlertsData.cs b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobAlertsData.cs
index dae587e7..0f08c329 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobAlertsData.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobAlertsData.cs
@@ -16,6 +16,7 @@ using Microsoft.SqlServer.Management.Smo.Agent;
using Microsoft.SqlServer.Management.Diagnostics;
using Microsoft.SqlTools.ServiceLayer.Admin;
using SMO = Microsoft.SqlServer.Management.Smo;
+using Microsoft.SqlTools.ServiceLayer.Management;
namespace Microsoft.SqlTools.ServiceLayer.Agent
{
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobData.cs b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobData.cs
index 02153f04..c3e4bf52 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobData.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobData.cs
@@ -14,6 +14,7 @@ using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Smo.Agent;
using Microsoft.SqlTools.ServiceLayer.Admin;
using Microsoft.SqlTools.ServiceLayer.Agent.Contracts;
+using Microsoft.SqlTools.ServiceLayer.Management;
using SMO = Microsoft.SqlServer.Management.Smo;
namespace Microsoft.SqlTools.ServiceLayer.Agent
@@ -1139,9 +1140,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
else
{
// just lookup the original object
- STParameters parameters = new STParameters(this.context.Document);
- string urn = string.Empty;
- job = this.context.Server.GetSmoObject(this.urn) as Job;
+ job = this.Job;
}
if (!this.IsReadOnly)
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobSchedulesData.cs b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobSchedulesData.cs
index 50eaaf8e..9c6047ee 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobSchedulesData.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobSchedulesData.cs
@@ -15,8 +15,10 @@ using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Smo.Agent;
using Microsoft.SqlServer.Management.Diagnostics;
using Microsoft.SqlTools.ServiceLayer.Admin;
+using Microsoft.SqlTools.ServiceLayer.Management;
using SMO = Microsoft.SqlServer.Management.Smo;
+
namespace Microsoft.SqlTools.ServiceLayer.Agent
{
internal class JobSchedulesData
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepAdvancedLogging.cs b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepAdvancedLogging.cs
index dce1798e..45e0be92 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepAdvancedLogging.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepAdvancedLogging.cs
@@ -17,6 +17,7 @@ using System.Text;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Smo.Agent;
using Microsoft.SqlTools.ServiceLayer.Admin;
+using Microsoft.SqlTools.ServiceLayer.Management;
namespace Microsoft.SqlTools.ServiceLayer.Agent
{
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepData.cs b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepData.cs
index c7e811af..58e62bc4 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepData.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepData.cs
@@ -15,7 +15,6 @@ using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Smo.Agent;
using SMO = Microsoft.SqlServer.Management.Smo;
-
namespace Microsoft.SqlTools.ServiceLayer.Agent
{
internal class JobStepData
@@ -45,26 +44,32 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
/// Original name of this step
///
string originalName;
+
///
/// Current name
///
string currentName;
+
///
/// Current step id
///
int id;
+
///
/// Original step id
///
int originalId;
+
///
/// Subsystem that will execute this step
///
AgentSubSystem subSystem;
+
///
/// action to take if the step fails
///
StepCompletionAction failureAction;
+
///
/// Action to take if the step succeeds
///
@@ -175,6 +180,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
return jobStep;
}
}
+
///
/// Server version
///
@@ -185,6 +191,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
return this.parent.Version;
}
}
+
///
/// indicates whether the job exists on the server
///
@@ -237,7 +244,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
#endregion
#region Properties for Job Step
- public String Name
+ public string Name
{
get
{
@@ -248,7 +255,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
this.currentName = value.Trim();
}
}
- public String Command
+
+ public string Command
{
get
{
@@ -274,7 +282,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
this.commandExecutionSuccessCode = value;
}
}
- public String DatabaseName
+ public string DatabaseName
{
get
{
@@ -287,7 +295,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
this.databaseName = value;
}
}
- public String DatabaseUserName
+ public string DatabaseUserName
{
get
{
@@ -300,7 +308,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
this.databaseUserName = value;
}
}
- public String Server
+ public string Server
{
get
{
@@ -706,7 +714,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
this.successStep = null;
this.successStepId = -1;
this.priority = OSRunPriority.Normal;
- this.outputFileName = String.Empty;
+ this.outputFileName = string.Empty;
this.appendToLogFile = false;
this.appendToStepHist = false;
this.writeLogToTable = false;
@@ -1027,15 +1035,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
this.failStep = step;
}
-
#endregion
}
}
-
-
-
-
-
-
-
-
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepSubSystems.cs b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepSubSystems.cs
index 5ef01bf2..9a5f2d16 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepSubSystems.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepSubSystems.cs
@@ -13,6 +13,7 @@ using Microsoft.SqlServer.Management.Sdk.Sfc;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Smo.Agent;
using Microsoft.SqlTools.ServiceLayer.Admin;
+using Microsoft.SqlTools.ServiceLayer.Management;
namespace Microsoft.SqlTools.ServiceLayer.Agent
{
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepsActions.cs b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepsActions.cs
index c2dff870..e8208801 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepsActions.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepsActions.cs
@@ -4,168 +4,88 @@
//
using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
-using System.Text;
-using Microsoft.SqlServer.Management.Common;
-using Microsoft.SqlServer.Management.Diagnostics;
-using Microsoft.SqlServer.Management.Sdk.Sfc;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Smo.Agent;
using Microsoft.SqlTools.ServiceLayer.Admin;
+using Microsoft.SqlTools.ServiceLayer.Agent.Contracts;
using Microsoft.SqlTools.ServiceLayer.Management;
namespace Microsoft.SqlTools.ServiceLayer.Agent
{
///
- /// Summary description for JobSteps.
+ /// JobStepsActions
///
internal class JobStepsActions : ManagementActionBase
{
- private bool validated = true;
+ private JobStepData data;
+ private JobData jobData;
- private JobData data;
-
- public JobStepsActions(CDataContainer dataContainer, JobData data)
+ public JobStepsActions(
+ CDataContainer dataContainer,
+ JobData jobData,
+ AgentJobStepInfo stepInfo,
+ ConfigAction configAction)
{
this.DataContainer = dataContainer;
- this.data = data;
+ this.jobData = jobData;
+
+ if (configAction == ConfigAction.Update)
+ {
+ JobStep jobStep = GetJobStep(this.jobData, stepInfo.StepName);
+ this.data = new JobStepData(jobStep, jobData.JobSteps);
+ }
+ else
+ {
+ this.data = new JobStepData(jobData.JobSteps);
+ }
+
+ // load properties from AgentJobStepInfo
+ this.data.ID = stepInfo.Id;
+ this.data.Name = stepInfo.StepName;
+ this.data.Command = stepInfo.Script;
}
- #region ISupportValidation
- ///
- /// Validate the Job step data.
- /// This is limited to two checks
- /// 1. See if all steps are reachable
- /// 2. If we are editing rather than creating check to see if the last steps completion
- /// action will change from GoToNext to QuitWithSuccess.
- ///
- /// true if the checks passed, or the user has ok the warning
- public bool Validate()
+ protected override bool DoPreProcessExecution(RunType runType, out ExecutionMode executionResult)
{
- // Only validate once after the user has made changes. Validate() is called when the
- // user navigates away from the JobSteps page, and if they navigate back and then out
- // again they'd be prompted twice. This annoys our users.
- if (this.validated)
+ base.DoPreProcessExecution(runType, out executionResult);
+
+ // Make sure the job step name is not blank.
+ if (this.data.Name == null || this.data.Name.Length == 0)
{
- return true;
+ throw new Exception(SR.JobStepNameCannotBeBlank);
}
-
- bool valid = true;
- // Get the unreachable steps
- List unreachableSteps = this.data.JobSteps.FindUnreachableJobSteps();
- // see if the last step success completion action will change
- bool lastStepWillChange = this.data.JobSteps.CheckIfLastStepCompletionActionWillChange();
- // warning message
- StringBuilder warningMessage = new StringBuilder();
-
- // if there are unreachable steps, add the warning and each problematic step
- if (unreachableSteps.Count > 0)
+ // Check to make sure that the user has not entered a job step name that already exists.
+ for (int stepIndex = 0; stepIndex < this.data.Parent.Steps.Count; ++stepIndex)
{
- warningMessage.AppendLine("JobSR.UnreachableStepHeader");
- foreach (JobStepData jobStep in unreachableSteps)
+ // don't compare if the id's are the same.
+ if (data.ID != ((JobStepData)this.data.Parent.Steps[stepIndex]).ID && data.Name == ((JobStepData)this.data.Parent.Steps[stepIndex]).Name)
{
- warningMessage.AppendLine("JobSR.UnreachableStepFormat(jobStep.ID, jobStep.Name)");
+ // Throw an error if the job step name already exists
+ throw new Exception(SR.JobStepNameAlreadyExists(this.data.Name));
}
- warningMessage.AppendLine(string.Empty);
}
- // add a warning if the last step will change
- if (lastStepWillChange)
- {
- warningMessage.AppendLine("JobSR.LastStepSuccessWillChange");
- warningMessage.AppendLine(string.Empty);
+ if (runType == RunType.RunNow)
+ {
+ this.data.ApplyChanges(this.jobData.Job);
}
- // if anything was wrong tell the user and see if they are ok with it
- if (warningMessage.Length > 0)
- {
- warningMessage.Append("JobSR.AreYouSure");
- }
-
- this.validated = valid;
- return valid;
+ // regular execution always takes place
+ return true;
}
- #endregion
-
- // private void PopulateGrid(JobStepsData steps)
- // {
- // for (int i = 0; i < steps.Steps.Count; i++)
- // {
- // JobStepData step = steps.Steps[i] as JobStepData;
- // if (step != null)
- // {
- // // add rows to the grid
- // GridCellCollection row = new GridCellCollection();
- // GridCell cell;
-
- // // id
- // cell = new GridCell(step.ID.ToString(CultureInfo.InvariantCulture));
- // row.Add(cell);
- // // step name
- // cell = new GridCell(step.Name);
- // row.Add(cell);
- // // subsystem
- // cell = new GridCell(JobStepSubSystems.LookupFriendlyName(step.SubSystem));
- // row.Add(cell);
- // // on success
- // cell = new GridCell(GetFriendlyNameForAction(step.SuccessAction, step.SuccessStep));
- // row.Add(cell);
- // // on failure
- // cell = new GridCell(GetFriendlyNameForAction(step.FailureAction, step.FailStep));
- // row.Add(cell);
-
- // this.jobStepList.AddRow(row);
- // }
- // }
- // }
- ///
- /// Convert an action and it's target step to a localizable user friendly name
- ///
- ///
- ///
- ///
- // private static string GetFriendlyNameForAction(StepCompletionAction action, JobStepData targetStep)
- // {
- // String friendlyName = String.Empty;
- // // switch (action)
- // // {
- // // case StepCompletionAction.GoToNextStep:
- // // friendlyName = JobSR.GotoNextStep;
- // // break;
- // // case StepCompletionAction.QuitWithFailure:
- // // friendlyName = JobSR.QuitWithFailure;
- // // break;
- // // case StepCompletionAction.QuitWithSuccess:
- // // friendlyName = JobSR.QuitWithSuccess;
- // // break;
- // // case StepCompletionAction.GoToStep:
- // // STrace.Assert(targetStep != null, "Action type is goto step, but the target step is null");
- // // if (targetStep != null)
- // // {
- // // friendlyName = JobSR.GotoStep(targetStep.ID, targetStep.Name);
- // // }
- // // break;
- // // default:
- // // STrace.Assert(false, "Unknown jobstep completion action");
- // // break;
- // // }
- // return friendlyName;
- // }
-
-
- public void CreateJobStep()
+ private JobStep GetJobStep(JobData jobData, string stepName)
{
- //JobStepData data = new JobStepData(this.data.JobSteps);
- JobStepData data = this.data.JobSteps.Steps[0] as JobStepData;
- JobStepPropertySheet jsProp = new JobStepPropertySheet(this.DataContainer, data);
-
- jsProp.Init();
- jsProp.Create();
+ JobStep jobStep = null;
+ if (jobData.Job != null)
+ {
+ const string UrnFormatStr = "Server[@Name='{0}']/JobServer[@Name='{0}']/Job[@Name='{1}']/Step[@Name='{2}']";
+ string serverName = this.DataContainer.Server.Name.ToUpper();
+ string urn = string.Format(UrnFormatStr, serverName, jobData.Job.Name, stepName);
+ jobStep = jobData.Job.Parent.Parent.GetSmoObject(urn) as JobStep;
+ }
+ return jobStep;
}
}
}
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepsData.cs b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepsData.cs
index 27c0d0af..1ed50205 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepsData.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobStepsData.cs
@@ -14,6 +14,7 @@ using Microsoft.SqlServer.Management.Sdk.Sfc;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Smo.Agent;
using Microsoft.SqlTools.ServiceLayer.Admin;
+using Microsoft.SqlTools.ServiceLayer.Management;
using SMO = Microsoft.SqlServer.Management.Smo;
namespace Microsoft.SqlTools.ServiceLayer.Agent
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobsReferencingScheduleForm.cs b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobsReferencingScheduleForm.cs
index 294ecf62..cf9f81c7 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobsReferencingScheduleForm.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Agent/Jobs/JobsReferencingScheduleForm.cs
@@ -9,18 +9,14 @@ using System.Collections;
using System.ComponentModel;
using Microsoft.SqlServer.Management.Smo.Agent;
using Microsoft.SqlTools.ServiceLayer.Admin;
+using Microsoft.SqlTools.ServiceLayer.Management;
namespace Microsoft.SqlServer.Management.SqlManagerUI
{
///
/// Summary description for JobsRefrencingScheduleForm.
///
-#if DEBUG || EXPOSE_MANAGED_INTERNALS
- public
-#else
- internal
-#endif
- class JobsReferencingScheduleForm
+ public class JobsReferencingScheduleForm
{
#region UI Variables
diff --git a/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/BackupOperation/BackupOperation.cs b/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/BackupOperation/BackupOperation.cs
index c8759bc4..f41d24ba 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/BackupOperation/BackupOperation.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/BackupOperation/BackupOperation.cs
@@ -13,6 +13,7 @@ using Microsoft.SqlServer.Management.Sdk.Sfc;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlTools.ServiceLayer.Admin;
using Microsoft.SqlTools.ServiceLayer.DisasterRecovery.Contracts;
+using Microsoft.SqlTools.ServiceLayer.Management;
using Microsoft.SqlTools.ServiceLayer.TaskServices;
namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery
diff --git a/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/BackupOperation/IBackupOperation.cs b/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/BackupOperation/IBackupOperation.cs
index 84d33012..eff0520e 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/BackupOperation/IBackupOperation.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/BackupOperation/IBackupOperation.cs
@@ -5,6 +5,7 @@
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlTools.ServiceLayer.Admin;
using Microsoft.SqlTools.ServiceLayer.DisasterRecovery.Contracts;
+using Microsoft.SqlTools.ServiceLayer.Management;
using Microsoft.SqlTools.ServiceLayer.TaskServices;
using System.Data.SqlClient;
diff --git a/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/CommonUtilities.cs b/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/CommonUtilities.cs
index 123a88da..7db67b6c 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/CommonUtilities.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/CommonUtilities.cs
@@ -11,6 +11,7 @@ using Microsoft.SqlServer.Management.Sdk.Sfc;
using Microsoft.SqlServer.Management.Smo;
using SMO = Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlTools.ServiceLayer.Admin;
+using Microsoft.SqlTools.ServiceLayer.Management;
namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery
{
diff --git a/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/DisasterRecoveryService.cs b/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/DisasterRecoveryService.cs
index 046c5c9a..792b53df 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/DisasterRecoveryService.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/DisasterRecovery/DisasterRecoveryService.cs
@@ -13,6 +13,7 @@ using Microsoft.SqlTools.ServiceLayer.Connection.Contracts;
using Microsoft.SqlTools.ServiceLayer.DisasterRecovery.Contracts;
using Microsoft.SqlTools.ServiceLayer.DisasterRecovery.RestoreOperation;
using Microsoft.SqlTools.ServiceLayer.FileBrowser;
+using Microsoft.SqlTools.ServiceLayer.Management;
using Microsoft.SqlTools.ServiceLayer.TaskServices;
using Microsoft.SqlTools.Utility;
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs
index 7a261ffc..a58767e3 100755
--- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.cs
@@ -4341,6 +4341,14 @@ namespace Microsoft.SqlTools.ServiceLayer
}
}
+ public static string JobStepNameCannotBeBlank
+ {
+ get
+ {
+ return Keys.GetString(Keys.JobStepNameCannotBeBlank);
+ }
+ }
+
public static string ConnectionServiceListDbErrorNotConnected(string uri)
{
return Keys.GetString(Keys.ConnectionServiceListDbErrorNotConnected, uri);
@@ -4576,6 +4584,16 @@ namespace Microsoft.SqlTools.ServiceLayer
return Keys.GetString(Keys.OperatorProperties, operatorName);
}
+ public static string JobAlreadyExists(string jobName)
+ {
+ return Keys.GetString(Keys.JobAlreadyExists, jobName);
+ }
+
+ public static string JobStepNameAlreadyExists(string jobName)
+ {
+ return Keys.GetString(Keys.JobStepNameAlreadyExists, jobName);
+ }
+
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Keys
{
@@ -6342,6 +6360,15 @@ namespace Microsoft.SqlTools.ServiceLayer
public const string CategoryDataCollector = "CategoryDataCollector";
+ public const string JobAlreadyExists = "JobAlreadyExists";
+
+
+ public const string JobStepNameCannotBeBlank = "JobStepNameCannotBeBlank";
+
+
+ public const string JobStepNameAlreadyExists = "JobStepNameAlreadyExists";
+
+
private Keys()
{ }
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx
index 91765a2e..402d1d77 100755
--- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx
+++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.resx
@@ -2508,4 +2508,18 @@
Data Collector
+
+ A job named '{0}' already exists. Enter a unique name for the job.
+ .
+ Parameters: 0 - jobName (string)
+
+
+ The name of the job step cannot be blank.
+
+
+
+ There is already a step named '{0}' for this job. You must specify a different name.
+ .
+ Parameters: 0 - jobName (string)
+
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings
index b23a2037..9e0b4c20 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings
+++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.strings
@@ -1067,4 +1067,6 @@ CategoryLogShipping = Log Shipping
CategoryDBEngineTuningAdvisor = Database Engine Tuning Advisor
CategoryDataCollector = Data Collector
-
+JobAlreadyExists(string jobName) = A job named '{0}' already exists. Enter a unique name for the job.
+JobStepNameCannotBeBlank = The name of the job step cannot be blank.
+JobStepNameAlreadyExists(string jobName) = There is already a step named '{0}' for this job. You must specify a different name.
\ No newline at end of file
diff --git a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf
index fd6c8efe..58c5ff15 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf
+++ b/src/Microsoft.SqlTools.ServiceLayer/Localization/sr.xlf
@@ -2978,6 +2978,23 @@
Data Collector
+
+ A job named '{0}' already exists. Enter a unique name for the job.
+ A job named '{0}' already exists. Enter a unique name for the job.
+ .
+ Parameters: 0 - jobName (string)
+
+
+ The name of the job step cannot be blank.
+ The name of the job step cannot be blank.
+
+
+
+ There is already a step named '{0}' for this job. You must specify a different name.
+ There is already a step named '{0}' for this job. You must specify a different name.
+ .
+ Parameters: 0 - jobName (string)
+