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

Remove-RubrikUnmanagedObject does not work in 5.2 #671

Closed
dewbrik opened this issue Aug 4, 2020 · 1 comment · Fixed by #687
Closed

Remove-RubrikUnmanagedObject does not work in 5.2 #671

dewbrik opened this issue Aug 4, 2020 · 1 comment · Fixed by #687
Assignees
Labels

Comments

@dewbrik
Copy link

dewbrik commented Aug 4, 2020

When I run the cmdlet to remove snapshots for unmanaged object nothing happens.

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.


PS>Get-RubrikUnmanagedObject -Status Unprotected | ?{$_.id -eq "MssqlDatabase:::016a55fc-404e-492a-81cf-f91ad979f17d"} | Remove-RubrikUnmanagedObject -Verbose
VERBOSE: Validate the Rubrik token exists                                                                                                                                                                                                                                                                                                                                 VERBOSE: Found a Rubrik token for authentication                                                                                                                                                                                                                                                                                                                          VERBOSE: Gather API Data for Remove-RubrikUnmanagedObject                                                                                                                                                                                                                                                                                                                 VERBOSE: Gather API Data for Get-RubrikSoftwareVersion
VERBOSE: Selected 1.0 API Data for Get-RubrikSoftwareVersion
VERBOSE: Load API data for Get-RubrikSoftwareVersion
VERBOSE: Description: Retrieves software version of the Rubrik cluster
VERBOSE: Build the URI
VERBOSE: URI = https://10.10.10.10/api/v1/cluster/me/version
VERBOSE: Build the query parameters for <null>
VERBOSE: URI = https://10.10.10.10/api/v1/cluster/me/version
VERBOSE: Submitting the request
VERBOSE: GET https://10.10.10.10/api/v1/cluster/me/version with 0-byte payload
VERBOSE: received 27-byte response of content type application/json
VERBOSE: Received HTTP Status 200                                                                                                                                                                                                                                                                                                                                         VERBOSE: Formatting return value                                                                                                                                                                                                                                                                                                                                          VERBOSE: Filter the results                                                                                                                                                                                                                                                                                                                                               VERBOSE: Selected 1.0 API Data for Remove-RubrikUnmanagedObject
VERBOSE: Load API data for Remove-RubrikUnmanagedObject
VERBOSE: Description: Bulk delete all unmanaged snapshots for the objects specified by objectId/objectType pairings.
                                                                                                                                                                                                                                                                                                                                                                          Confirm                                                                                                                                                                                                                                                                                                                                                                   Are you sure you want to perform this action?                                                                                                                                                                                                                                                                                                                             Performing the operation "Remove Unmanaged Object and all snapshots" on target "MssqlDatabase:::016a55fc-404e-492a-81cf-f91ad979f17d".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y
VERBOSE: Build the URI
VERBOSE: URI = https://10.10.10.10/api/internal/unmanaged_object/snapshot/bulk_delete
VERBOSE: Build the query parameters for <null>
VERBOSE: URI = https://10.10.10.10/api/internal/unmanaged_object/snapshot/bulk_delete
VERBOSE: List of set parameters: [Verbose, True] [Type, MssqlDatabase] [id, MssqlDatabase:::016a55fc-404e-492a-81cf-f91ad979f17d]
VERBOSE: Build the body parameters
VERBOSE: Adding objectDefinitions...
VERBOSE: Body = {
  "objectDefinitions": [
    {
      "objectId": "MssqlDatabase:::016a55fc-404e-492a-81cf-f91ad979f17d",
      "objectType": "MssqlDatabase"
    }
  ]
}
VERBOSE: Submitting the request
VERBOSE: POST https://10.10.10.10/api/internal/unmanaged_object/snapshot/bulk_delete with 154-byte payload
VERBOSE: received -byte response of content type
VERBOSE: Received HTTP Status 204                                                                                                                                                                                                                                                                                                                                         VERBOSE: Formatting return value                                                                                                                                                                                                                                                                                                                                          VERBOSE: Filter the results

Expected Behavior:

Delete snapshots for unmanaged snapshot.

Steps to Reproduce:
Try to remove snapshots

Please provide detailed steps for reproducing the issue.

  1. Step 1
  2. Step 2
  3. Step 3 (and so on)

Context:
From looking at the API playground, this endpoint appears to have been replicated and a POST call with either an array of snapshot ids or object id needs to be passed to /v1/data_source is required.

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.0.1

  • PowerShell Version: Use $PSVersiontable.PSVersion
    7.0.3

  • Operating System: Use $PSVersiontable.PSVersion on PowerShell 6 and later, use (Get-WMIObject win32_operatingsystem).Name for Windows PowerShell
    macOS 10.15.6

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.

@jaapbrasser jaapbrasser self-assigned this Sep 8, 2020
@jaapbrasser
Copy link
Contributor

Good catch, this is indeed a new 5.2 endpoint, I've updated the internal Get-RubrikAPIData function with the appropriate endpoint going forward from 5.2.

image

Thanks for reporting this @dewbrik!

jaapbrasser added a commit that referenced this issue Sep 8, 2020
jaapbrasser added a commit that referenced this issue Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants