Skip to content

Commit 3112e8c

Browse files
committed
Reverting change to SQL test, improving documentation about upcoming breaking changes and moving the content to an internal file, updating the change log
1 parent ea78dff commit 3112e8c

File tree

4 files changed

+132
-104
lines changed

4 files changed

+132
-104
lines changed

documentation/breaking-changes/upcoming-breaking-changes.md

Lines changed: 0 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -27,101 +27,3 @@
2727

2828
# Upcoming Breaking Changes
2929

30-
## Release 3.0.0 - February 2017
31-
32-
The following cmdlets were affected this release:
33-
34-
**Get-AzureRmMetricDefinition**
35-
- The metric definitions are now retrieved from MDM. In this case, the records returned by this cmdlet are different even though the call remains the same.
36-
37-
```powershell
38-
# Old
39-
40-
$s1 = Get-AzureRmMetricDefinition -res $resourceIdMetric -det
41-
write-host "Values: $s1"
42-
$s11 = $s1[0]
43-
write-host "First value: $s11"
44-
$metricName = $s11.Name
45-
46-
$s2 = Get-AzureRmMetricDefinition -res $resourceIdMetric -met $metricName -det
47-
$s21 = $s2[0]
48-
write-host "Availabilities: $s21.MetricAvailabilities"
49-
50-
write-host "Unit: $s21.Unit"
51-
write-host "ResourceId: $s21.ResourceId"
52-
write-host "Name: $s21.Name"
53-
write-host "PrimaryAggregationType: $s21.PrimaryAggregationType"
54-
write-host "Properties: $s21.Properties"
55-
56-
$s22 = $s21.MetricAvailabilities[0]
57-
write-host "BlobLocation: $s22.BlobLocation"
58-
write-host "Location: $s22.Location"
59-
write-host "Retention: $s22.Retention"
60-
write-host "Timegrain: $s22.TimeGrain"
61-
62-
# New
63-
64-
$s1 = Get-AzureRmMetricDefinition -res $resourceIdMetric -det
65-
write-host "Values: $s1"
66-
$s11 = $s1[0]
67-
write-host "First value: $s11"
68-
$metricName = $s11.Name.Value
69-
70-
$s2 = Get-AzureRmMetricDefinition -res $resourceIdMetric -met $metricName -det
71-
$s21 = $s2[0]
72-
write-host "Availabilities: $s21.MetricAvailabilities"
73-
74-
write-host "Unit: $s21.Unit"
75-
write-host "ResourceId: $s21.ResourceId"
76-
write-host "Name: $s21.Name.Value"
77-
write-host "PrimaryAggregationType: $s21.PrimaryAggregationType"
78-
79-
$s22 = $s21.MetricAvailabilities[0]
80-
write-host "Retention: $s22.Retention"
81-
write-host "Timegrain: $s22.TimeGrain"
82-
83-
```
84-
85-
**Get-AzureRmMetric**
86-
- The metrics are now retrieved from MDM. The call and the returned records are different now.
87-
88-
```powershell
89-
# Old
90-
91-
# ResourceId and timeGrain are mandatory and positional
92-
$s1 = Get-AzureRmMetric $resourceIdMetric $timeGrain -det
93-
94-
write-host "Values: $s1"
95-
96-
$s11 = $s1[0]
97-
98-
write-host "Dimension name: $s11.DimensionName"
99-
write-host "Dimension value: $s11.DimensionValue"
100-
write-host "End time: $s11.EndTime"
101-
write-host "Start time: $s11.StartTime"
102-
write-host "ResourceId: $s11.ResourceId"
103-
write-host "TimeGrain: $s11.TimeGrain"
104-
write-host "Unit: $s11.Unit"
105-
write-host "Metric values: $s11.MetricValues"
106-
107-
# New
108-
109-
# This calls are valid. ResourceId remains mandatory and positional
110-
$s1 = Get-AzureRmMetric $resourceIdMetric
111-
$s1 = Get-AzureRmMetric -res $resourceIdMetric
112-
113-
write-host "Values: $s1"
114-
115-
# This calls now requires the argument -MetricNames to succeed. MetricName is also positional (position 1). TimeGrain becomes optional and it is only accepted if MetricNames is given.
116-
# If metricName is not given, no other parameter is accepted (except resourceId)
117-
$s2 = Get-AzureRmMetric $resourceIdMetric -time $timeGrain -metricn $metricName
118-
119-
write-host "Values: $s2"
120-
121-
$s21 = $s2[0]
122-
123-
write-host "Name: $s21.Name.Value"
124-
write-host "Unit: $s21.Unit"
125-
write-host "Data: $s21.Data"
126-
127-
```

src/ResourceManager/Insights/ChangeLog.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,15 @@
2929
- Remove-AzureRmAutoscaleSetting
3030
- Remove-AzureRmLogProfile
3131
* Add new parameter to Set-AzureRmDiagnosticSetting
32-
- Parameter WorkspaceId is the OMS workspace Id
32+
- Parameter WorkspaceId is the OMS workspace Id
33+
34+
## Version 2.3.1
35+
* Parameter now accepts two more values in New-AzureRmAutoscaleRule
36+
- Parameter ScaleType now accepts the previous ChangeCount (default) plus two more values PercentChangeCount, and ExactCount
37+
- Add a warning message about this parameter accepting two more values
38+
39+
* Add parameter became optional in Add-AzureRmLogProfile
40+
- Parameter StorageAccountId is now optional
41+
42+
* Minor changes to the output classes to expose more properties
43+
- Before the user could see the properties because they were printed, but not access them programatically because they were protected for instance.

src/ResourceManager/Insights/documentation/upcoming-breaking-changes.md

Lines changed: 117 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,120 @@
2525
https://github.com/Azure/azure-powershell/blob/dev/documentation/breaking-changes/breaking-change-template.md
2626
-->
2727

28-
# Upcoming Breaking Changes
28+
# Upcoming Breaking Changes
29+
30+
## Release 3.0.0
31+
32+
The following cmdlets were affected this release:
33+
34+
**Get-AzureRmMetricDefinition**
35+
- The metric definitions are now retrieved from MDM. In this case, the records returned by this cmdlet are different even though the call remains the same.
36+
37+
```powershell
38+
# Old
39+
40+
$s1 = Get-AzureRmMetricDefinition -res $resourceIdMetric -det
41+
write-host "Values: $s1"
42+
$s11 = $s1[0]
43+
write-host "First value: $s11"
44+
$metricName = $s11.Name
45+
46+
$s2 = Get-AzureRmMetricDefinition -res $resourceIdMetric -met $metricName -det
47+
$s21 = $s2[0]
48+
write-host "Availabilities: $s21.MetricAvailabilities"
49+
50+
write-host "Unit: $s21.Unit"
51+
write-host "ResourceId: $s21.ResourceId"
52+
write-host "Name: $s21.Name"
53+
write-host "PrimaryAggregationType: $s21.PrimaryAggregationType"
54+
write-host "Properties: $s21.Properties"
55+
56+
$s22 = $s21.MetricAvailabilities[0]
57+
write-host "BlobLocation: $s22.BlobLocation"
58+
write-host "Location: $s22.Location"
59+
write-host "Retention: $s22.Retention"
60+
write-host "Timegrain: $s22.TimeGrain"
61+
62+
# New
63+
64+
# The call remains the same, but the returned values changed
65+
$s1 = Get-AzureRmMetricDefinition -res $resourceIdMetric -det
66+
write-host "Values: $s1"
67+
$s11 = $s1[0]
68+
write-host "First value: $s11"
69+
70+
# Notice name is now a LocalizableString
71+
$metricName = $s11.Name.Value
72+
73+
$s2 = Get-AzureRmMetricDefinition -res $resourceIdMetric -met $metricName -det
74+
$s21 = $s2[0]
75+
write-host "Availabilities: $s21.MetricAvailabilities"
76+
77+
# Notice there are no properties and name is now a LocalizableString
78+
write-host "Unit: $s21.Unit"
79+
write-host "ResourceId: $s21.ResourceId"
80+
write-host "Name: $s21.Name.Value"
81+
write-host "PrimaryAggregationType: $s21.PrimaryAggregationType"
82+
83+
# Notice there are no BlobLocation or Location
84+
$s22 = $s21.MetricAvailabilities[0]
85+
write-host "Retention: $s22.Retention"
86+
write-host "Timegrain: $s22.TimeGrain"
87+
88+
```
89+
90+
**Get-AzureRmMetric**
91+
- The metrics are now retrieved from MDM. The call and the returned records are different now.
92+
93+
```powershell
94+
# Old
95+
96+
# The old syntax can be described this way: Get-AzureRmMEtric [-resourceid] string [-timeGrain] string [-detailedOutput] [-starttime string] [-endtime string] [-metricNames string [, string]*]
97+
# ResourceId and timeGrain are mandatory and positional
98+
# Other parameters are: StartTime (DateTime), EndTime (DateTime), MetricNames (array of strings), DetailedOutput (SwitchParameter).
99+
# All of them are optional.
100+
$s1 = Get-AzureRmMetric $resourceIdMetric $timeGrain -det
101+
102+
write-host "Values: $s1"
103+
104+
$s11 = $s1[0]
105+
106+
write-host "Dimension name: $s11.DimensionName"
107+
write-host "Dimension value: $s11.DimensionValue"
108+
write-host "End time: $s11.EndTime"
109+
write-host "Start time: $s11.StartTime"
110+
write-host "ResourceId: $s11.ResourceId"
111+
write-host "TimeGrain: $s11.TimeGrain"
112+
write-host "Unit: $s11.Unit"
113+
write-host "Metric values: $s11.MetricValues"
114+
115+
# New
116+
117+
# The new syntax can be described as follows: Get-AzureRmMetric [-resourceId] string [[-metricNames] string [, string]* [-timeGrain string] [-starttime string] [-endtime string] [-aggregationType string]] [-detailedOutput]
118+
# ResourceId remians mandatory and positional (position 0)
119+
# All the other parameters are now optional, including timeGrain (hence this is a breaking change)
120+
# There is a new parameter AggregationType with this values (None (default), Average, Count, Minimum, Maximum, Total)
121+
# MetricNames, when given, is positional (position 1) and enables the other parameters: TimeGrain, StartTime, EndTime, AggregationType
122+
#
123+
# The following two calls are now valid since resourceId remains mandatory and positional
124+
$s1 = Get-AzureRmMetric $resourceIdMetric -det
125+
$s1 = Get-AzureRmMetric -res $resourceIdMetric -det
126+
127+
write-host "Values: $s1"
128+
129+
# This calls now requires the argument -MetricNames to succeed. MetricName is also positional (position 1). TimeGrain becomes optional and it is only accepted if MetricNames is given.
130+
# If metricName is not given, no other parameter is accepted (except resourceId)
131+
$s2 = Get-AzureRmMetric $resourceIdMetric $metricName -time $timeGrain -det
132+
$s2 = Get-AzureRmMetric $resourceIdMetric $metricName -time $timeGrain -det -aggreg Maximum
133+
134+
write-host "Values: $s2"
135+
136+
$s21 = $s2[0]
137+
138+
# The output shows a different structure: the name is a localizable string, and metric values is now called Data.
139+
# The contents of Data depend on the value of AggregationType (if given). If not given Data will contain the values for the default aggregation type which depends on the metric and how it was defined.
140+
write-host "Name: $s21.Name.Value"
141+
write-host "Unit: $s21.Unit"
142+
write-host "Data: $s21.Data"
143+
144+
```

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/ElasticPoolCrudTests.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,9 @@ function Test-GetElasticPoolMetric
171171
Assert-NotNull $ep1
172172

173173
# Get pool metrics with all values
174-
# Commenting this section of the test becuase the GetAzureRmMetric has been replaced and must be called using -MetricNames <list of names> as parameter to enabled all the other parameters
175-
#$metrics = $ep1 | Get-AzureRmMetric -TimeGrain "0:5:0" -StartTime "2015-04-22T16:00:00Z" -EndTime "2015-04-22T17:00:00Z"
176-
#Assert-NotNull $metrics
177-
#Assert-True { $metrics.Count -gt 0 }
174+
$metrics = $ep1 | Get-AzureRmMetric -TimeGrain "0:5:0" -StartTime "2015-04-22T16:00:00Z" -EndTime "2015-04-22T17:00:00Z"
175+
Assert-NotNull $metrics
176+
Assert-True { $metrics.Count -gt 0 }
178177
}
179178

180179

0 commit comments

Comments
 (0)