Skip to content

Commit e28b2dc

Browse files
add a default value for [-AutoPauseDelayInMinute] parameter of command [New-AzSynapseSparkpool] and [Update-AzSynapseSparkpool] (#16650)
* add a default value [15] for [-AutoPauseDelayInMinute] parameter of command [New-AzSynapseSparkpool] and [Update-AzSynapseSparkpool] * use a formatted string for help message * Update ChangeLog.md Polish changelog.md Co-authored-by: Jin Lei <54836179+msJinLei@users.noreply.github.com>
1 parent 7c5a93e commit e28b2dc

File tree

7 files changed

+9
-5
lines changed

7 files changed

+9
-5
lines changed

src/Synapse/Synapse/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
-->
2020

2121
## Upcoming Release
22+
* Added a default value for [-AutoPauseDelayInMinute] parameter of command `New-AzSynapseSparkpool` and `Update-AzSynapseSparkpool`
2223

2324
## Version 0.19.0
2425
* Added support for Synapse KQL script

src/Synapse/Synapse/Commands/ManagementCommands/SparkPool/NewAzureSynapseSparkPool.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
2222
using Microsoft.Azure.Management.Synapse.Models;
2323
using Microsoft.WindowsAzure.Commands.Utilities.Common;
24+
using System;
2425
using System.Collections;
2526
using System.IO;
2627
using System.Management.Automation;
@@ -107,7 +108,7 @@ public class NewAzureSynapseSparkPool : SynapseManagementCmdletBase
107108
HelpMessage = HelpMessages.AutoPauseDelayInMinute)]
108109
[ValidateNotNullOrEmpty]
109110
[ValidateRange(5, 10080)]
110-
public int AutoPauseDelayInMinute { get; set; }
111+
public int AutoPauseDelayInMinute { get; set; } = int.Parse(SynapseConstants.DefaultAutoPauseDelayInMinute);
111112

112113
[Parameter(ValueFromPipelineByPropertyName = false, Mandatory = true,
113114
HelpMessage = HelpMessages.SparkVersion)]

src/Synapse/Synapse/Commands/ManagementCommands/SparkPool/UpdateAzureSynapseSparkPool.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ public override void ExecuteCmdlet()
213213
Enabled = this.EnableAutoPause != null ? this.EnableAutoPause : existingSparkPool.AutoPause?.Enabled ?? false,
214214
DelayInMinutes = this.IsParameterBound(c => c.AutoPauseDelayInMinute)
215215
? this.AutoPauseDelayInMinute
216-
: existingSparkPool.AutoPause?.DelayInMinutes ?? 0
216+
: existingSparkPool.AutoPause?.DelayInMinutes ?? int.Parse(SynapseConstants.DefaultAutoPauseDelayInMinute)
217217
};
218218
}
219219

src/Synapse/Synapse/Common/HelpMessages.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public static class HelpMessages
8888

8989
public const string DisableAutoPause = "Indicates whether Auto-pause should be disabled.";
9090

91-
public const string AutoPauseDelayInMinute = "Number of minutes idle. This parameter must be specified when Auto-pause is enabled.";
91+
public const string AutoPauseDelayInMinute = "Number of minutes idle. This parameter can be specified when Auto-pause is enabled. If it is not specified manually, the default value will be " + SynapseConstants.DefaultAutoPauseDelayInMinute + ".";
9292

9393
public const string SparkVersion = "Apache Spark version. Allowed values: 2.4";
9494

src/Synapse/Synapse/Models/SynapseConstants.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ public static class SynapseConstants
203203

204204
public const string KqlScript = nameof(KqlScript);
205205

206+
public const string DefaultAutoPauseDelayInMinute = "15";
207+
206208
public static Dictionary<string, ComputeNodeSize> ComputeNodeSizes = new Dictionary<string, ComputeNodeSize>
207209
{
208210
{

src/Synapse/Synapse/help/New-AzSynapseSparkPool.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Accept wildcard characters: False
104104
```
105105
106106
### -AutoPauseDelayInMinute
107-
Number of minutes idle. This parameter must be specified when Auto-pause is enabled.
107+
Number of minutes idle. This parameter can be specified when Auto-pause is enabled. The default value will be [15] if it is not specified manually.
108108
109109
```yaml
110110
Type: System.Int32

src/Synapse/Synapse/help/Update-AzSynapseSparkPool.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ Accept wildcard characters: False
166166
```
167167
168168
### -AutoPauseDelayInMinute
169-
Number of minutes idle. This parameter must be specified when Auto-pause is enabled.
169+
Number of minutes idle. This parameter can be specified when Auto-pause is enabled. The default value will be [15] if it is not specified manually.
170170
171171
```yaml
172172
Type: System.Int32

0 commit comments

Comments
 (0)