- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Horizon REST Call: /inventory/v1/desktop-pools/{id}/action/add-machines
Making a call and I have the pool ID correct and post the body in JSON:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should be only passing an array of machine ids to add to the pool. You appear to be posting user details?
https://developer.vmware.com/apis/1169#/Inventory/addMachines
Senior Staff Architect, EUC Technical Marketing
chalstead@vmware.com
Twitter: @chrisdhalstead
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How about add-machines-by-name:
/inventory/v1/desktop-pools/{id}/action/add-machines-by-name
That's actually what I was trying first. I don't see any other calls that can do the user assignment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you looking to entitle manual pools or automated pools?
Senior Staff Architect, EUC Technical Marketing
chalstead@vmware.com
Twitter: @chrisdhalstead
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
it's a manual persistent pool. Users have been connecting to these desktops remotely over vpn/rdp and want to keep the desktop but start using Horizon. They are entitled to the pool by group but I want to add the machine and assign a user to a specific machine because that's where their profiles and apps are.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Got it - let me see if there is a REST API for that. It may only be available with PowerCLI
Senior Staff Architect, EUC Technical Marketing
chalstead@vmware.com
Twitter: @chrisdhalstead
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This endpoint should do it:
/inventory/v1/machines/{id}/action/assign-users
Senior Staff Architect, EUC Technical Marketing
chalstead@vmware.com
Twitter: @chrisdhalstead
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just tried the add-machines call and that is complaining that the machine is not found in the VC:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It should be this endpoint:
/inventory/v1/machines/{id}/action/assign-users
You need to get the machine ID from: /inventory/v1/machines
Senior Staff Architect, EUC Technical Marketing
chalstead@vmware.com
Twitter: @chrisdhalstead
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That does return list of machines, but only ones that are already registered in pools.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you trying to add physical machines with the Horizon Agent to a manual pool and then assign users to it? What type of machine are you trying to add to the manual pool?
Senior Staff Architect, EUC Technical Marketing
chalstead@vmware.com
Twitter: @chrisdhalstead
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
VMWare VMs in vcenter the connection servers are connected to
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ok make sure the VMs have a Horizon Agent installed.
Where do you see these machines in the Horizon console today?
Are they under Inventory | Machines
or
Settings | Registered Machines
Senior Staff Architect, EUC Technical Marketing
chalstead@vmware.com
Twitter: @chrisdhalstead
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Agent is installed. The machines don't show in Inventory or Registered machines. I can Add from GUI so I am looking for the REST call to replicate that GUI function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
what GUI are you talking about? The Horizon console?
Are you talking about adding vCenter machines into a manual pool this way?
Senior Staff Architect, EUC Technical Marketing
chalstead@vmware.com
Twitter: @chrisdhalstead
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Says I do not have perms to upload images. Desktops -> manual pool -> add
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have the registration working but assigning users is failing
$desktop = Invoke-RestMethod "$($connectionservers)/rest/external/v1/virtual-machines?vcenter_id=$($vcenter_id)" -Method 'GET' -Headers $headers
$desktop = $desktop | where-object {$_.name -eq $computer}
$pools = Invoke-RestMethod "$($connectionservers)/rest/inventory/v1/desktop-pools" -Method 'GET' -Headers $headers
$pool_id = ($pools | Where-Object {$_.name -like $pool}).id
$desktopJ = "[
$($desktop.id | ConvertTo-Json)
]"
$machineRegister = Invoke-RestMethod "$($connectionservers)/rest/inventory/v1/desktop-pools/$($pool_id)/action/add-machines" -Method "POST" -Headers $headers -Body ($desktopJ)
Invoke-RestMethod "$($connectionservers)/rest/inventory/v1/machines/$($machineRegister.id)/action/assign-users" -Method "POST" -Body "[`"XXXXXXXXXXXXXXXXXXXXX`"]"Invoke-RestMethod:
VMware Horizon
function toggleError()
{
var errorElement = document.getElementById('errorDetails');
if (errorElement && errorElement.style.display == 'none')
{
errorElement.style.display="block";
}
else
{
errorElement.style.display="none";
}
}
function escapeHTML (str)
{
var div = document.createElement('div');
var text = document.createTextNode(str);
div.appendChild(text);
return div.innerHTML;
}
Error: Unsupported Media Type
The page you requested is not available.
var url = escapeHTML(location.href);
if (url.indexOf("http:") == 0 && 415 == "404") {
document.write(" Try HTTPS instead.");
}
Show Details
Error code: 415
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you get this to work? I am in a similar situation - need to add VMs to manual desktop and couldn't figure out where to get the machineID, as the VMs are not registered yet to any pools.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
do you find a solution? I've got the same problem. ![]()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you need to get the machine id from /external/v1/virtual-machines
Previously known as Magneet or Magneet_NL, does things with Horizon api's, see www.retouw.nl