Hi, I was wondering, where is the API call hidden to make an existing VM managed through an API call?
In the UI, I usually go to: Infrastructure > Clouds > “selected cloud” > VMs > +Virtual Machine > Linux VM.
I fill in the wizard with name, description, ssh host, ssh user and ssh password.
Once this is done I select the newly added VM and then go to Actions > Convert to Managed
I am looking to write an API call for this, can this be done?
Thanks in advance.
Thanks Chris for pointing to the hosts section.
I also needed the POST API call to add it to the system when ‘inventory instances’ is not enabled on the cloud. (Which returns the server id upon completion) I did notice that the “computeServerType” is required on this call.
I used 1, which is a blank vm type. When installing the agent it seems to push the type to a correct one, example: ‘Managed Linux Server’.
If I use 203 (code: vmwareVm, name: VMware Linux VM), which would be the appropriate one for this VM, the UI complains no image found.
curl -XPOST $IP/api/servers \
-H "Authorization: BEARER $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"server": {
"sshUsername": "myusername",
"sshPassword": "mypassword",
"sshHost": "10.5.1.1",
"name": "test",
"zone": {"id":3},
"computeServerType": {"id":1},
},
}
'
Kind regards,