Skip to content

Commit ef4d9e2

Browse files
committed
Merge branch 'main' into develop
2 parents 0c7790b + a55f61b commit ef4d9e2

19 files changed

+6181
-2814
lines changed

Documentation/Connect-LMAccount.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,5 +260,7 @@ You must run this command before you will be able to execute other commands incl
260260
261261
## RELATED LINKS
262262
263+
[Module repo: https://github.com/logicmonitor/lm-powershell-module]()
264+
263265
[PSGallery: https://www.powershellgallery.com/packages/Logic.Monitor]()
264266

Documentation/Disconnect-LMAccount.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Disconnect from a previously connected LM portal
1313
## SYNTAX
1414

1515
```
16-
Disconnect-LMAccount [<CommonParameters>]
16+
Disconnect-LMAccount
1717
```
1818

1919
## DESCRIPTION
@@ -29,9 +29,6 @@ Disconnect-LMAccount
2929

3030
## PARAMETERS
3131

32-
### CommonParameters
33-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
34-
3532
## INPUTS
3633

3734
### None. You cannot pipe objects to this command.
@@ -42,5 +39,7 @@ Once disconnect you will need to reconnect to a portal before you will be allowe
4239

4340
## RELATED LINKS
4441

42+
[Module repo: https://github.com/logicmonitor/lm-powershell-module]()
43+
4544
[PSGallery: https://www.powershellgallery.com/packages/Logic.Monitor]()
4645

Documentation/Export-LMDeviceConfigBackup.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,5 +143,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
143143
144144
## RELATED LINKS
145145
146+
[Module repo: https://github.com/logicmonitor/lm-powershell-module]()
147+
146148
[PSGallery: https://www.powershellgallery.com/packages/Logic.Monitor]()
147149

Documentation/Export-LMLogicModule.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,7 @@ You must run this command before you will be able to execute other commands incl
129129
130130
## RELATED LINKS
131131
132+
[Module repo: https://github.com/logicmonitor/lm-powershell-module]()
133+
132134
[PSGallery: https://www.powershellgallery.com/packages/Logic.Monitor]()
133135

Documentation/Get-LMAccountStatus.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Retrieves the status of the LogicMonitor account.
1313
## SYNTAX
1414

1515
```
16-
Get-LMAccountStatus [<CommonParameters>]
16+
Get-LMAccountStatus
1717
```
1818

1919
## DESCRIPTION
@@ -31,9 +31,6 @@ This example demonstrates how to use the Get-LMAccountStatus function to retriev
3131

3232
## PARAMETERS
3333

34-
### CommonParameters
35-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
36-
3734
## INPUTS
3835

3936
## OUTPUTS

Documentation/Get-LMDatasourceUpdateHistory.md

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ schema: 2.0.0
88
# Get-LMDatasourceUpdateHistory
99

1010
## SYNOPSIS
11-
{{ Fill in the Synopsis }}
11+
Retrieves the update history of a LogicMonitor datasource.
1212

1313
## SYNTAX
1414

@@ -31,21 +31,34 @@ Get-LMDatasourceUpdateHistory [-DisplayName <String>] [-Filter <Object>] [-Batch
3131
```
3232

3333
## DESCRIPTION
34-
{{ Fill in the Description }}
34+
The Get-LMDatasourceUpdateHistory function retrieves the update history of a LogicMonitor datasource.
35+
It can be used to get information about the updates made to a datasource, such as the reasons for the updates.
3536

3637
## EXAMPLES
3738

38-
### Example 1
39-
```powershell
40-
PS C:\> {{ Add example code here }}
39+
### EXAMPLE 1
40+
```
41+
Get-LMDatasourceUpdateHistory -Id 1234
42+
Retrieves the update history of the datasource with ID 1234.
43+
```
44+
45+
### EXAMPLE 2
46+
```
47+
Get-LMDatasourceUpdateHistory -Name "MyDatasource"
48+
Retrieves the update history of the datasource with the name "MyDatasource".
4149
```
4250

43-
{{ Add example description here }}
51+
### EXAMPLE 3
52+
```
53+
Get-LMDatasourceUpdateHistory -DisplayName "My Datasource"
54+
Retrieves the update history of the datasource with the display name "My Datasource".
55+
```
4456

4557
## PARAMETERS
4658

4759
### -Id
48-
{{ Fill Id Description }}
60+
The ID of the datasource.
61+
This parameter is mandatory when using the 'Id' parameter set.
4962

5063
```yaml
5164
Type: Int32
@@ -54,13 +67,16 @@ Aliases:
5467

5568
Required: True
5669
Position: Named
57-
Default value: None
70+
Default value: 0
5871
Accept pipeline input: False
5972
Accept wildcard characters: False
6073
```
6174
6275
### -Name
63-
{{ Fill Name Description }}
76+
The name of the datasource.
77+
This parameter is used to look up the ID of the datasource.
78+
If the name is provided, the function will automatically retrieve the ID of the datasource.
79+
This parameter is used in the 'Name' parameter set.
6480
6581
```yaml
6682
Type: String
@@ -75,7 +91,10 @@ Accept wildcard characters: False
7591
```
7692
7793
### -DisplayName
78-
{{ Fill DisplayName Description }}
94+
The display name of the datasource.
95+
This parameter is used to look up the ID of the datasource.
96+
If the display name is provided, the function will automatically retrieve the ID of the datasource.
97+
This parameter is used in the 'DisplayName' parameter set.
7998
8099
```yaml
81100
Type: String
@@ -90,7 +109,9 @@ Accept wildcard characters: False
90109
```
91110
92111
### -Filter
93-
{{ Fill Filter Description }}
112+
A filter object that can be used to filter the results.
113+
The filter object should contain properties that match the properties of the datasource.
114+
Only datasources that match the filter will be included in the results.
94115
95116
```yaml
96117
Type: Object
@@ -105,7 +126,8 @@ Accept wildcard characters: False
105126
```
106127
107128
### -BatchSize
108-
{{ Fill BatchSize Description }}
129+
The number of results to retrieve in each batch.
130+
The default value is 1000.
109131
110132
```yaml
111133
Type: Int32
@@ -114,7 +136,7 @@ Aliases:
114136

115137
Required: False
116138
Position: Named
117-
Default value: None
139+
Default value: 1000
118140
Accept pipeline input: False
119141
Accept wildcard characters: False
120142
```
@@ -139,10 +161,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
139161
140162
## INPUTS
141163
142-
### None
143164
## OUTPUTS
144165
145-
### System.Object
146166
## NOTES
147167
148168
## RELATED LINKS

Logic.Monitor.Format.ps1xml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,59 @@
9595
</TableRowEntries>
9696
</TableControl>
9797
</View>
98+
<!-- New View LogicMonitor.ModuleUpdateHistory-->
99+
<View>
100+
<Name>LogicMonitorModuleUpdateHistory</Name>
101+
<ViewSelectedBy>
102+
<TypeName>LogicMonitor.ModuleUpdateHistory</TypeName>
103+
</ViewSelectedBy>
104+
<TableControl>
105+
<TableHeaders>
106+
<TableColumnHeader>
107+
<Label>id</Label>
108+
</TableColumnHeader>
109+
<TableColumnHeader>
110+
<Label>username</Label>
111+
</TableColumnHeader>
112+
<TableColumnHeader>
113+
<Label>timeStr</Label>
114+
</TableColumnHeader>
115+
<TableColumnHeader>
116+
<Label>timeEpoch</Label>
117+
</TableColumnHeader>
118+
<TableColumnHeader>
119+
<Label>clientIp</Label>
120+
</TableColumnHeader>
121+
<TableColumnHeader>
122+
<Label>updateReason</Label>
123+
</TableColumnHeader>
124+
</TableHeaders>
125+
<TableRowEntries>
126+
<TableRowEntry>
127+
<TableColumnItems>
128+
<TableColumnItem>
129+
<PropertyName>id</PropertyName>
130+
</TableColumnItem>
131+
<TableColumnItem>
132+
<PropertyName>username</PropertyName>
133+
</TableColumnItem>
134+
<TableColumnItem>
135+
<PropertyName>timeStr</PropertyName>
136+
</TableColumnItem>
137+
<TableColumnItem>
138+
<PropertyName>timeEpoch</PropertyName>
139+
</TableColumnItem>
140+
<TableColumnItem>
141+
<PropertyName>clientIp</PropertyName>
142+
</TableColumnItem>
143+
<TableColumnItem>
144+
<PropertyName>updateReason</PropertyName>
145+
</TableColumnItem>
146+
</TableColumnItems>
147+
</TableRowEntry>
148+
</TableRowEntries>
149+
</TableControl>
150+
</View>
98151
<!-- New View LogicMonitor.TopologyMap-->
99152
<View>
100153
<Name>LogicMonitorTopologyMap</Name>

Public/Get-LMAWSAccountId.ps1

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<#
2+
.SYNOPSIS
3+
Retrieves the AWS Account ID associated with the LogicMonitor account.
4+
5+
.DESCRIPTION
6+
The Get-LMAWSAccountId function is used to retrieve the AWS Account ID associated with the LogicMonitor account. It checks if the user is logged in and has valid API credentials. If the user is logged in, it builds the necessary headers and URI, and then sends a GET request to the LogicMonitor API to retrieve the AWS Account ID. The function returns the response containing the AWS Account ID.
7+
8+
.PARAMETER None
9+
This function does not have any parameters.
10+
11+
.EXAMPLE
12+
Get-LMAWSAccountId
13+
Retrieves the AWS Account ID associated with the LogicMonitor account.
14+
#>
15+
16+
Function Get-LMAWSAccountId {
17+
[CmdletBinding(DefaultParameterSetName = 'All')]
18+
Param ()
19+
20+
#Check if we are logged in and have valid api creds
21+
If ($Script:LMAuth.Valid) {
22+
23+
#Build header and uri
24+
$ResourcePath = "/aws/accountId"
25+
26+
Try {
27+
$Headers = New-LMHeader -Auth $Script:LMAuth -Method "GET" -ResourcePath $ResourcePath
28+
$Uri = "https://$($Script:LMAuth.Portal).logicmonitor.com/santaba/rest" + $ResourcePath + $QueryParams
29+
30+
Resolve-LMDebugInfo -Url $Uri -Headers $Headers[0] -Command $MyInvocation
31+
32+
#Issue request
33+
$Response = Invoke-RestMethod -Uri $Uri -Method "GET" -Headers $Headers[0] -WebSession $Headers[1]
34+
Return $Response
35+
}
36+
Catch [Exception] {
37+
$Proceed = Resolve-LMException -LMException $PSItem
38+
If (!$Proceed) {
39+
Return
40+
}
41+
}
42+
}
43+
Else {
44+
Write-Error "Please ensure you are logged in before running any commands, use Connect-LMAccount to login and try again."
45+
}
46+
}

0 commit comments

Comments
 (0)