-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added endpoint for fetching all notebook jobs #834
Changes from all commits
0548b14
e93875b
f712b14
16ff3e6
598b91e
e05e3a3
b81d721
32be5ac
b0a9fbf
05503eb
d06d027
ff74e7b
7602f7e
0fa8005
98ef5c8
e025516
42651dd
d56a0ea
fc71b39
2e2da19
cf95619
256e483
19442dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,4 +58,14 @@ public class AgentJobStep | |
public CompletionResult runStatus; | ||
public AgentJobStepInfo stepDetails; | ||
} | ||
|
||
/// <summary> | ||
/// a class for storing various properties of a agent notebook history | ||
/// </summary> | ||
public class AgentNotebookHistoryInfo : AgentJobHistoryInfo | ||
{ | ||
public int MaterializedNotebookId { get; set; } | ||
public int MaterializedNotebookErrorFlag { get; set; } | ||
public string MaterializedNotebookErrorInfo { get; set; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. check other classes for naming conventions, but I think this would be something like |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,4 +61,16 @@ public class AgentJobInfo | |
public AgentScheduleInfo[] JobSchedules { get; set; } | ||
public AgentAlertInfo[] Alerts { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// a class for storing variour properties of notebook Jobs | ||
/// </summary> | ||
public class AgentNotebookInfo : AgentJobInfo | ||
{ | ||
public string TemplateId { get; set; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. consider adding comments of these properties describing they are..specifically the distinction between Target and Execution databases, etc. |
||
public string TargetDatabase { get; set; } | ||
public string LastRunNotebookError { get; set; } | ||
public string ExecuteDatabase { get; set; } | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,215 @@ | ||
// | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
// | ||
|
||
using Microsoft.SqlTools.Hosting.Protocol.Contracts; | ||
using Microsoft.SqlTools.ServiceLayer.TaskServices; | ||
using Microsoft.SqlTools.ServiceLayer.Utility; | ||
using Microsoft.SqlTools.Utility; | ||
|
||
namespace Microsoft.SqlTools.ServiceLayer.Agent.Contracts | ||
{ | ||
/// <summary> | ||
aasimkhan30 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// SQL Agent Notebooks activity parameters | ||
/// </summary> | ||
public class AgentNotebooksParams : GeneralRequestDetails | ||
{ | ||
public string OwnerUri { get; set; } | ||
|
||
} | ||
|
||
/// <summary> | ||
/// SQL Agent Notebook activity result | ||
/// </summary> | ||
public class AgentNotebooksResult : ResultStatus | ||
{ | ||
public AgentNotebookInfo[] Notebooks { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// SQL Agent Notebook request type | ||
/// </summary> | ||
public class AgentNotebooksRequest | ||
{ | ||
/// <summary> | ||
/// Request definition | ||
/// </summary> | ||
public static readonly | ||
RequestType<AgentNotebooksParams, AgentNotebooksResult> Type = | ||
RequestType<AgentNotebooksParams, AgentNotebooksResult>.Create("agent/notebooks"); | ||
} | ||
|
||
/// <summary> | ||
/// SQL Agent Notebook history parameters | ||
/// </summary> | ||
public class AgentNotebookHistoryParams : GeneralRequestDetails | ||
{ | ||
public string OwnerUri { get; set; } | ||
public string JobId { get; set; } | ||
public string TargetDatabase { get; set; } | ||
public string JobName { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// SQL Agent Notebook history results | ||
/// </summary> | ||
public class AgentNotebookHistoryResult : ResultStatus | ||
{ | ||
public AgentNotebookHistoryInfo[] Histories { get; set; } | ||
public AgentJobStepInfo[] Steps { get; set; } | ||
|
||
public AgentScheduleInfo[] Schedules { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// SQL Agent Notebook history request type | ||
/// <summary> | ||
public class AgentNotebookHistoryRequest | ||
{ | ||
/// <summary> | ||
/// Request definition | ||
/// </summary> | ||
public static readonly | ||
RequestType<AgentNotebookHistoryParams, AgentNotebookHistoryResult> Type = | ||
RequestType<AgentNotebookHistoryParams, AgentNotebookHistoryResult>.Create("agent/notebookhistory"); | ||
} | ||
|
||
/// <summary> | ||
/// SQL Agent create Notebook params | ||
/// </summary> | ||
public class CreateAgentNotebookParams : TaskRequestDetails | ||
{ | ||
public string OwnerUri { get; set; } | ||
public AgentNotebookInfo Notebook { get; set; } | ||
public string TemplateFilePath { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// SQL Agent create Notebook result | ||
/// </summary> | ||
public class CreateAgentNotebookResult : ResultStatus | ||
{ | ||
public AgentNotebookInfo Job { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// SQL Agent create Notebook request type | ||
/// </summary> | ||
public class CreateAgentNotebookRequest | ||
aasimkhan30 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
public static readonly | ||
RequestType<CreateAgentNotebookParams, CreateAgentNotebookResult> Type = | ||
RequestType<CreateAgentNotebookParams, CreateAgentNotebookResult>.Create("agent/createnotebook"); | ||
} | ||
|
||
/// <summary> | ||
/// SQL Agent update Notebook params | ||
/// </summary> | ||
public class UpdateAgentNotebookParams : TaskRequestDetails | ||
{ | ||
public string OwnerUri { get; set; } | ||
public string OriginalNotebookName { get; set; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe just |
||
public AgentNotebookInfo Notebook { get; set; } | ||
public string TemplateFilePath { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// SQL Agent update Notebook result | ||
/// </summary> | ||
public class UpdateAgentNotebookResult : ResultStatus | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// SQL Agent update Notebook request type | ||
/// </summary> | ||
public class UpdateAgentNotebookRequest | ||
{ | ||
/// <summary> | ||
/// Request definition | ||
/// </summary> | ||
public static readonly | ||
RequestType<UpdateAgentNotebookParams, UpdateAgentNotebookResult> Type = | ||
RequestType<UpdateAgentNotebookParams, UpdateAgentNotebookResult>.Create("agent/updatenotebook"); | ||
} | ||
|
||
/// <summary> | ||
/// SQL Agent delete Notebook params | ||
/// </summary> | ||
public class DeleteAgentNotebookParams : TaskRequestDetails | ||
{ | ||
public string OwnerUri { get; set; } | ||
public AgentNotebookInfo Notebook { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// SQL Agent delete Notebook request type | ||
/// </summary> | ||
public class DeleteAgentNotebookRequest | ||
{ | ||
/// <summary> | ||
/// Request definition | ||
/// </summary> | ||
public static readonly | ||
RequestType<DeleteAgentNotebookParams, ResultStatus> Type = | ||
RequestType<DeleteAgentNotebookParams, ResultStatus>.Create("agent/deletenotebook"); | ||
} | ||
|
||
/// <summary> | ||
/// SQL Agent Notebook materialized params | ||
/// </summary> | ||
public class AgentNotebookMaterializedParams : TaskRequestDetails | ||
{ | ||
public string OwnerUri { get; set; } | ||
public string TargetDatabase { get; set; } | ||
public int NotebookMaterializedId { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// SQL Agent Notebook materialized result | ||
/// </summary> | ||
public class AgentNotebookMaterializedResult : ResultStatus | ||
{ | ||
public string NotebookMaterialized { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// SQL Agent Notebook materialized request type | ||
/// </summary> | ||
public class AgentNotebookMaterializedRequest | ||
{ | ||
public static readonly | ||
RequestType<AgentNotebookMaterializedParams, AgentNotebookMaterializedResult> Type = | ||
RequestType<AgentNotebookMaterializedParams, AgentNotebookMaterializedResult>.Create("agent/notebookmaterialized"); | ||
} | ||
|
||
/// <summary> | ||
/// SQL Agent Notebook templates params | ||
/// </summary> | ||
public class AgentNotebookTemplateParams : TaskRequestDetails | ||
{ | ||
public string OwnerUri { get; set; } | ||
public string JobId { get; set; } | ||
public string TargetDatabase { get; set; } | ||
|
||
} | ||
|
||
/// <summary> | ||
/// SQL Agent Notebook templates results | ||
/// </summary> | ||
public class AgentNotebookTemplateResult : ResultStatus | ||
{ | ||
public string NotebookTemplate { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// SQL Agent Notebook templates request type | ||
/// </summary> | ||
public class AgentNotebookTemplateRequest | ||
{ | ||
public static readonly | ||
RequestType<AgentNotebookTemplateParams, AgentNotebookTemplateResult> Type = | ||
RequestType<AgentNotebookTemplateParams, AgentNotebookTemplateResult>.Create("agent/notebooktemplate"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove or rename to
...ErrorCode