Skip to content

Commit

Permalink
Added Connectwise Manage Integration support
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnmbond committed Nov 12, 2024
1 parent 0721f9a commit 984e707
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 7 deletions.
2 changes: 1 addition & 1 deletion LogicMonitor.Api.Test/Settings/IntegrationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public async Task GetIntegrations()
public async Task GetIntegrationAuditLogs()
{
var auditLogs = await LogicMonitorClient
.GetIntegrationAuditLogsAsync()
.GetIntegrationAuditLogsAsync(default)
.ConfigureAwait(true);

auditLogs.Items.Should().NotBeEmpty();
Expand Down
1 change: 1 addition & 0 deletions LogicMonitor.Api.dic
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Cim
Cognito
color
configsources
Connectwise
Datacenter
datafetch
datapoint
Expand Down
1 change: 1 addition & 0 deletions LogicMonitor.Api/Converters/IntegrationsConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ protected override Integration Create(Type objectType, JObject jObject)
"servicenow" => new ServiceNowIntegration(),
"email" => new EmailIntegration(),
"autotask" => new AutoTaskIntegration(),
"connectwise-2" => new ConnectwiseManageIntegration(),
"pagerduty" => new PagerDutyIntegration(),
"jsm" => new JiraServiceManagementIntegration(),
_ => throw new NotSupportedException($"{integration} deserialization not supported. IntegrationsConverter.cs needs updating."),
Expand Down
6 changes: 0 additions & 6 deletions LogicMonitor.Api/LogicMonitorClient_Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ public Task<EscalationChain> GetEscalationChainAsync(
public Task SaveAlertRuleAsync(AlertRule alertRule, CancellationToken cancellationToken)
=> PutAsync($"setting/alert/rules/{alertRule.Id}?data=%5Bobject+Object%5D", alertRule, cancellationToken);

/// <summary>
/// get integration audit logs list
/// </summary>
public Task<Page<IntegrationAuditLog>> GetIntegrationAuditLogsAsync()
=> GetIntegrationAuditLogsAsync(CancellationToken.None);

/// <summary>
/// get integration audit logs list
/// </summary>
Expand Down
6 changes: 6 additions & 0 deletions LogicMonitor.Api/Settings/AutoTaskIntegration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ namespace LogicMonitor.Api.Settings;
[DataContract]
public class AutoTaskIntegration : HttpIntegration
{
/// <summary>
/// The zone
/// </summary>
[DataMember(Name = "isRest")]
public bool IsRest { get; set; }

/// <summary>
/// The zone
/// </summary>
Expand Down
105 changes: 105 additions & 0 deletions LogicMonitor.Api/Settings/ConnectwiseManageIntegration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
namespace LogicMonitor.Api.Settings;

/// <summary>
/// A Connectwise Manage integration
/// </summary>
[DataContract]
public class ConnectwiseManageIntegration : HttpIntegration
{
/// <summary>
/// The Server
/// </summary>
[DataMember(Name = "connectwiseServer")]
public string ConnectwiseServer { get; set; } = string.Empty;

/// <summary>
/// The Company
/// </summary>
[DataMember(Name = "connectwiseCompany")]
public string ConnectwiseCompany { get; set; } = string.Empty;

/// <summary>
/// The Public Key
/// </summary>
[DataMember(Name = "publicKey")]
public string PublicKey { get; set; } = string.Empty;

/// <summary>
/// The Private Key
/// </summary>
[DataMember(Name = "privateKey")]
public string PrivateKey { get; set; } = string.Empty;

/// <summary>
/// How the connection is authenticated
/// </summary>
[DataMember(Name = "connectWiseAuthenticated")]
public bool ConnectWiseAuthenticated { get; set; }

/// <summary>
/// The Service Board Id
/// </summary>
[DataMember(Name = "serviceBoardId")]
public int ServiceBoardId { get; set; }

/// <summary>
/// The Service Team Id
/// </summary>
[DataMember(Name = "serviceTeamId")]
public int ServiceTeamId { get; set; }

/// <summary>
/// The default company ID to use if none is specified in the alert
/// </summary>
[DataMember(Name = "connectWiseCompanyId")]
public int DefaultCompanyId { get; set; }

/// <summary>
/// The ticket type ID
/// </summary>
[DataMember(Name = "ticketTypeId")]
public int TicketTypeId { get; set; }

/// <summary>
/// The warn priority ID
/// </summary>
[DataMember(Name = "warnPriorityId")]
public int WarnPriorityId { get; set; }

/// <summary>
/// The error priority ID
/// </summary>
[DataMember(Name = "errorPriorityId")]
public int ErrorPriorityId { get; set; }

/// <summary>
/// The critical priority ID
/// </summary>
[DataMember(Name = "criticalPriorityId")]
public int CriticalPriorityId { get; set; }

/// <summary>
/// The status to use for new tickets
/// </summary>
[DataMember(Name = "statusNewTicket")]
public int StatusNewTicket { get; set; }

/// <summary>
/// The status to use for updated tickets
/// </summary>
[DataMember(Name = "statusUpdateTicket")]
public int StatusUpdateTicket { get; set; }

/// <summary>
/// The status to use for clear tickets
/// </summary>
[DataMember(Name = "statusClearTicket")]
public int StatusClearTicket { get; set; }

/// <summary>
/// The status to use for acknowledged tickets
/// </summary>
[DataMember(Name = "statusAckTicket")]
public int StatusAckTicket { get; set; }
}

0 comments on commit 984e707

Please sign in to comment.