From 771e969727cc11196b263f010ae0a085ea3106ff Mon Sep 17 00:00:00 2001 From: Andrew Best Date: Mon, 22 Jun 2020 16:38:24 +0930 Subject: [PATCH] Revert "Adds new endpoints for creating Runbook Runs" This reverts commit a6878a689075d48445ae3e793d74fd81e3a2a0d7. --- .../Model/RunbookRunParameters.cs | 63 ------------------- .../Repositories/Async/RunbookRepository.cs | 5 -- .../Repositories/RunbookRepository.cs | 10 +-- 3 files changed, 2 insertions(+), 76 deletions(-) delete mode 100644 source/Octopus.Client/Model/RunbookRunParameters.cs diff --git a/source/Octopus.Client/Model/RunbookRunParameters.cs b/source/Octopus.Client/Model/RunbookRunParameters.cs deleted file mode 100644 index a27648de8..000000000 --- a/source/Octopus.Client/Model/RunbookRunParameters.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Octopus.Client.Model -{ - public class RunbookRunParameters - { - /// - /// Parameter class for marshalling params between OctopusCLI and Octopus Server - /// This class is used to facilitate backwards compatibility while extending /runbooks/{id}/run" - /// - public RunbookRunParameters() - { - FormValues = new Dictionary(); - SpecificMachineIds = new string[0]; - ExcludedMachineIds = new string[0]; - EnvironmentIds = new string[0]; - TenantTagNames = new string[0]; - TenantIds = new string[0]; - SkipActions = new string[0]; - } - - public bool UseDefaultSnapshot { get; set; } = true; - - public string RunbookId { get; set; } - public string ProjectId { get; set; } - public string RunbookSnapshotNameOrId { get; set; } - public string EnvironmentId { get; set; } - public string[] EnvironmentIds { get; set; } - public bool ForcePackageDownload { get; set; } - public bool? UseGuidedFailure { get; set; } - public string[] SpecificMachineIds { get; set; } - public string[] ExcludedMachineIds { get; set; } - public string TenantId { get; set; } - public string[] TenantIds { get; set; } - public string[] TenantTagNames { get; set; } - public string[] SkipActions { get; set; } - public DateTimeOffset? QueueTime { get; set; } - public DateTimeOffset? QueueTimeExpiry { get; set; } - public Dictionary FormValues { get; set; } - - public static RunbookRunParameters MapFrom(RunbookRunResource runbookRun) - { - return new RunbookRunParameters - { - UseDefaultSnapshot = true, - RunbookId = runbookRun.RunbookId, - ProjectId = runbookRun.ProjectId, - EnvironmentId = runbookRun.EnvironmentId, - ForcePackageDownload = runbookRun.ForcePackageDownload, - UseGuidedFailure = runbookRun.UseGuidedFailure, - SpecificMachineIds = runbookRun.SpecificMachineIds.ToArray(), - ExcludedMachineIds = runbookRun.ExcludedMachineIds.ToArray(), - TenantId = runbookRun.TenantId, - SkipActions = runbookRun.SkipActions.ToArray(), - QueueTime = runbookRun.QueueTime, - QueueTimeExpiry = runbookRun.QueueTimeExpiry, - FormValues = runbookRun.FormValues - }; - } - } -} \ No newline at end of file diff --git a/source/Octopus.Client/Repositories/Async/RunbookRepository.cs b/source/Octopus.Client/Repositories/Async/RunbookRepository.cs index 82cdb26ca..d7018f340 100644 --- a/source/Octopus.Client/Repositories/Async/RunbookRepository.cs +++ b/source/Octopus.Client/Repositories/Async/RunbookRepository.cs @@ -47,11 +47,6 @@ public Task GetPreview(DeploymentPromotionTarget prom } public Task Run(RunbookResource runbook, RunbookRunResource runbookRun) - { - return Run(runbook, RunbookRunParameters.MapFrom(runbookRun)); - } - - public Task Run(RunbookResource runbook, RunbookRunParameters runbookRun) { return Client.Post(runbook.Link("CreateRunbookRun"), runbookRun); } diff --git a/source/Octopus.Client/Repositories/RunbookRepository.cs b/source/Octopus.Client/Repositories/RunbookRepository.cs index eed22275c..dc6f3fdf3 100644 --- a/source/Octopus.Client/Repositories/RunbookRepository.cs +++ b/source/Octopus.Client/Repositories/RunbookRepository.cs @@ -1,4 +1,3 @@ -using System.Linq; using Octopus.Client.Editors; using Octopus.Client.Model; @@ -13,7 +12,7 @@ public interface IRunbookRepository : IFindByName, IGet, IRunbookRepository { public RunbookRepository(IOctopusRepository repository) @@ -45,15 +44,10 @@ public RunbookRunPreviewResource GetPreview(DeploymentPromotionTarget promotionT { return Client.Get(promotionTarget.Link("RunbookRunPreview")); } -public RunbookRunResource Run(RunbookResource runbook, RunbookRunResource runbookRun) - { - return Run(runbook, RunbookRunParameters.MapFrom(runbookRun)); - } - public RunbookRunResource Run(RunbookResource runbook, RunbookRunParameters runbookRun) + public RunbookRunResource Run(RunbookResource runbook, RunbookRunResource runbookRun) { return Client.Post(runbook.Link("CreateRunbookRun"), runbookRun); } - } } \ No newline at end of file