- Community Home
- >
- Storage
- >
- HPE Nimble Storage
- >
- Application Integration
- >
- Cannoit change Encryption Passphrase through REST ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2019 08:00 AM
05-02-2019 08:00 AM
Cannoit change Encryption Passphrase through REST API
When I attempt to change my Encryption Passphrase through the rest API I keep getting "The remote server returned an error: (401) Unauthorized." Below is the commands im running to attempt to update the passphrase. If I am reading/understanding the REST API documentation (https://infosight.hpe.com/InfoSight/media/cms/active/public/pubs_REST_API_Reference_NOS_51x.whz/qyk1480349012860.html) all I need to submit to update the passphrase is the ID of the master key, the current passphrase and the new passphrase. Any help would be appericated.
# Get the Token to connect to the Nimble
$data = @{
username = $username
password = $password
}
$body = convertto-json (@{ data = $data })
$uri = "https://" + $nimblearray + ":5392/v1/tokens"
$nimbleToken = try {
Invoke-RestMethod -Uri $uri -Method Post -Body $body
}
catch
{
throw "Nimble - Couldn't connect to $nimblearray"
}
if ($nimbleToken -ne $null)
{
$token = $nimbleToken.data.session_token
}
# Get the information about the user you need to change
$header = @{"X-Auth-Token" = $token}
$uri = "https://" + $nimblearray + ":5392/v1/master_key"
$keyList = Invoke-RestMethod -Uri $uri -Method Get -Header $header
$data = @{
id = $keyList.data.id
passphrase = $passphrase
new_passphrase = $new_passphrase
}
$body = convertto-json (@{ data = $data })
$uri = "https://" + $nimblearray + ":5392/v1/master_key/" + $keyList.data.id
Invoke-RestMethod -Uri $uri -Method Put -Body $body -Headers $header
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2019 08:15 AM
05-02-2019 08:15 AM
Re: Cannoit change Encryption Passphrase through REST API
well my issue was with special characters and storing the intial passphrase in a double quotes string vs a single quotes string in my testing. my commands below worked once i fixed the special characters.