Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 580 - Get-RubrikEventSeries #585

Merged
merged 12 commits into from
Mar 15, 2020
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,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 Expand Up @@ -151,9 +154,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
* Changed the output of the user agent string to display platform information with double-dashed separated key-value pairs.
* The link to `quick-start.md` in the `readme.md` has been updated to a relative link
* The private function `Test-RubrikSLA` had a hard coded local variable
* Renamed Get-RubrikVAppExportOptions to `Get-RubrikVAppExportOption` to use singular nouns
* Renamed Get-RubrikVAppRecoverOptions to `Get-RubrikVAppRecoverOption` to use singular nouns
* Renamed Get-RubrikVcdTemplateExportOptions to `Get-RubrikVcdTemplateExportOption` to use singular nouns
* Renamed Get-RubrikVAppExportOptions to `Get-RubrikVAppExportOption` to use singular nouns
* Renamed Get-RubrikVAppRecoverOptions to `Get-RubrikVAppRecoverOption` to use singular nouns
* Renamed Get-RubrikVcdTemplateExportOptions to `Get-RubrikVcdTemplateExportOption` to use singular nouns
* Changed [parameter type from boolean to switch] for all functions
* Modified private function Submit-Request.ps1 to support adding in success/error information for empty POST, PUT and PATCH responses
* Modified status return code for Remove-RubrikManagedObject
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