Solved

Delete manually added VMs from content via api

  • 13 May 2024
  • 1 reply
  • 24 views

Badge +6

I have used the apis to retire and delete the VMs but since the VMs are added everytime manually in the subclient, I would like to use the API to remove it from the content as well. I used the below mentioned API and it deletes the complete content. I just want one VM to be removed.

import requests


url = "https://commandcenterhostname/commandcenter/api/Subclient/100/content"

payload = json.dumps({
  "children": [
    {
      "allOrAnyChildren": True,
      "displayName": "test",
      "equalsOrNotEquals": True,
      "name": "503a1c32-6616-10ds-k9l8-130535306451",
      "path": ""
    }
  ]
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': '*token*'
}

response = requests.request("PUT", url, headers=headers, data=payload, verify=False)

print(response.text)

 

 

icon

Best answer by Albert Williams 15 May 2024, 00:11

View original

1 reply

Userlevel 5
Badge +14

Hello @RandomCustomer 

Thanks for the question, could this link contain the fix for you?

https://api.commvault.com/docs/SP34/api/cv/VirtualizationOperations/update-subclient-virtual-machine-content

Kind regards
Albert Williams

Reply