Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 6 additions & 60 deletions src/Monitor/Autoscale.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,59 +39,13 @@ title: Autoscale
module-version: 0.1.0
subject-prefix: Autoscale
namespace: Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale
nested-object-to-string: true

# If there are post APIs for some kinds of actions in the RP, you may need to
# uncomment following line to support viaIdentity for these post APIs
# identity-correction-for-post: true

# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
use-extension:
"@autorest/powershell": "3.x"

directive:
- where:
Verb: Get
subject: PredictiveMetric
set:
breaking-change:
deprecated-output-properties:
- Data
new-output-properties:
- Data
change-description: The type of the property 'Data' of type 'IPredictiveResponse' will be changed from single object to 'List'.
deprecated-by-version: 7.0.0
deprecated-by-azversion: 15.0.0
change-effective-date: 2025/11/03
- where:
verb: Get|Update|New
subject: AutoscaleSetting
set:
breaking-change:
deprecated-output-properties:
- Notification
- Profile
new-output-properties:
- Notification
- Profile
change-description: The types of the properties 'Notification' and 'Profile' of type 'IAutoscaleSettingResource' will be changed from single object to 'List'.
deprecated-by-version: 7.0.0
deprecated-by-azversion: 15.0.0
change-effective-date: 2025/11/03
- where:
parameter-name: Profile|Rule|ScheduleHour|ScheduleMinute|ScheduleDay|Webhook|EmailCustomEmail
set:
breaking-change:
old-parameter-type: Array
new-parameter-type: List
deprecated-by-version: 7.0.0
deprecated-by-azversion: 15.0.0
change-effective-date: 2025/11/03
# Following is two common directive which are normally required in all the RPs
# 1. Remove the unexpanded parameter set
# 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
- where:
variant: ^Create$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))|^CreateViaIdentityExpanded$
remove: true
- where:
verb: Set
Expand All @@ -104,14 +58,6 @@ directive:
verb: Update
subject: AutoscaleSetting
hide: true
# Rename 'Equals'
- from: source-file-csharp
where: $
transform: $ = $.replace('public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType Equals = @"Equals";', 'public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType Equal = @"Equals";');

- from: source-file-csharp
where: $
transform: $ = $.replace('public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType Equals = @"Equals";', 'public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType Equal = @"Equals";');

- from: swagger-document
where: $.definitions.TimeWindow
Expand All @@ -138,9 +84,9 @@ directive:
}
# Add breaking change for them, will add back.
- model-cmdlet:
# - AutoscaleProfile
# - ScaleRule
# - AutoscaleNotification
- WebhookNotification
# - ScaleRuleMetricDimension
- model-name: AutoscaleProfile
- model-name: ScaleRule
- model-name: AutoscaleNotification
- model-name: WebhookNotification
- model-name: ScaleRuleMetricDimension
```
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ Create an in-memory object for AutoscaleNotification.
Create an in-memory object for AutoscaleNotification.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleNotification
Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleNotification
.Link
https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzAutoscaleNotificationObject
https://learn.microsoft.com/powershell/module/Az.Monitor/new-azautoscalenotificationobject
#>
function New-AzAutoscaleNotificationObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleNotification')]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleNotification')]
[CmdletBinding(PositionalBinding=$false)]
Param(
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ParameterBreakingChange("EmailCustomEmail", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")]
Expand All @@ -41,12 +42,12 @@ function New-AzAutoscaleNotificationObject {
$EmailSendToSubscriptionCoAdministrator,
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ParameterBreakingChange("Webhook", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")]
[Parameter(HelpMessage="the collection of webhook notifications.")]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IWebhookNotification[]]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IWebhookNotification[]]
$Webhook
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleNotification]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleNotification]::New()

if ($PSBoundParameters.ContainsKey('EmailCustomEmail')) {
$Object.EmailCustomEmail = $EmailCustomEmail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ Create an in-memory object for AutoscaleProfile.
Create an in-memory object for AutoscaleProfile.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleProfile
Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfile
.Link
https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzAutoscaleProfileObject
https://learn.microsoft.com/powershell/module/Az.Monitor/new-azautoscaleprofileobject
#>
function New-AzAutoscaleProfileObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleProfile')]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfile')]
[CmdletBinding(PositionalBinding=$false)]
Param(

Expand All @@ -52,12 +53,12 @@ function New-AzAutoscaleProfileObject {
[string]
$Name,
[Parameter(HelpMessage="the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week will have the same set of profiles. For example, to set a daily schedule, set **schedule** to every day of the week. The frequency property specifies that the schedule is repeated weekly.")]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency])]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.RecurrenceFrequency]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("None", "Second", "Minute", "Hour", "Day", "Week", "Month", "Year")]
[string]
$RecurrenceFrequency,
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ParameterBreakingChange("Rule", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")]
[Parameter(Mandatory, HelpMessage="the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified.")]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRule[]]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRule[]]
$Rule,
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ParameterBreakingChange("ScheduleDay", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")]
[Parameter(HelpMessage="the collection of days that the profile takes effect on. Possible values are Sunday through Saturday.")]
Expand All @@ -77,7 +78,7 @@ function New-AzAutoscaleProfileObject {
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.AutoscaleProfile]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.AutoscaleProfile]::New()

if ($PSBoundParameters.ContainsKey('CapacityDefault')) {
$Object.CapacityDefault = $CapacityDefault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,22 @@ Create an in-memory object for ScaleRuleMetricDimension.
Create an in-memory object for ScaleRuleMetricDimension.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRuleMetricDimension
Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleMetricDimension
.Link
https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzAutoscaleScaleRuleMetricDimensionObject
https://learn.microsoft.com/powershell/module/Az.Monitor/new-azautoscalescalerulemetricdimensionobject
#>
function New-AzAutoscaleScaleRuleMetricDimensionObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRuleMetricDimension')]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleMetricDimension')]
[CmdletBinding(PositionalBinding=$false)]
Param(

[Parameter(Mandatory, HelpMessage="Name of the dimension.")]
[string]
$DimensionName,
[Parameter(Mandatory, HelpMessage="the dimension operator. Only 'Equals' and 'NotEquals' are supported. 'Equals' being equal to any of the values. 'NotEquals' being not equal to all of the values.")]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType])]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleRuleMetricDimensionOperationType]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Equals", "NotEquals")]
[string]
$Operator,
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ParameterBreakingChange("Value", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")]
[Parameter(Mandatory, HelpMessage="list of dimension values. For example: [`"App1`",`"App2`"].")]
Expand All @@ -44,7 +45,7 @@ function New-AzAutoscaleScaleRuleMetricDimensionObject {
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRuleMetricDimension]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRuleMetricDimension]::New()

if ($PSBoundParameters.ContainsKey('DimensionName')) {
$Object.DimensionName = $DimensionName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,18 @@ Create an in-memory object for ScaleRule.
Create an in-memory object for ScaleRule.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRule
Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRule
.Link
https://learn.microsoft.com/powershell/module/Az.Monitor/new-AzAutoscaleScaleRuleObject
https://learn.microsoft.com/powershell/module/Az.Monitor/new-azautoscalescaleruleobject
#>
function New-AzAutoscaleScaleRuleObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRule')]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRule')]
[CmdletBinding(PositionalBinding=$false)]
Param(
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.ParameterBreakingChange("MetricTriggerDimension", "15.0.0", "7.0.0", "2025/11/03", OldParamaterType="Array", NewParameterType="List")]
[Parameter(HelpMessage="List of dimension conditions. For example: [{`"DimensionName`":`"AppName`",`"Operator`":`"Equals`",`"Values`":[`"App1`"]},{`"DimensionName`":`"Deployment`",`"Operator`":`"Equals`",`"Values`":[`"default`"]}].")]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IScaleRuleMetricDimension[]]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IScaleRuleMetricDimension[]]
$MetricTriggerDimension,
[Parameter(HelpMessage="a value indicating whether metric should divide per instance.")]
[bool]
Expand All @@ -49,19 +50,19 @@ function New-AzAutoscaleScaleRuleObject {
[string]
$MetricTriggerMetricResourceUri,
[Parameter(Mandatory, HelpMessage="the operator that is used to compare the metric data and the threshold.")]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType])]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ComparisonOperationType]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Equals", "NotEquals", "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual")]
[string]
$MetricTriggerOperator,
[Parameter(Mandatory, HelpMessage="the metric statistic type. How the metrics from multiple instances are combined.")]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType])]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.MetricStatisticType]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Average", "Min", "Max", "Sum", "Count")]
[string]
$MetricTriggerStatistic,
[Parameter(Mandatory, HelpMessage="the threshold of the metric that triggers the scale action.")]
[double]
$MetricTriggerThreshold,
[Parameter(Mandatory, HelpMessage="time aggregation type. How the data that is collected should be combined over time. The default value is Average.")]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType])]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.TimeAggregationType]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Average", "Minimum", "Maximum", "Total", "Count", "Last")]
[string]
$MetricTriggerTimeAggregation,
[Parameter(Mandatory, HelpMessage="the granularity of metrics the rule monitors. Must be one of the predefined values returned from metric definitions for the metric. Must be between 12 hours and 1 minute.")]
[System.TimeSpan]
Expand All @@ -73,20 +74,20 @@ function New-AzAutoscaleScaleRuleObject {
[System.TimeSpan]
$ScaleActionCooldown,
[Parameter(Mandatory, HelpMessage="the scale direction. Whether the scaling action increases or decreases the number of instances.")]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection])]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleDirection]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("None", "Increase", "Decrease")]
[string]
$ScaleActionDirection,
[Parameter(Mandatory, HelpMessage="the type of action that should occur when the scale rule fires.")]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType])]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.ScaleType]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("ChangeCount", "PercentChangeCount", "ExactCount", "ServiceAllowedNextValue")]
[string]
$ScaleActionType,
[Parameter(HelpMessage="the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1.")]
[string]
$ScaleActionValue
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.ScaleRule]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.ScaleRule]::New()

if ($PSBoundParameters.ContainsKey('MetricTriggerDimension')) {
$Object.MetricTriggerDimension = $MetricTriggerDimension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ To update other fields use the CreateOrUpdate method.
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource
Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource
.Notes
COMPLEX PARAMETER PROPERTIES

Expand Down Expand Up @@ -87,7 +87,7 @@ PROFILE <IAutoscaleProfile[]>: the collection of automatic scaling profiles that
https://learn.microsoft.com/powershell/module/az.monitor/update-azAutoscaleSetting
#>
function Update-AzAutoscaleSetting {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResource])]
[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
Expand Down Expand Up @@ -129,7 +129,7 @@ function Update-AzAutoscaleSetting {
[Parameter()]
[AllowEmptyCollection()]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[]]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleNotification[]]
# the collection of notifications.
# To construct, see NOTES section for NOTIFICATION properties and create a hash table.
${Notification},
Expand All @@ -142,24 +142,24 @@ function Update-AzAutoscaleSetting {
${PredictiveAutoscalePolicyScaleLookAheadTime},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode])]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.PSArgumentCompleterAttribute("Disabled", "ForecastOnly", "Enabled")]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode]
[System.String]
# the predictive autoscale mode
${PredictiveAutoscalePolicyScaleMode},

[Parameter()]
[AllowEmptyCollection()]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[]]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleProfile[]]
# the collection of automatic scaling profiles that specify different scaling parameters for different time periods.
# A maximum of 20 profiles can be specified.
# To construct, see NOTES section for PROFILE properties and create a hash table.
${Profile},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResourcePatchTags]))]
[Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleSettingResourcePatchTags]))]
[System.Collections.Hashtable]
# Resource tags
${Tag},
Expand Down
Loading