diff --git a/src/Monitor/Autoscale.Autorest/README.md b/src/Monitor/Autoscale.Autorest/README.md index b14c58819b3e..66456be4297c 100644 --- a/src/Monitor/Autoscale.Autorest/README.md +++ b/src/Monitor/Autoscale.Autorest/README.md @@ -74,6 +74,30 @@ directive: 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 + transform: >- + return { + "type": "object", + "properties": { + "timeZone": { + "type": "string", + "description": "the timezone of the start and end times for the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time" + }, + "start": { + "type": "string", + "format": "date-time", + "description": "the start time for the profile in ISO 8601 format." + }, + "end": { + "type": "string", + "format": "date-time", + "description": "the end time for the profile in ISO 8601 format." + } + }, + "description": "A specific date-time for the profile." + } + - model-cmdlet: - AutoscaleProfile - ScaleRule diff --git a/src/Monitor/Autoscale.Autorest/docs/New-AzAutoscaleSetting.md b/src/Monitor/Autoscale.Autorest/docs/New-AzAutoscaleSetting.md index d99aa5e8cb8f..040374ce436b 100644 --- a/src/Monitor/Autoscale.Autorest/docs/New-AzAutoscaleSetting.md +++ b/src/Monitor/Autoscale.Autorest/docs/New-AzAutoscaleSetting.md @@ -12,6 +12,13 @@ Creates or updates an autoscale setting. ## SYNTAX +### CreateViaIdentity (Default) +``` +New-AzAutoscaleSetting -InputObject -Parameter + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### CreateExpanded ``` New-AzAutoscaleSetting -Name -ResourceGroupName -Location -Profile [-SubscriptionId ] [-Enabled] @@ -62,7 +69,7 @@ The default value is 'false'. ```yaml Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -72,12 +79,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity +Parameter Sets: CreateViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -Location Resource location ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: True @@ -92,7 +115,7 @@ The autoscale setting name. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: AutoscaleSettingName Required: True @@ -108,7 +131,7 @@ To construct, see NOTES section for NOTIFICATION properties and create a hash ta ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleNotification[] -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -118,13 +141,29 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Parameter +The autoscale setting resource. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource +Parameter Sets: CreateViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PredictiveAutoscalePolicyScaleLookAheadTime the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in ISO 8601 format. ```yaml Type: System.TimeSpan -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -139,7 +178,7 @@ the predictive autoscale mode ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Support.PredictiveAutoscalePolicyScaleMode -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -156,7 +195,7 @@ To construct, see NOTES section for PROFILE properties and create a hash table. ```yaml Type: Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleProfile[] -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: True @@ -171,7 +210,7 @@ the name of the autoscale setting. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -187,7 +226,7 @@ The name is case insensitive. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: True @@ -202,7 +241,7 @@ The ID of the target subscription. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -220,7 +259,7 @@ Each tag must have a key no greater in length than 128 characters and a value no ```yaml Type: System.Collections.Hashtable -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -235,7 +274,7 @@ the location of the resource that the autoscale setting should be added to. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -250,7 +289,7 @@ the resource identifier of the resource that the autoscale setting should be add ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -296,6 +335,10 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource + +### Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.IAutoscaleIdentity + ## OUTPUTS ### Microsoft.Azure.PowerShell.Cmdlets.Monitor.Autoscale.Models.Api20221001.IAutoscaleSettingResource @@ -309,6 +352,12 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +`INPUTOBJECT `: Identity Parameter + - `[AutoscaleSettingName ]`: The autoscale setting name. + - `[Id ]`: Resource identity path + - `[ResourceGroupName ]`: The name of the resource group. The name is case insensitive. + - `[SubscriptionId ]`: The ID of the target subscription. + `NOTIFICATION `: the collection of notifications. - `[EmailCustomEmail ]`: the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. - `[EmailSendToSubscriptionAdministrator ]`: a value indicating whether to send email to subscription administrator. @@ -318,6 +367,64 @@ To create the parameters described below, construct a hash table containing the - `[(Any) ]`: This indicates any property can be added to this object. - `[ServiceUri ]`: the service address to receive the notification. +`PARAMETER `: The autoscale setting resource. + - `Location `: Resource location + - `Profile `: the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. + - `CapacityDefault `: the number of instances that will be set if metrics are not available for evaluation. The default is only used if the current instance count is lower than the default. + - `CapacityMaximum `: the maximum number of instances for the resource. The actual maximum number of instances is limited by the cores that are available in the subscription. + - `CapacityMinimum `: the minimum number of instances for the resource. + - `Name `: the name of the profile. + - `Rule `: the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. + - `MetricTriggerMetricName `: the name of the metric that defines what the rule monitors. + - `MetricTriggerMetricResourceUri `: the resource identifier of the resource the rule monitors. + - `MetricTriggerOperator `: the operator that is used to compare the metric data and the threshold. + - `MetricTriggerStatistic `: the metric statistic type. How the metrics from multiple instances are combined. + - `MetricTriggerThreshold `: the threshold of the metric that triggers the scale action. + - `MetricTriggerTimeAggregation `: time aggregation type. How the data that is collected should be combined over time. The default value is Average. + - `MetricTriggerTimeGrain `: 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. + - `MetricTriggerTimeWindow `: the range of time in which instance data is collected. This value must be greater than the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 minutes. + - `ScaleActionCooldown `: the amount of time to wait since the last scaling action before this action occurs. It must be between 1 week and 1 minute in ISO 8601 format. + - `ScaleActionDirection `: the scale direction. Whether the scaling action increases or decreases the number of instances. + - `ScaleActionType `: the type of action that should occur when the scale rule fires. + - `[MetricTriggerDimension ]`: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. + - `DimensionName `: Name of the dimension. + - `Operator `: 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 + - `Value `: list of dimension values. For example: ["App1","App2"]. + - `[MetricTriggerDividePerInstance ]`: a value indicating whether metric should divide per instance. + - `[MetricTriggerMetricNamespace ]`: the namespace of the metric that defines what the rule monitors. + - `[MetricTriggerMetricResourceLocation ]`: the location of the resource the rule monitors. + - `[ScaleActionValue ]`: the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1. + - `[FixedDateEnd ]`: the end time for the profile in ISO 8601 format. + - `[FixedDateStart ]`: the start time for the profile in ISO 8601 format. + - `[FixedDateTimeZone ]`: the timezone of the start and end times for the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time + - `[RecurrenceFrequency ]`: 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. + - `[ScheduleDay ]`: the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. + - `[ScheduleHour ]`: A collection of hours that the profile takes effect on. Values supported are 0 to 23 on the 24-hour clock (AM/PM times are not supported). + - `[ScheduleMinute ]`: A collection of minutes at which the profile takes effect at. + - `[ScheduleTimeZone ]`: the timezone for the hours of the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time + - `[SystemDataCreatedAt ]`: The timestamp of resource creation (UTC). + - `[SystemDataCreatedBy ]`: The identity that created the resource. + - `[SystemDataCreatedByType ]`: The type of identity that created the resource. + - `[SystemDataLastModifiedAt ]`: The timestamp of resource last modification (UTC) + - `[SystemDataLastModifiedBy ]`: The identity that last modified the resource. + - `[SystemDataLastModifiedByType ]`: The type of identity that last modified the resource. + - `[Tag ]`: Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. + - `[(Any) ]`: This indicates any property can be added to this object. + - `[Enabled ]`: the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'false'. + - `[Notification ]`: the collection of notifications. + - `[EmailCustomEmail ]`: the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. + - `[EmailSendToSubscriptionAdministrator ]`: a value indicating whether to send email to subscription administrator. + - `[EmailSendToSubscriptionCoAdministrator ]`: a value indicating whether to send email to subscription co-administrators. + - `[Webhook ]`: the collection of webhook notifications. + - `[Property ]`: a property bag of settings. This value can be empty. + - `[(Any) ]`: This indicates any property can be added to this object. + - `[ServiceUri ]`: the service address to receive the notification. + - `[PredictiveAutoscalePolicyScaleLookAheadTime ]`: the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in ISO 8601 format. + - `[PredictiveAutoscalePolicyScaleMode ]`: the predictive autoscale mode + - `[PropertiesName ]`: the name of the autoscale setting. + - `[TargetResourceLocation ]`: the location of the resource that the autoscale setting should be added to. + - `[TargetResourceUri ]`: the resource identifier of the resource that the autoscale setting should be added to. + `PROFILE `: the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. - `CapacityDefault `: the number of instances that will be set if metrics are not available for evaluation. The default is only used if the current instance count is lower than the default. - `CapacityMaximum `: the maximum number of instances for the resource. The actual maximum number of instances is limited by the cores that are available in the subscription. diff --git a/src/Monitor/Autoscale.Autorest/docs/README.md b/src/Monitor/Autoscale.Autorest/docs/README.md index fcd45ce243d7..8dbefe559d9a 100644 --- a/src/Monitor/Autoscale.Autorest/docs/README.md +++ b/src/Monitor/Autoscale.Autorest/docs/README.md @@ -8,4 +8,4 @@ This directory contains the documentation of the cmdlets for the `Az.Autoscale` - Packaged: yes ## Details -The process of documentation generation loads `Az.Autoscale` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file +The process of documentation generation loads `Az.Autoscale` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file diff --git a/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleProfileObject.md b/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleProfileObject.md index 80c20a3727e5..46bcb62a92dd 100644 --- a/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleProfileObject.md +++ b/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleProfileObject.md @@ -1,6 +1,6 @@ ### Example 1: Create autoscale profile object ```powershell -$subscriptionId = (Get-AzContext).SubscriptionId +$subscriptionId = (Get-AzContext).Subscription.Id $rule1=New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) New-AzAutoscaleProfileObject -Name "adios" -CapacityDefault 1 -CapacityMaximum 10 -CapacityMinimum 1 -Rule $rule1 -FixedDateEnd ([System.DateTime]::Parse("2022-12-31T14:00:00Z")) -FixedDateStart ([System.DateTime]::Parse("2022-12-31T13:00:00Z")) -FixedDateTimeZone "UTC" ``` diff --git a/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleScaleRuleObject.md b/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleScaleRuleObject.md index 540c53fe76e5..5c0814ba9159 100644 --- a/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleScaleRuleObject.md +++ b/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleScaleRuleObject.md @@ -1,6 +1,6 @@ ### Example 1: Create scale rule object ```powershell -$subscriptionId = (Get-AzContext).SubscriptionId +$subscriptionId = (Get-AzContext).Subscription.Id New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) ``` diff --git a/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleSetting.md b/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleSetting.md index dc6a06ac8c18..594731eddc81 100644 --- a/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleSetting.md +++ b/src/Monitor/Autoscale.Autorest/examples/New-AzAutoscaleSetting.md @@ -1,6 +1,6 @@ ### Example 1: Create autoscale setting for vmss ```powershell -$subscriptionId = (Get-AzContext).SubscriptionId +$subscriptionId = (Get-AzContext).Subscription.Id $rule1=New-AzAutoscaleScaleRuleObject -MetricTriggerMetricName "Percentage CPU" -MetricTriggerMetricResourceUri "/subscriptions/$subscriptionId/resourceGroups/test-group/providers/Microsoft.Compute/virtualMachineScaleSets/test-vmss" -MetricTriggerTimeGrain ([System.TimeSpan]::New(0,1,0)) -MetricTriggerStatistic "Average" -MetricTriggerTimeWindow ([System.TimeSpan]::New(0,5,0)) -MetricTriggerTimeAggregation "Average" -MetricTriggerOperator "GreaterThan" -MetricTriggerThreshold 10 -MetricTriggerDividePerInstance $false -ScaleActionDirection "Increase" -ScaleActionType "ChangeCount" -ScaleActionValue 1 -ScaleActionCooldown ([System.TimeSpan]::New(0,5,0)) $profile1=New-AzAutoscaleProfileObject -Name "adios" -CapacityDefault 1 -CapacityMaximum 10 -CapacityMinimum 1 -Rule $rule1 -FixedDateEnd ([System.DateTime]::Parse("2022-12-31T14:00:00Z")) -FixedDateStart ([System.DateTime]::Parse("2022-12-31T13:00:00Z")) -FixedDateTimeZone "UTC" $webhook1=New-AzAutoscaleWebhookNotificationObject -Property @{} -ServiceUri "http://myservice.com"