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

New API Token cmdlets #317

merged 9 commits into from Jun 26, 2019


None yet
3 participants
Copy link

commented Jun 25, 2019


I would like to be able to programmatically request a new API Token as part of an automated workflow for token rotation.

Related Issue

Fixes #316

Motivation and Context

Even though a user can generate a new API Token using the GUI, there exists the need to rotate those tokens on a regular basis. This can be done through regular expiration / creation cycles, or by forcing an expiration of a token arbitrarily and creating a new token on demand.

How Has This Been Tested?

  • Tested against CDM 5.0 with several variety of API Tokens generated with different tags, expiration dates, and organizations.
  • Tested with Pester to ensure null and empty parameters are handled properly.

Screenshots (if appropriate):

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)


Go over all the following points, and put an x in all the boxes that apply. If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTION document.
  • I have updated the CHANGELOG file accordingly for the version that this merge modifies.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

chriswahl added some commits Jun 25, 2019

Create New-RubrikAPIToken function
Signed-off-by: Chris Wahl <>
Create Remove-RubrikAPIToken function
Signed-off-by: Chris Wahl <>
Add test for New-RubrikAPIToken
Signed-off-by: Chris Wahl <>
Add test for Remove-RubrikAPIToken
Signed-off-by: Chris Wahl <>
Add confirm prompt to removal of token
Signed-off-by: Chris Wahl <>
Update changelog
Signed-off-by: Chris Wahl <>

@chriswahl chriswahl changed the title Api token New API Token cmdlets Jun 25, 2019


This comment has been minimized.

Copy link
Member Author

commented Jun 25, 2019

This cmdlet is only supported in 5.0 (new feature). Because of this, it appears that Pester tests for the Get-RubrikAPIData function are failing since there is no compatibility with 4.0, 4.1, and 4.2.

@chriswahl chriswahl self-assigned this Jun 25, 2019

@chriswahl chriswahl added the area-rcdm label Jun 25, 2019

@mwpreston mwpreston self-requested a review Jun 26, 2019

Copy link

left a comment

@jaapbrasser - I'm not sure if we can exclude different api version from the pester tests on the Get-RubrikAPIData cmdlet? Either way, other than that this code looks good to me... I'll leave the merge to you :)

@jaapbrasser jaapbrasser self-requested a review Jun 26, 2019

Copy link

left a comment

Reviewed, looks good thanks for the work here @chriswahl & @mwpreston

@jaapbrasser jaapbrasser merged commit 99829e1 into master Jun 26, 2019

2 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
continuous-integration/appveyor/pr AppVeyor build succeeded

@jaapbrasser jaapbrasser deleted the api-token branch Jun 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.