Do you mind sharing what the JSON body looks like to clone a VM to OVF in the content library? I'm struggling to get it right. This is what I've attempted, but guessing I'm not specifying one of the values corrctly.
{
"create_spec": {
"description": "vratst01 test template",
"flags": [ "" ],
"name": "vratst02"
},
"source":{
"id": "vm-<removed>",
"type": "vc:virtualmachine" also VM, vm virtual machine, virtualmachine vcvirtualmachine
},
"target":{
"library_id": "<lib id removed>"
}
}
------------------------------
vixold
------------------------------
Original Message:
Sent: Apr 15, 2019 06:31 AM
From: Misofni
Subject: REST override or delete library item
Hi,
currently I'am testing around with the vSphere REST API in my evaluation trial.
I try to automatically create a template of an existing VM and then deploy a clone of this template on a weekly basis.
Creating this template and deploying is straight forward with the REST API. However, deleting an existing template, or at least overriding it, didn't work so far.
So the question is:
Is there a way of either override an existing template OR delete an exisitng template via the REST API?
I used the following REST calls:
For creating (POST): /vcenter/vm-template/library-items
For deploy (POST): /vcenter/vm-template/library-items/{item}?action=deploy
I would appreciate any support.
BR