rubrik-sdk-for-powershell
rubrik-sdk-for-powershell copied to clipboard
Get-RubrikEvent is not filtering properly for EventStatus Running
Current Behavior:
When I issue the Get-RubrikEvent command with -Status Running, it also returns items with status Success, Queued.
I only want to see the Running jobs, as I would do a | where eventstatus -eq "Running"
Provide information about the failure by issuing the command using the -Verbose
command. Ensure that any identifiable information (server names, tokens, passwords) is removed from your logs before sharing this on GitHub.
Get-RubrikEvent -Limit 100 -EventType Backup -Status Running -Verbose
VERBOSE: Validate the Rubrik token exists
VERBOSE: Found a Rubrik token for authentication
VERBOSE: Gather API Data for Get-RubrikEvent
VERBOSE: Selected 5.2 API Data for Get-RubrikEvent
VERBOSE: Load API data for Get-RubrikEvent
VERBOSE: Description: Retrieve information for the latest of related events that match the value specified in any of the following categories: type, status, or ID, and limit events by date.
VERBOSE: Build the URI
VERBOSE: URI = https://<server>/api/v1/event/latest
VERBOSE: Build the query parameters for limit,should_include_event_series,object_type,object_ids,object_name,event_type,before_date,event_series_id,after_date,status,after_id
VERBOSE: URI = https://<server>/api/v1/event/latest?limit=100&should_include_event_series=False&event_type=Backup&status=Running
VERBOSE: Submitting the request
VERBOSE: Invoking request with a custom timeout of 300 seconds
VERBOSE: GET https://<server>/api/v1/event/latest?limit=100&should_include_event_series=False&event_type=Backup&status=Running with 0-byte payload
VERBOSE: received 93169-byte response of content type application/json
VERBOSE: Received HTTP Status 200
VERBOSE: Applying Rubrik.Event.5.2 TypeName to results
Time Status Object Type Object Name ID
---- ------ ----------- ----------- --
27/11/2020 06:00:48 Warning LinuxFileset MOLE_DB 74ee01b4-11e6-4e1d-82a8-4aacc9c048cc
27/11/2020 04:18:48 Queued LinuxFileset DROracleDB_Prod 237ba640-bf02-42e0-9233-5c335970b93a
27/11/2020 04:18:47 Success LinuxFileset DROracleDB_Prod a66dfa0e-7bf4-486d-90c9-8527e53e6fcd
27/11/2020 03:56:08 Queued LinuxFileset DROracleDB_Prod 918bb4ec-4551-454e-88d8-9c08346e8813
Expected Behavior: only return items with status "Running"
Steps to Reproduce:
Please provide detailed steps for reproducing the issue.
Get-RubrikEvent -Limit 100 -EventType Backup -Status Running
Context:
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
-
Rubrik PowerShell Module Version: Use
Get-Module -ListAvailable Rubrik
5.2.0 -
PowerShell Version: Use
$PSVersiontable.PSVersion
7.1.0 -
Operating System: Use
$PSVersiontable.PSVersion
on PowerShell 6 and later, use(Get-WMIObject win32_operatingsystem).Name
for Windows PowerShell
Failure Logs
Please include any relevant log snippets or files here, IMPORTANT all information will be visible publicly on GitHub. Do not include computer or user names, passwords, API tokens or any identifiable information when submitting failure logs.
Thanks for reporting this @JanosPesti, I'll take a look at what is causing this behavior so we can resolve this
Hi @jaapbrasser an addition to this:
If I run Get-RubrikEvent -Status Running
it lists all running jobs correctly.
If I run Get-rubrikevent -Status Running -EventType Backup
or -EventType Replication
for example, I get back an error
VERBOSE: Validate the Rubrik token exists
VERBOSE: Found a Rubrik token for authentication
VERBOSE: Gather API Data for Get-RubrikEvent
VERBOSE: Selected 5.2 API Data for Get-RubrikEvent
VERBOSE: Load API data for Get-RubrikEvent
VERBOSE: Description: Retrieve information for the latest of related events that match the value specified in any of the following categories: type, status, or ID, and limit events by date.
VERBOSE: Build the URI
VERBOSE: URI = https://<clustername>/api/v1/event/latest
VERBOSE: Build the query parameters for object_type,event_status,event_series_id,limit,object_name,event_type,before_date,after_date,after_id,object_ids,event_series_status
VERBOSE: URI = https://<clustername>/api/v1/event/latest?event_status=Running&limit=50&event_type=Backup
VERBOSE: Submitting the request
VERBOSE: Invoking request with a custom timeout of 300 seconds
VERBOSE: GET https://<clustername>/api/v1/event/latest?event_status=Running&limit=50&event_type=Backup with 0-byte payload
Invoke-WebRequest : An I/O error occurred while sending to the backend.
At C:\Program Files\WindowsPowerShell\Modules\Rubrik\5.3.1\Private\Invoke-RubrikWebRequest.ps1:36 char:23
+ ... $result = Invoke-WebRequest -UseBasicParsing -TimeoutSec $rubrikOpt ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
so it seems that specifying EventType
breaks it.