Skip to content

Commit

Permalink
Merge pull request #585 from rubrikinc/mwpreston-issue580
Browse files Browse the repository at this point in the history
Issue 580 - Get-RubrikEventSeries
  • Loading branch information
jaapbrasser authored Mar 15, 2020
2 parents 88da002 + a42bef7 commit 5042f2e
Show file tree
Hide file tree
Showing 8 changed files with 585 additions and 193 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
* Updated `Get-RubrikAPIData` with formatted objecttypes for `New-RubrikSLA` and `Set-RubrikSLA`
* Updated `New-RubrikSLA` and `Set-RubrikSLA` functions to add type names and decorate output similar to `Get-RubrikSLA`
* Error handing in private function `Get-RubrikAPIData`, now displays error when no matching endpoint is found.
* Changed `Get-RubrikEvent`, adding parametersets to isolate eventSeriesId. When cmdlet is called with eventSeriesId the `Get-RubrikEventSeries` cmdlet is now called rather than filtering through a giant, unindexed table. Details in [Issue 580](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/580)

### Added

* Added `Suspend-RubrikSLA` and `Resume-RubrikSLA`
* Added `Get-RubrikEventSeries` to now parse the event_series API rather than events as per [Issue 580](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/580)
* Added unit tests to cover `Get-RubrikEventSeries` and changes to `Get-RubrikEvent`

## [5.0.1](https://github.com/rubrikinc/rubrik-sdk-for-powershell/tree/5.0.1) - 2020-03-05

Expand Down
103 changes: 103 additions & 0 deletions Rubrik/ObjectDefinitions/Rubrik.EventSeries.ps1xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8" ?>
<Configuration>
<ViewDefinitions>
<View>
<Name>Default</Name>
<ViewSelectedBy>
<TypeName>Rubrik.EventSeriesById</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>Time</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Status</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Task Type</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Object Location</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Number of Events</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>endTime</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>status</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>taskType</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>location</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>total</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>Default</Name>
<ViewSelectedBy>
<TypeName>Rubrik.EventSeries</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>Time</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Status</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Object Type</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Object Location</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Event Id</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Event Series Id</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>eventDate</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>status</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>taskType</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>location</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>eventId</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>eventSeriesId</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
</ViewDefinitions>
</Configuration>
39 changes: 29 additions & 10 deletions Rubrik/Private/Get-RubrikAPIData.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function Get-RubrikAPIData {
Body = @{
exportMode = 'exportMode'
networksToRestore = [System.Collections.ArrayList]@()
vmsToExport = @(
vmsToExport = @(
@{
name = 'name'
vcdMoid = 'vcdMoid'
Expand Down Expand Up @@ -186,7 +186,7 @@ function Get-RubrikAPIData {
Success = '200'
ObjectTName = 'Rubrik.APIToken'
}
}
}
'Get-RubrikAPIVersion' = @{
'1.0' = @{
Description = 'Retrieves software version of the Rubrik cluster'
Expand All @@ -206,7 +206,7 @@ function Get-RubrikAPIData {
Method = 'Get'
Body = ''
Query = @{
'ArchiveType' = 'location_type'
'ArchiveType' = 'location_type'
}
Result = 'data'
Filter = @{
Expand Down Expand Up @@ -484,6 +484,25 @@ function Get-RubrikAPIData {
ObjectTName = 'Rubrik.Event'
}
}
'Get-RubrikEventSeries' = @{
'5.0' = @{
Description = 'Retrieve information for event series within Rubrik.'
URI = '/api/internal/event_series'
Method = 'Get'
Body = ''
Query = @{
status = 'status'
event_type = 'event_type'
object_ids = 'object_ids'
object_name = 'object_name'
object_type = 'object_type'
}
Result = 'data'
Filter = ''
Success = '200'
ObjectTName = 'Rubrik.EventSeries'
}
}
'Get-RubrikFileset' = @{
'1.0' = @{
Description = 'Retrieve summary information for each fileset. Optionally, filter the retrieved information.'
Expand Down Expand Up @@ -595,7 +614,7 @@ function Get-RubrikAPIData {
Result = 'data'
Filter = @{
id = 'id'
vmId = 'vmId'
vmId = 'vmId'
}
Success = '200'
}
Expand Down Expand Up @@ -746,7 +765,7 @@ function Get-RubrikAPIData {
Result = 'data'
Filter = @{
id = 'id'
vmId = 'vmId'
vmId = 'vmId'
}
Success = '200'
}
Expand Down Expand Up @@ -1944,7 +1963,7 @@ function Get-RubrikAPIData {
replicationSpecs = @{
locationId = 'locationId'
retentionLimit = 'retentionLimit'
}
}
}
Query = ''
Result = ''
Expand Down Expand Up @@ -1991,7 +2010,7 @@ function Get-RubrikAPIData {
replicationSpecs = @{
locationId = 'locationId'
retentionLimit = 'retentionLimit'
}
}
}
Query = ''
Result = ''
Expand Down Expand Up @@ -2187,7 +2206,7 @@ function Get-RubrikAPIData {
Result = ''
Filter = ''
Success = '204'
}
}
}
'Remove-RubrikAPIToken' = @{
'5.0' = @{
Expand Down Expand Up @@ -2348,7 +2367,7 @@ function Get-RubrikAPIData {
Result = 'data'
Filter = ''
Success = '200'
}
}
'5.1' = @{
Description = 'Revokes an organization authorization for principal(s)'
URI = '/api/internal/authorization/role/organization'
Expand Down Expand Up @@ -3302,7 +3321,7 @@ function Get-RubrikAPIData {
} else {
Write-Verbose -Message "Selected $key API Data for $endpoint"
# Add the function name to resolve issue #480
$api.$endpoint.$key.Add('Function',$endpoint)
$api.$endpoint.$key.Add('Function',$endpoint)
return $api.$endpoint.$key
}
} # End of function
Loading

0 comments on commit 5042f2e

Please sign in to comment.