VMware Cloud Community
kev01228
Enthusiast
Enthusiast
Jump to solution

vRA8: delete snapshot via swagger example?

Hi,
I am trying to delete a snapshot via swagger/postman but I'm striking out bad. Does any have an example of how to do it? 

I am passing this in the body:

{
    "actionId""Cloud.vSphere.Machine.Snapshot.Delete",
    "inputs": {"snapshotId""e664a0ba-7519-40be-90ad-a3c91ec65018"},
    "reason""string"
}

 

and I get this as a response...

{
    "message""snapshotId: Expected '\"e664a0ba-7519-40be-90ad-a3c91ec65018\"' OneOf '[com.vmware.json.schema.model.JsonSchemaImpl@93ccd290]' but matched none.",
    "statusCode"400,
    "errorCode"10006
}
 
Double points for the correct answer!!
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
xian_
Expert
Expert
Jump to solution

Try

{
  "actionId": "Cloud.vSphere.Machine.Snapshot.Delete",
  "targetId": "6d6de89d-b52e-4c87-b989-9d749a5b2696",
  "inputs": {
    "snapshotId": "/resources/snapshots/b29454f5-0156-4dbb-b86d-56d8725500ab"
  }
}

View solution in original post

0 Kudos
2 Replies
xian_
Expert
Expert
Jump to solution

Try

{
  "actionId": "Cloud.vSphere.Machine.Snapshot.Delete",
  "targetId": "6d6de89d-b52e-4c87-b989-9d749a5b2696",
  "inputs": {
    "snapshotId": "/resources/snapshots/b29454f5-0156-4dbb-b86d-56d8725500ab"
  }
}
0 Kudos
kev01228
Enthusiast
Enthusiast
Jump to solution

That did it. Alternately, I was able to use the below as well to delete it as it only required a machineID and snapshotId.

/iaas/api/machines/{resourceId}/snapshots/{snapshotId} 

 

Thank you!

Tags (1)
0 Kudos