Workspace-Guru

provisionappvolume

Oct 13th, 2018
4,468
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $App_server = "Seq-prod-01"                 ## Name of the Seqeuncer server on which we install the applications and create the layers
  2. $App_name = 'Firefox'                       ## Application name
  3.  
  4. ### Get new app volume GUID
  5. $App = ((Invoke-WebRequest -WebSession $Login -Method get -Uri "http://$server/cv_api/appstacks").content | convertFrom-Json) | Where-Object {$_.name -eq $App_name}
  6. $Appid = $App.id
  7.  
  8. ### Get provisioning server ID
  9. $Provisioner = ((Invoke-WebRequest -WebSession $Login -Method get -Uri "http://$server/cv_api/machines").content | convertFrom-Json).Machines | Where-Object {$_.name -eq $App_server}
  10. $Provisionerid = $Provisioner.id
  11. $Provisioneruuid = $Provisioner.identifier
  12.  
  13. ### Start Provisioning
  14. start-sleep 10
  15. Invoke-WebRequest -WebSession $Login -Method Post -Uri "http://$server/cv_api/provisions/$Appid/start?computer_id=$Provisionerid&uuid=$Provisioneruuid" | out-null
  16. start-sleep 15
Advertisement
Add Comment
Please, Sign In to add comment