Ahhh finally I answer to myself :-)
I have to use “Update an existing VM” (put /vms/{uuid})
and the difficulty for me was to understand what I need to pass for the request payload/body
I need to specify a JSON with the current SPEC of the VM + the metadata with category list
{
"spec": {
< every thing of current vm >
},
"metadata": {
"kind": "vm"
"uuid": <VM UUID>,
"spec_version": 3,
"categories_mapping": {
"ABC1": g
"abc_1_1"
],
"TEST2": 1
"test1"
]
},
"categories": {
"ABC1": "abc_1_1",
"TEST2": "test1"
}
}
}
Not so easy to do but it was ok at the end
Regards
Good to heard you found what you were looking for. In case you want to know more about Nutanix APIs and get familiar on how to use them, you have several blog posts in our Nutanix.dev website.