Hello,
I'm having some issues try to create a session and then creating a backup with the rest api through powershell. Below is my code, can anyone see what I'm doing wrong? Appreciate any advice!
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12$user = 'austin.luu91@gmail.com'$pass = #API Token$pair = "$($user):$($pass)"$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))$basicAuthValue = "Basic $encodedCreds"$Headers = @{Authorization = $basicAuthValue}Invoke-WebRequest -UseBasicParsing -Method Post -Uri "https://15sof1.atlassian.net/rest/auth/1/session" -Headers $headers -SessionVariable session -ContentType 'application/json'$InitiateBackup = Invoke-RestMethod -Method Post -Headers @{"Accept"="application/json"} -Uri "https://15sof1.atlassian.net/rest/backup/1/export/runbackup" -WebSession $session -ContentType 'application/json' -Body $bodyjson -Verbose | ConvertTo-Json -Compress | Out-Null
Hello Austin,
We do have a PowerShell script which can be used to backup cloud instances. This script is within Bitbucket and is publicly viewable. Please take a look at the following (You’ll need to add the top variables to your script to make it work).
If you have any issues with this script, please let us know.
Regards,Stephen Sifers
Worked like a charm, thanks for your help!
can you send me the backup.ps1 ??
jabr.zakaria@gmail.com
merci
Hi the script mentioned above via link is not available now. can you please share that gain
Thanks
Chandra
Hello Everyone,
We did rename the files used within the scripts to better clarify what products they work with. Since we did that it broke the link above. I have corrected the link above and you should be able to see the available backup scripts by their product now.
It looks like you're new here. Sign in or register to get started.