Skip to content

Commit

Permalink
Search-TssEventPipeline - switched endpoint to summaries
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmelton committed Aug 2, 2021
1 parent 76f5092 commit 5f3b046
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 103 deletions.
2 changes: 1 addition & 1 deletion docs/commands/event-pipeline/Search-TssEventPipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### Thycotic.PowerShell.EventPipeline.List
### Thycotic.PowerShell.EventPipeline.Summary
## NOTES
Requires TssSession object returned by New-TssSession
Expand Down
47 changes: 47 additions & 0 deletions src/Thycotic.SecretServer.Format.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -2287,5 +2287,52 @@
</TableControl>
</View>


<!-- Thycotic.PowerShell.EventPipeline.Summary -->
<View>
<Name>EventPipeline.Summary</Name>
<ViewSelectedBy>
<TypeName>Thycotic.PowerShell.EventPipeline.Summary</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader />
<TableColumnHeader />
<TableColumnHeader />
<TableColumnHeader />
<TableColumnHeader />
<TableColumnHeader />
<TableColumnHeader />
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>EventPipelinePolicyId</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>EventEntityType</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>EventPipelineId</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>EventPipelineName</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>CreatedDate</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>LastModifiedDate</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>LastModifiedDisplayName</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>

</ViewDefinitions>
</Configuration>
9 changes: 9 additions & 0 deletions src/Thycotic.SecretServer.Types.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,13 @@
</AliasProperty>
</Members>
</Type>
<Type>
<Name>Thycotic.PowerShell.EventPipeline.Summary</Name>
<Members>
<AliasProperty>
<Name>EventEntityType</Name>
<ReferencedMemberName>EventEntityTypeId</ReferencedMemberName>
</AliasProperty>
</Members>
</Type>
</Types>
24 changes: 24 additions & 0 deletions src/Thycotic.SecretServer/classes/event-pipeline/Summary.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Threading.Tasks;
using System.Management.Automation;
using System.Management.Automation.Runspaces;
using Thycotic.PowerShell.Enums;

namespace Thycotic.PowerShell.EventPipeline
{
public class Summary
{
public bool Active { get; set; }
public DateTime? CreatedDate { get; set; }
public EventEntityType EventEntityTypeId { get; set; }
public string EventPipelineDescription { get; set; }
public int EventPipelineId { get; set; }
public string EventPipelineName { get; set; }
public int EventPipelinePolicyId { get; set; }
public int EventPipelinePolicyMapId { get; set; }
public bool IsSystem { get; set; }
public DateTime? LastModifiedDate { get; set; }
public string LastModifiedDisplayName { get; set; }
public int SortOrder { get; set; }
}
}
6 changes: 3 additions & 3 deletions src/functions/event-pipeline/Search-TssEventPipeline.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function Search-TssEventPipeline {
Requires TssSession object returned by New-TssSession
#>
[CmdletBinding()]
[OutputType('Thycotic.PowerShell.EventPipeline.List')]
[OutputType('Thycotic.PowerShell.EventPipeline.Summary')]
param (
# TssSession object created by New-TssSession for authentication
[Parameter(Mandatory,ValueFromPipeline,Position = 0)]
Expand Down Expand Up @@ -70,7 +70,7 @@ function Search-TssEventPipeline {
if ($tssParams.ContainsKey('TssSession') -and $TssSession.IsValidSession()) {
. $CheckVersion $TssSession '10.9.000000' $PSCmdlet.MyInvocation
$restResponse = $null
$uri = $TssSession.ApiUrl, 'event-pipeline', 'list' -join '/'
$uri = $TssSession.ApiUrl, 'event-pipeline', 'summaries' -join '/'
$uri = $uri, "sortBy[0].direction=asc&sortBy[0].name=$SortBy&take=$($TssSession.Take)" -join '?'

$filters = @()
Expand Down Expand Up @@ -102,7 +102,7 @@ function Search-TssEventPipeline {
}

if ($restResponse.records) {
. $SearchEventPipelineList $restResponse.records
[Thycotic.PowerShell.EventPipeline.Summary[]]$restResponse.records
} else {
Write-Warning "No valid session found"
}
Expand Down
99 changes: 0 additions & 99 deletions src/parts/SearchEventPipelineList.ps1

This file was deleted.

0 comments on commit 5f3b046

Please sign in to comment.