mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-17 02:51:45 -05:00
Add Description property to Agent Job request (#655)
* Add Description property to Agent Job request * Fix whitespace
This commit is contained in:
@@ -151,7 +151,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
|
|||||||
var agentJobs = new List<AgentJobInfo>();
|
var agentJobs = new List<AgentJobInfo>();
|
||||||
if (this.jobs != null)
|
if (this.jobs != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach (var job in this.jobs.Values)
|
foreach (var job in this.jobs.Values)
|
||||||
{
|
{
|
||||||
agentJobs.Add(AgentUtilities.ConvertToAgentJobInfo(job));
|
agentJobs.Add(AgentUtilities.ConvertToAgentJobInfo(job));
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
|
|||||||
return new AgentJobInfo
|
return new AgentJobInfo
|
||||||
{
|
{
|
||||||
Name = job.Name,
|
Name = job.Name,
|
||||||
|
Description = job.Description,
|
||||||
CurrentExecutionStatus = job.CurrentExecutionStatus,
|
CurrentExecutionStatus = job.CurrentExecutionStatus,
|
||||||
LastRunOutcome = job.LastRunOutcome,
|
LastRunOutcome = job.LastRunOutcome,
|
||||||
CurrentExecutionStep = job.CurrentExecutionStep,
|
CurrentExecutionStep = job.CurrentExecutionStep,
|
||||||
|
|||||||
@@ -369,8 +369,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
|
|||||||
request.Urn = urn;
|
request.Urn = urn;
|
||||||
request.Fields = new string[]
|
request.Fields = new string[]
|
||||||
{
|
{
|
||||||
"Name",
|
"Name",
|
||||||
"IsEnabled",
|
"IsEnabled",
|
||||||
"Category",
|
"Category",
|
||||||
"CategoryID",
|
"CategoryID",
|
||||||
"CategoryType",
|
"CategoryType",
|
||||||
@@ -382,7 +382,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
|
|||||||
"LastRunDate",
|
"LastRunDate",
|
||||||
"NextRunDate",
|
"NextRunDate",
|
||||||
"LastRunOutcome",
|
"LastRunOutcome",
|
||||||
"JobID"
|
"JobID",
|
||||||
|
"Description"
|
||||||
};
|
};
|
||||||
|
|
||||||
DataTable dt = enumerator.Process(connection, request);
|
DataTable dt = enumerator.Process(connection, request);
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
|
|||||||
private DateTime lastRun;
|
private DateTime lastRun;
|
||||||
private DateTime nextRun;
|
private DateTime nextRun;
|
||||||
private Guid jobId;
|
private Guid jobId;
|
||||||
|
private string description;
|
||||||
|
|
||||||
private JobProperties()
|
private JobProperties()
|
||||||
{
|
{
|
||||||
@@ -62,7 +63,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
|
|||||||
this.hasStep = Convert.ToBoolean(row["HasStep"], CultureInfo.InvariantCulture);
|
this.hasStep = Convert.ToBoolean(row["HasStep"], CultureInfo.InvariantCulture);
|
||||||
this.hasTarget = Convert.ToBoolean(row["HasServer"], CultureInfo.InvariantCulture);
|
this.hasTarget = Convert.ToBoolean(row["HasServer"], CultureInfo.InvariantCulture);
|
||||||
this.lastRunOutcome = Convert.ToInt32(row["LastRunOutcome"], CultureInfo.InvariantCulture);
|
this.lastRunOutcome = Convert.ToInt32(row["LastRunOutcome"], CultureInfo.InvariantCulture);
|
||||||
this.jobId = Guid.Parse(row["JobID"].ToString()); ;
|
this.jobId = Guid.Parse(row["JobID"].ToString());
|
||||||
|
this.description = row["Description"].ToString();
|
||||||
|
|
||||||
// for a job to be runnable, it must:
|
// for a job to be runnable, it must:
|
||||||
// 1. have a target server
|
// 1. have a target server
|
||||||
@@ -156,6 +158,14 @@ namespace Microsoft.SqlTools.ServiceLayer.Agent
|
|||||||
{
|
{
|
||||||
return this.jobId;
|
return this.jobId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string Description
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.description;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user