Skip to content

Commit e8f4847

Browse files
haitchhaitch
authored andcommitted
address comments about breaking change
1 parent 99873d1 commit e8f4847

File tree

5 files changed

+42
-9
lines changed

5 files changed

+42
-9
lines changed

src/ResourceManager/OperationalInsights/Commands.OperationalInsights/DataSources/GetAzureOperationalInsightsDataSourceCommand.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
namespace Microsoft.Azure.Commands.OperationalInsights
2222
{
23-
[Cmdlet(VerbsCommon.Get, Constants.DataSource, DefaultParameterSetName = ByWorkspaceNameByKind), OutputType(typeof(List<PSDataSource>), typeof(PSDataSource))]
23+
[Cmdlet(VerbsCommon.Get, Constants.DataSource, DefaultParameterSetName = ByWorkspaceName), OutputType(typeof(List<PSDataSource>), typeof(PSDataSource))]
2424
public class GetAzureOperationalInsightsDataSourceCommand : OperationalInsightsBaseCmdlet
2525
{
2626
const string ByWorkspaceObjectByName = "ByWorkspaceObjectByName";
@@ -68,6 +68,11 @@ public class GetAzureOperationalInsightsDataSourceCommand : OperationalInsightsB
6868

6969
public override void ExecuteCmdlet()
7070
{
71+
if (ParameterSetName == ByWorkspaceName)
72+
{
73+
WriteWarning(Properties.Resources.GetWorkspaceDataSourceParameterSetWarning);
74+
return;
75+
}
7176
if (ParameterSetName == ByWorkspaceObjectByName || ParameterSetName == ByWorkspaceObjectByKind)
7277
{
7378
ResourceGroupName = Workspace.ResourceGroupName;

src/ResourceManager/OperationalInsights/Commands.OperationalInsights/Microsoft.Azure.Commands.OperationalInsights.dll-Help.xml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,10 +2264,17 @@
22642264
</maml:para>
22652265
</maml:alert>
22662266
</maml:alertSet>
2267-
<command:examples><command:example><maml:title>1:</maml:title>
2268-
<dev:code></dev:code>
2269-
<dev:remarks><maml:para>
2270-
</maml:para>
2267+
<command:examples>
2268+
<command:example><maml:title>1: Get specific datasource</maml:title>
2269+
<dev:code>PS C:\&gt;Get-AzureRmOperationalInsightsDataSource -ResourceGroupName "ContosoResourceGroup" -WorkspaceName "ContosoWorkspace" -Name "applicationLogCollection"</dev:code>
2270+
<dev:remarks><maml:para>this command get a datasource named applicationLogCollection in ContosoWorkspace</maml:para>
2271+
<maml:para></maml:para>
2272+
<maml:para></maml:para>
2273+
</dev:remarks>
2274+
</command:example>
2275+
<command:example><maml:title>2: List datasource for a given kind.</maml:title>
2276+
<dev:code>PS C:\&gt;Get-AzureRmOperationalInsightsDataSource -ResourceGroupName "ContosoResourceGroup" -WorkspaceName "ContosoWorkspace" -Kind "WindowsEvent"</dev:code>
2277+
<dev:remarks><maml:para>this command get all WindowsEvent datasource in ContosoWorkspace</maml:para>
22712278
<maml:para></maml:para>
22722279
<maml:para></maml:para>
22732280
</dev:remarks>
@@ -2403,7 +2410,7 @@
24032410
</maml:alert>
24042411
</maml:alertSet>
24052412
<command:examples><command:example><maml:title>Example 1: Get Intelligence Packs</maml:title>
2406-
<dev:code>PS C:\&gt;Get-AzureOperationalInsightsStorageInsight -ResourceGroupName "ContosoResourceGroup" -WorkspaceName "ContosoWorkspace"</dev:code>
2413+
<dev:code>PS C:\&gt;Get-AzureRmOperationalInsightsStorageInsight -ResourceGroupName "ContosoResourceGroup" -WorkspaceName "ContosoWorkspace"</dev:code>
24072414
<dev:remarks><maml:para>This command gets the available Intelligence Packs.
24082415
</maml:para>
24092416
<maml:para></maml:para>
@@ -3768,7 +3775,7 @@ PS C:\&gt;Get-AzureRmOperationalInsightsStorageInsight -Workspace $Workspace -Na
37683775
</dev:remarks>
37693776
</command:example>
37703777
<command:example><maml:title>Example 2: Get management groups by using the pipeline</maml:title>
3771-
<dev:code>PS C:\&gt;Get-AzureRmOperationalInsightsWorkspace -ResourceGroupName "ContosoResourceGroup" -Name "MyWorkspace" | Get-AzureOperationalInsightsWorkspaceManagementGroups</dev:code>
3778+
<dev:code>PS C:\&gt;Get-AzureRmOperationalInsightsWorkspace -ResourceGroupName "ContosoResourceGroup" -Name "MyWorkspace" | Get-AzureRmOperationalInsightsWorkspaceManagementGroups</dev:code>
37723779
<dev:remarks><maml:para>This command uses the Get-AzureRmOperationalInsightsWorkspace cmdlet to get the workspace named MyWorkspace, and then passes the workspace to the current cmdlet, which gets the management groups for that workspace.
37733780
</maml:para>
37743781
<maml:para></maml:para>
@@ -4060,7 +4067,7 @@ PS C:\&gt;Get-AzureRmOperationalInsightsStorageInsight -Workspace $Workspace -Na
40604067
</dev:remarks>
40614068
</command:example>
40624069
<command:example><maml:title>Example 2: Get usage data using the pipeline</maml:title>
4063-
<dev:code>PS C:\&gt;Get-AzureRmOperationalInsightsWorkspace -ResourceGroupName "ContosoResourceGroup" -Name "MyWorkspace" | Get-AzureOperationalInsightsWorkspaceUsage</dev:code>
4070+
<dev:code>PS C:\&gt;Get-AzureRmOperationalInsightsWorkspace -ResourceGroupName "ContosoResourceGroup" -Name "MyWorkspace" | Get-AzureRmOperationalInsightsWorkspaceUsage</dev:code>
40644071
<dev:remarks><maml:para>This command gets the workspace named MyWorkSpace using the Get-AzureRmOperationalInsightsWorkspace cmdlet, and then passes the workspace to the current cmdlet. The command gets the usage details for that workspace.
40654072
</maml:para>
40664073
<maml:para></maml:para>

src/ResourceManager/OperationalInsights/Commands.OperationalInsights/Properties/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ResourceManager/OperationalInsights/Commands.OperationalInsights/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ Error Message: {2}
165165
Request Id: {3}
166166
Timestamp (Utc):{4}</value>
167167
</data>
168+
<data name="GetWorkspaceDataSourceParameterSetWarning" xml:space="preserve">
169+
<value>This parameter set will be deprecated in next release, and default parameter set will change to ByWorkspaceNameByKind.</value>
170+
</data>
168171
<data name="ResourceGroupNameCannotBeEmpty" xml:space="preserve">
169172
<value>Resource group name cannot be null.</value>
170173
</data>

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,13 @@
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+
Default parameter set for Get-AzureRmOperationalInsightsDataSource will be deprecated and change to ByWorkspaceNameByKind.
31+
```powershell
32+
# Old (which does nothing)
33+
Get-AzureRmOperationalInsightsDataSource
34+
35+
# New
36+
Get-AzureRmOperationalInsightsDataSource -ResourceGroupName "resourceGroupA" -WorkspaceName "LogAnalyticsWorkspace" -Kind AzureActivityLog
37+
```

0 commit comments

Comments
 (0)