-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds new endpoints for creating Runbook Runs * Adds version awareness to runbook run methods * Adjust version tolerance to ensure integration tests are happy and to support pre-release canary customers Co-authored-by: Andrew Best <[email protected]>
- Loading branch information
1 parent
771e969
commit 92ba6a1
Showing
5 changed files
with
180 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Octopus.Client.Model | ||
{ | ||
public class RunbookRunParameters | ||
{ | ||
/// <summary> | ||
/// Parameter class for marshalling params between OctopusCLI and Octopus Server | ||
/// This class is used to facilitate backwards compatibility while extending /runbooks/{id}/run" | ||
/// </summary> | ||
public RunbookRunParameters() | ||
{ | ||
FormValues = new Dictionary<string, string>(); | ||
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<string, string> 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 != null ? runbookRun.SpecificMachineIds.ToArray() : new string[0], | ||
ExcludedMachineIds = runbookRun.ExcludedMachineIds != null ? runbookRun.ExcludedMachineIds.ToArray() : new string[0], | ||
TenantId = runbookRun.TenantId, | ||
SkipActions = runbookRun.SkipActions != null ? runbookRun.SkipActions.ToArray() : new string[0], | ||
QueueTime = runbookRun.QueueTime, | ||
QueueTimeExpiry = runbookRun.QueueTimeExpiry, | ||
FormValues = runbookRun.FormValues ?? new Dictionary<string, string>() | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters