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

Get-RubrikSnapshot by snapshot id #743

Closed
sam-bryant opened this issue Apr 8, 2021 · 3 comments · Fixed by #746
Closed

Get-RubrikSnapshot by snapshot id #743

sam-bryant opened this issue Apr 8, 2021 · 3 comments · Fixed by #746

Comments

@sam-bryant
Copy link

Summary

I'm trying to retrieve data on a specific snapshot. I already have the snapshot id, so I'd like to query on this directly rather than passing in the object the snapshot is associated with.

Desired solution

Get-RubrikSnapshot -SnapshotId 1234

Current workaround

Invoke-RubrikRESTCall -Endpoint "mssql/db/snapshot/1234" -Method GET

Let me know if I can provide any additional information.
Thanks,
Sam

@jaapbrasser
Copy link
Contributor

jaapbrasser commented Apr 8, 2021

Hi Sam, thanks for reporting this, I've given it some thought and this is what I came up with.

I would be looking at implementing it like this, specifying the snapshot type and the snapshot id, similar to how Get-RubrikRequest works, where you can specify the request type:

Get-RubrikSnapshot -SnapshotId 1234 -SnapshotType vmware/vm

&

Get-RubrikSnapshot -SnapshotId 1234

Would that be a workable solution, it will provide the option to either specify the endpoint manually, or by having the cmdlet determine the snapshot type by querying all the snapshot endpoints, which would mean the cmdlet will query all the snapshot endpoints in order to determine what type of object is protected by the cmdlet.

What do you think?

@sam-bryant
Copy link
Author

Hi Jaap,

That solution sounds fine to me.

Thanks!
Sam

jaapbrasser added a commit that referenced this issue Apr 11, 2021
jaapbrasser added a commit that referenced this issue Apr 11, 2021
@jaapbrasser
Copy link
Contributor

Hello @sam-bryant,

I've taken a stab at the code, it's available in the jaap-snapshot branch and queued for review in PR #746.

Let me know what you think!

Regards,

Jaap

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

Successfully merging a pull request may close this issue.

2 participants