Jump to content

Recommended Posts

Posted

In the on-premises version of Horizon, we have the luxury of having the PowerCLI module to automate the infrastructure. This was particularly helpful when you have to publish dozens of manual applications.

Is there anyway to extend this functionality to the cloud version? The current PowerCLI connections require a connection server, which we don't have in the cloud version. Is there a fast way to publish and assign 50ish manual applications quickly?

Thx,

Dan

  • Like 1
Posted

Thanks for the reply. I was aware of the API documentation. I am not a developer, so I was hoping for an example of how to leverage the API with PowerShell

  • Solution
Posted

Hopefully this will help someone in the future. I found this article that had an example of how to access the REST API from PowerShell:

https://techzone.omnissa.com/blog/getting-started-horizon-cloud-service-next-gen-supported-rest-apis-powershell

Here is a basic script that I have that will return information on the pools:

 

#Authenticate
$Url = "https://connect.omnissa.com/csp/gateway/am/api/auth/api-tokens/authorize"
$APIToken = "YOUR API TOKEN HERE" #Expires every 6 months
$params = @{refresh_token = $APIToken}
$Connection = Invoke-WebRequest $url -Method Post -Body $params -UseBasicParsing | ConvertFrom-Json
$Token = $Connection.access_token

#Setup Headers
$Headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$Headers.Add("Authorization", "Bearer $Token")
$Headers.Add("Accept","application/json, text/plain, */*")

#Get Pool Data
$Url = "https://cloud.vmwarehorizon.com/portal/v2/pools"
$Pools = Invoke-WebRequest $url -Method Get -Headers $Headers -UseBasicParsing | ConvertFrom-Json
$pools.content | Select name,DisplayName,Type

It's disappointing that the code insertion feature of this forum doesn't support PowerShell 😞

As stated above, here is the link to the full REST API documentation:

https://developer.omnissa.com/horizon/apis/horizon-cloud-nextgen/#api

Hope that helps

  • Like 2
  • 2 months later...
Posted
2 minutes ago, Dan White said:

Hi Sean, 

I appreciate the response but that site doesn't have the actual API documentation of which Methods are available and how to use them.

I see them when I scroll down that page I linked above.

image.thumb.png.8b3b61be382538bda0dc12792b180539.png

Sean Massey
Independent Consultant/Analyst/Blogger | VCDX-EUC 247
Vice Chairman of the Board - World of EUC
Blog: thevirtualhorizon.com  Mastodon: @seanpmassey@vmst.io Instagram/Thread:
@seanpmassey LI: https://www.linkedin.com/in/seanpmassey/

  • 2 weeks later...
Posted (edited)

@Dan White

I'm a bit late to the party, but here is also a getting started blog that I created a while ago. It contains links to various chapters.

VMware Horizon Cloud Service Next-Gen - The Automation Series - Intro - IVANDEMES

Edited by Ivan de Mes

Ivan de Mes

EUC Architect @ Orange Business (The Netherlands netherlands-flag-png-xl.thumb.jpg.a1943fcb7e938a63e1191aae2aa31568.jpg)
EUC Expert | vExpert | Blogger | Public Speaker | Part of the Dutch vEUC TechCon leadership team

Blog: https://ivandemes.com | X: @ivandemes | LinkedIn: ivandemes

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...