Skip to content

Commit ff2ec9b

Browse files
authored
Merge pull request Azure#28 from LucasYao93/lucas/MonitorSolutions-dev
Add test cases and examples of monitor solutions.
2 parents ff5dfb2 + 4e8b636 commit ff2ec9b

22 files changed

+1411
-85
lines changed

src/MonitoringSolutions/docs/Get-AzMonitorLogAnalyticsSolution.md

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,50 @@ Retrieves the user solution.
4141

4242
## EXAMPLES
4343

44-
### Example 1: {{ Add title here }}
44+
### Example 1: Get a monitor log analytics solution by name
4545
```powershell
46-
PS C:\> {{ Add code here }}
46+
PS C:\> Get-AzMonitorLogAnalyticsSolution -ResourceGroupName azureps-monitor -Name 'Containers(azureps-monitor)'
4747
48-
{{ Add output here }}
48+
Name Type Location
49+
---- ---- --------
50+
Containers(azureps-monitor) Microsoft.OperationsManagement/solutions West US 2
4951
```
5052

51-
{{ Add description here }}
53+
This command gets a monitor log analytics solution by name.
5254

53-
### Example 2: {{ Add title here }}
55+
### Example 2: Get a monitor log analytics solution by object
5456
```powershell
55-
PS C:\> {{ Add code here }}
57+
PS C:\> $monitor = Get-AzMonitorLogAnalyticsSolution -ResourceGroupName azureps-monitor -Name 'Containers(azureps-monitor)'
58+
PS C:\> Get-AzMonitorLogAnalyticsSolution -InputObject $monitor
59+
Name Type Location
60+
---- ---- --------
61+
Containers(azureps-monitor) Microsoft.OperationsManagement/solutions West US 2
62+
```
63+
64+
This command gets a monitor log analytics solution by object.
65+
66+
### Example 3: Get all monitor log analytics solutions under a resource group
67+
```powershell
68+
PS C:\> Get-AzMonitorLogAnalyticsSolution -ResourceGroupName azureps-monitor
69+
70+
Name Type Location
71+
---- ---- --------
72+
Containers(azureps-monitor) Microsoft.OperationsManagement/solutions West US 2
73+
```
74+
75+
This command gets all monitor log analytics solutions under a resource group.
76+
77+
### Example 4: Get all monitor log analytics solutions under a subscription
78+
```powershell
79+
PS C:\> Get-AzMonitorLogAnalyticsSolution
5680
57-
{{ Add output here }}
81+
Name Type Location
82+
---- ---- --------
83+
Containers(monitoringworkspace-t01) Microsoft.OperationsManagement/solutions East US
84+
Containers(azureps-monitor) Microsoft.OperationsManagement/solutions West US 2
5885
```
5986

60-
{{ Add description here }}
87+
This command gets all monitor log analytics solutions under a subscription.
6188

6289
## PARAMETERS
6390

src/MonitoringSolutions/docs/New-AzMonitorLogAnalyticsSolution.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,17 @@ Creates a log analytics solution.
2323

2424
## EXAMPLES
2525

26-
### Example 1: {{ Add title here }}
26+
### Example 1: Create a monitor log analytics solution for the log analytics workspace
2727
```powershell
28-
PS C:\> {{ Add code here }}
28+
PS C:\> $workspace = Get-AzOperationalInsightsWorkspace -ResourceGroupName azureps-manual-test -Name monitoringworkspace-2vob7n
29+
PS C:\> New-AzMonitorLogAnalyticsSolution -Type Containers -ResourceGroupName azureps-manual-test -Location $workspace.Location -WorkspaceResourceId $workspace.ResourceId
2930
30-
{{ Add output here }}
31+
Name Type Location
32+
---- ---- --------
33+
Containers(monitoringworkspace-2vob7n) Microsoft.OperationsManagement/solutions East US
3134
```
3235

33-
{{ Add description here }}
34-
35-
### Example 2: {{ Add title here }}
36-
```powershell
37-
PS C:\> {{ Add code here }}
38-
39-
{{ Add output here }}
40-
```
41-
42-
{{ Add description here }}
36+
This command creates a monitor log analytics solution for the log analytics workspace.
4337

4438
## PARAMETERS
4539

src/MonitoringSolutions/docs/Remove-AzMonitorLogAnalyticsSolution.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,22 @@ Deletes the solution in the subscription.
2929

3030
## EXAMPLES
3131

32-
### Example 1: {{ Add title here }}
32+
### Example 1: Remove a monitor log analytics solution by name
3333
```powershell
34-
PS C:\> {{ Add code here }}
34+
PS C:\> Remove-AzMonitorLogAnalyticsSolution -ResourceGroupName azureps-manual-test -Name 'Containers(monitoringworkspace-2vob7n)'
3535
36-
{{ Add output here }}
3736
```
3837

39-
{{ Add description here }}
38+
This command removes a monitor log analytics solution by name.
4039

41-
### Example 2: {{ Add title here }}
40+
### Example 2: Remove a monitor log analytics solution by object
4241
```powershell
43-
PS C:\> {{ Add code here }}
42+
PS C:\> $monitor = Get-AzMonitorLogAnalyticsSolution -ResourceGroupName azureps-manual-test -Name 'Containers(monitoringworkspace-pevful)'
43+
PS C:\> Remove-AzMonitorLogAnalyticsSolution -InputObject $monitor
4444
45-
{{ Add output here }}
4645
```
4746

48-
{{ Add description here }}
47+
This command removes a monitor log analytics solution by object.
4948

5049
## PARAMETERS
5150

src/MonitoringSolutions/docs/Update-AzMonitorLogAnalyticsSolution.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,28 @@ Only updating tags supported.
3131

3232
## EXAMPLES
3333

34-
### Example 1: {{ Add title here }}
34+
### Example 1: Update a monitor log analytics solution by name
3535
```powershell
36-
PS C:\> {{ Add code here }}
36+
PS C:\> Update-AzMonitorLogAnalyticsSolution -ResourceGroupName lucas-manual-test -Name 'Containers(monitoringworkspace-2vob7n)' -Tag @{'Operation'='update';'Param'='Tag'}
3737
38-
{{ Add output here }}
38+
Name Type Location
39+
---- ---- --------
40+
Containers(monitoringworkspace-2vob7n) Microsoft.OperationsManagement/solutions East US
3941
```
4042

41-
{{ Add description here }}
43+
This command updates a monitor log analytics solution by name.
4244

43-
### Example 2: {{ Add title here }}
45+
### Example 2: Update a monitor log analytics solution by object
4446
```powershell
45-
PS C:\> {{ Add code here }}
47+
PS C:\> $monitor = Get-AzMonitorLogAnalyticsSolution -ResourceGroupName lucas-manual-test -Name 'Containers(monitoringworkspace-2vob7n)'
48+
PS C:\> Update-AzMonitorLogAnalyticsSolution -InputObject $monitor -Tag @{'Operation'='update';'Param'='Tag'}
4649
47-
{{ Add output here }}
50+
Name Type Location
51+
---- ---- --------
52+
Containers(monitoringworkspace-2vob7n) Microsoft.OperationsManagement/solutions East US
4853
```
4954

50-
{{ Add description here }}
55+
This command updates a monitor log analytics solution by object.
5156

5257
## PARAMETERS
5358

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,46 @@
1-
### Example 1: {{ Add title here }}
1+
### Example 1: Get a monitor log analytics solution by name
22
```powershell
3-
PS C:\> {{ Add code here }}
3+
PS C:\> Get-AzMonitorLogAnalyticsSolution -ResourceGroupName azureps-monitor -Name 'Containers(azureps-monitor)'
44
5-
{{ Add output here }}
5+
Name Type Location
6+
---- ---- --------
7+
Containers(azureps-monitor) Microsoft.OperationsManagement/solutions West US 2
68
```
79

8-
{{ Add description here }}
10+
This command gets a monitor log analytics solution by name.
911

10-
### Example 2: {{ Add title here }}
12+
### Example 2: Get a monitor log analytics solution by object
1113
```powershell
12-
PS C:\> {{ Add code here }}
14+
PS C:\> $monitor = Get-AzMonitorLogAnalyticsSolution -ResourceGroupName azureps-monitor -Name 'Containers(azureps-monitor)'
15+
PS C:\> Get-AzMonitorLogAnalyticsSolution -InputObject $monitor
16+
Name Type Location
17+
---- ---- --------
18+
Containers(azureps-monitor) Microsoft.OperationsManagement/solutions West US 2
19+
```
20+
21+
This command gets a monitor log analytics solution by object.
22+
23+
### Example 3: Get all monitor log analytics solutions under a resource group
24+
```powershell
25+
PS C:\> Get-AzMonitorLogAnalyticsSolution -ResourceGroupName azureps-monitor
26+
27+
Name Type Location
28+
---- ---- --------
29+
Containers(azureps-monitor) Microsoft.OperationsManagement/solutions West US 2
30+
```
31+
32+
This command gets all monitor log analytics solutions under a resource group.
1333

14-
{{ Add output here }}
34+
### Example 4: Get all monitor log analytics solutions under a subscription
35+
```powershell
36+
PS C:\> Get-AzMonitorLogAnalyticsSolution
37+
38+
Name Type Location
39+
---- ---- --------
40+
Containers(monitoringworkspace-t01) Microsoft.OperationsManagement/solutions East US
41+
Containers(azureps-monitor) Microsoft.OperationsManagement/solutions West US 2
1542
```
1643

17-
{{ Add description here }}
44+
This command gets all monitor log analytics solutions under a subscription.
45+
1846

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
### Example 1: {{ Add title here }}
1+
### Example 1: Create a monitor log analytics solution for the log analytics workspace
22
```powershell
3-
PS C:\> {{ Add code here }}
3+
PS C:\> $workspace = Get-AzOperationalInsightsWorkspace -ResourceGroupName azureps-manual-test -Name monitoringworkspace-2vob7n
4+
PS C:\> New-AzMonitorLogAnalyticsSolution -Type Containers -ResourceGroupName azureps-manual-test -Location $workspace.Location -WorkspaceResourceId $workspace.ResourceId
45
5-
{{ Add output here }}
6+
Name Type Location
7+
---- ---- --------
8+
Containers(monitoringworkspace-2vob7n) Microsoft.OperationsManagement/solutions East US
69
```
710

8-
{{ Add description here }}
9-
10-
### Example 2: {{ Add title here }}
11-
```powershell
12-
PS C:\> {{ Add code here }}
13-
14-
{{ Add output here }}
15-
```
16-
17-
{{ Add description here }}
11+
This command creates a monitor log analytics solution for the log analytics workspace.
1812

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
### Example 1: {{ Add title here }}
1+
### Example 1: Remove a monitor log analytics solution by name
22
```powershell
3-
PS C:\> {{ Add code here }}
3+
PS C:\> Remove-AzMonitorLogAnalyticsSolution -ResourceGroupName azureps-manual-test -Name 'Containers(monitoringworkspace-2vob7n)'
44
5-
{{ Add output here }}
65
```
76

8-
{{ Add description here }}
7+
This command removes a monitor log analytics solution by name.
98

10-
### Example 2: {{ Add title here }}
9+
### Example 2: Remove a monitor log analytics solution by object
1110
```powershell
12-
PS C:\> {{ Add code here }}
11+
PS C:\> $monitor = Get-AzMonitorLogAnalyticsSolution -ResourceGroupName azureps-manual-test -Name 'Containers(monitoringworkspace-pevful)'
12+
PS C:\> Remove-AzMonitorLogAnalyticsSolution -InputObject $monitor
1313
14-
{{ Add output here }}
1514
```
1615

17-
{{ Add description here }}
16+
This command removes a monitor log analytics solution by object.
1817

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1-
### Example 1: {{ Add title here }}
1+
### Example 1: Update a monitor log analytics solution by name
22
```powershell
3-
PS C:\> {{ Add code here }}
3+
PS C:\> Update-AzMonitorLogAnalyticsSolution -ResourceGroupName lucas-manual-test -Name 'Containers(monitoringworkspace-2vob7n)' -Tag @{'Operation'='update';'Param'='Tag'}
44
5-
{{ Add output here }}
5+
Name Type Location
6+
---- ---- --------
7+
Containers(monitoringworkspace-2vob7n) Microsoft.OperationsManagement/solutions East US
68
```
79

8-
{{ Add description here }}
10+
This command updates a monitor log analytics solution by name.
911

10-
### Example 2: {{ Add title here }}
12+
### Example 2: Update a monitor log analytics solution by object
1113
```powershell
12-
PS C:\> {{ Add code here }}
14+
PS C:\> $monitor = Get-AzMonitorLogAnalyticsSolution -ResourceGroupName lucas-manual-test -Name 'Containers(monitoringworkspace-2vob7n)'
15+
PS C:\> Update-AzMonitorLogAnalyticsSolution -InputObject $monitor -Tag @{'Operation'='update';'Param'='Tag'}
1316
14-
{{ Add output here }}
17+
Name Type Location
18+
---- ---- --------
19+
Containers(monitoringworkspace-2vob7n) Microsoft.OperationsManagement/solutions East US
1520
```
1621

17-
{{ Add description here }}
22+
This command updates a monitor log analytics solution by object.
1823

0 commit comments

Comments
 (0)